Posts Tagged ‘linux’

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 […]

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 […]

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 […]

In Bash you quite often need to check to see if a variable has been set or has a value other than an empty string. This can be done using the -n or -z string comparison operators. The -n operator checks whether the string is not null. Effectively, this will return true for every case […]

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 […]

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. […]

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 […]

There is no way to delete a folder in CVS like you can with files. The directories must be kept so that the versioning information relating to the files which used to be in the repository can still be used (ie: you can revert back to a revision when the files still existed). The only […]

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 […]