Archive for the ‘Ubuntu’ Category

With Docker, you can specify the command to run inside the container on the command line. But what if you want to run multiple commands? You can’t escape the && syntax, or wrap the command in quotes, as Docker won’t recognise it. The trick here is to use sh -c ‘<command1 && command2 [&& command3 […]

There are various reasons you may want to set your IP address to be static, one of these being to reduce boot time by removing DHCP discovery. Doing this in Linux is quite straight forward. If you want to make your current IP address your static address, you can find the details in a few […]

Japanese, like many other Asian languages, is written using a variety of symbols which are not found in the standard ASCII table. Fortunately, you can include these symbols in LaTeX documents using the CJK package. In ubuntu this can be installed via the sudo apt-get install latex-cjk-japanese command. I’m not sure about Windows, Mac or […]

The Amazon Kindle is a great little device which stores it’s documents unencrypted and unhidden on it’s hard drive, just like you would on your PC. This means you can add and remove documents as though it was a USB drive. It’s that easy. But on Ubuntu when you plug it in, nothing happens. The […]

Piping stderr in unix

Posted: 26th May 2011 by Tim in Bash, Ubuntu
Tags: , , , , , , , , ,

In unix, you can pass output from one program to another using the pipe symbol (|). Unfortunately, it only pipes the output from stdout (cout). You can pass the output from both stdout and stderr (cerr) by adding 2>&1 to the end of the command before the pipe, where 1 is the file descriptor for […]

Sometimes in a terminal you want to strip out the first line of output from a command. For example, you may want to generate a list of users which have tasks running using the ps command. This command puts a header at the top of the output. You can remove this header by piping the […]

This is a very specific post about using the £8.97 VGA webcam from Tesco with Ubuntu 10.04, namely with Skype. These instructions might work with other webcams and/or other linux distros, but I have not tested this personally. If this does/doesn’t work for your webcam/distro combination then please leave a comment describing your experiences. Okay, […]

There are a number of ways to convert CDs into MP3s in Ubuntu. For me, the best choice is Sound Juicer because of it’s filename flexibility and ability to deal with compilations. Setting it all up is also very simple. Only two packages are required from the repository. They can be installed with the following […]

Ever jumped onto an Ubuntu server somewhere without knowing which operating system version it’s running? You can find this out with one simple command: lsb_release -a This will provide output like: Distributor ID: Ubuntu Description: Ubuntu 9.10 Release: 9.10 Codename: karmic

Pausing processes in ubuntu

Posted: 6th June 2010 by Tim in Ubuntu
Tags: , , , , , ,

There are times when you want to pause a process and continue it later. For example, when a process is using all the computer’s resources and you need to access something or execute something else. This can all be done via the kill -STOP and kill -CONT commands. First you need to grap the pid […]

Some mail servers require you to connect on a certain port. Evolution (the default mail client for the gnome desktop environment) doesn’t have a setting for the server port number. You can set this by adding :[port_no] to the end of the server address. For example, to use the mail server mail.example.com on port 587, […]

Mounting ISO files in Linux

Posted: 24th April 2010 by Tim in Ubuntu
Tags: , , , , , , , ,

One of the niceties of linux distros like Ubuntu is that you can ‘mount’ ISO files. An ISO file, or ISO image, is an archive of a CD or DVD. By mounting an ISO file, you can read the data as though you inserted the CD into your computer. Ubuntu will even regard it as […]

Let’s say you have a file type whose contents are in XML format but have a different file extension such as .tim . If you want to edit these files with Vim with syntax highlighting, simply add the following to ~/.vimrc (affects only your Vim environment) or /etc/vim/vimrc (affects everyone’s Vim environment): au BufNewFile,BufRead *.tim […]

If you’re getting a FATAL: Ident authentication failed for user [username] Error when attempting to connect to postgres as a specific user, chances are you need to change some security settings. Postgresql, by default, only allows you to connect to postgres if the postgres username is the same as your username on the operating system. […]

The learning curve for LaTeX documents can be a steep one. This step-by-step guide covers installing and setting up the LaTeX environment, and creating and compiling your first document so that you can read and distribute it. Setting up the LaTeX environment A few things need to be installed before we can start creating documents. […]

Playing DVDs in Ubuntu

Posted: 31st December 2009 by Tim in Ubuntu
Tags: , , , , ,

Unfortunately, you cannot play all DVDs in Ubuntu out of the box. Some packages need to be installed manually due to legal issues in some countries. If you find yourself getting errors like VLC is unable to open the MRL, chances are this is your problem. It’s a simple fix (paste this into a terminal/console): […]

Doxygen highlighting is set up by default on most Vim installations, but for some reason it’s disabled. There are two options for enabling it. First, it can be enabled globally. This means adding the parameters to the global Vim configuration. Note that you may need to be root for this to work (ie: sudo echo […]

If you’re trying to compile C programs for Linux on an AVR32 architecture, you’re going to have to get the avr32-linux-gcc cross compiler. Note that you can’t use the avr32-gcc compiler, as this compiler makes programs which do not run on an operating system (ie: they talk to the system directly), which will not run […]

SSH Login without a password

Posted: 17th November 2009 by Tim in Bash, Ubuntu
Tags: , , , , , , , ,

If you access the same computer through SSH on a regular basis, or want to access a machine through SSH in a script, then you don’t want to have to worry about passwords. Luckily, there is a way to grant SSH access without a password while remaining secure. For a quick and easy fix, download […]

KDE Message Box Popup in Bash

Posted: 8th November 2009 by Tim in Bash, KDE, Ubuntu
Tags: , , , , , , ,

If you’re writing a bash script which may take a while to finish, such as a backup script, it’s often useful to have a popup notifying of the completion of the script. This can be done with the kdialog tool. There are a bunch of options for this tool (run kdialog –help-all for details. For […]

CVS is annoying in that if you want to find out which files have been modified or need updating, you can’t simply use the cvs status command as there’s too much information displayed. In order to make it useful, you really need to filter the output. Note: the following tutorial only works for linux computers […]

If you’re looking to make yourself a GPS navigator on your laptop / PDA / whatever, you can get it set up pretty quickly using an open source GPS navigation package called Navit. For this walkthrough, we’ll make the assumption that you have a GPS receiver connected through serial or USB, and that you’re running […]

MySQL comes with a library to make talking to MySQL with C easyish. There are a few things you have to install first, though. I’m using Ubuntu 8.04 for this walkthrough, but things should be similar for other flavours of Linux. Before we start, we have to download the development files required: sudo apt-get install […]

Adding subdomains in Apache

Posted: 20th August 2009 by Tim in Apache, Ubuntu
Tags: , , , , , , , ,

There are a number of ways to add subdomains in apache, but here is the quickest and most basic way to get it done. This example is for Ubuntu 8.04, but may be used on other flavours of linux if you find the correct paths to the files. Let’s say you have a blog on […]

Getting MP3s working on Amarok

Posted: 26th July 2009 by Tim in Ubuntu
Tags: , , , ,

Amarok, by default, does not come with the MP3 codecs installed. This is for a variety of reasons that I’m not going to go in to here. To get MP3s working in amarok, or to listen to internet radio, you need to install the libxine1-ffmpeg package. In ubuntu, that means doing the following: sudo apt-get […]