Wednesday, 30 January 2008

Updating Banshee in Ubuntu (7.10)

If you have installed Banshee from the Ubuntu repository then chances are the version you have is out of date.

It may run fine but be missing useful features or support for your MP3 player. These things are obviously worth having if you are a frequent user of Banshee. To get the latest version you will need to compile it from source.

To start with make sure you have everything you need to compile from source:
sudo apt-get install build-essentials
Next you will need to update mono-zeroconf. To do this download the latest version from the mono-project. You need to download the “Source code for Linux/OS X (tar.bz2).” Once your download has finished decompress it with the commands:
bzip2 -d mono-zeroconf-0.7.5.tar.bz2
tar -xvf mono-zeroconf-0.7.5.tar 
You should now have a directory called something like “mono-zeroconf-0.7.5″. Change directory into it and compile and install mono-zeroconf by typing the following commands:
./configure
make
sudo make install
Finally, make sure you have the remaining dependencies installed by typing the following commands:
sudo apt-get install gnome-common automake1.9 monodoc
sudo apt-get build-dep banshee
You can now upgrade Banshee. To upgrade the latest version you again need to compile it from source. Before you do that make sure you uninstall the current version:
sudo apt-get remove banshee
You are finally ready to download and compile the latest version of Banshee. Head over to the Banshee Release Page and download the latest release (tarball). Uncompress your download with the following command:
tar -zxvf banshee-0.13.2.tar.gz
Change directory into the Banshee directory you just decompressed and compile and install:
./configure –prefix=/usr –disable-daap
make
sudo make install

Sunday, 27 January 2008

Ripping CDs using FLAC format in K3b

After trying to rip a CD to FLAC format with Kubuntu 7.10 I was surprised to find it doesn’t have FLAC as a ripping format option by default.

Getting the ability to use FLAC is simple though, it just requires 2 packages to be installed flac and libflac++6.

To install these just use the following command:
sudo apt-get install flac libflac++6

Saturday, 26 January 2008

Convert DOS newline characters to Unix format in Vi

DOS process text files a little differently to Unix systems. If you write a text file in Windows and then open in in Linux, you may see a ^M on the end of each line. This is just the character that is used on DOS based systems when you press the enter key.

 To get rid of each ^M in Vi use the following command:
1,$s/^M//g
To get the ^M character don't type ^ and M! You need to press Ctrl+v and then Ctrl+m

The 1 at the beginning means start at line 1 and the $ means finish on the final line.

s is the search and replace command. It is used in the format of s/string to search for/string that replaces the search string/

The final g is part of the search and replace command. it makes the command global. If you don't have the g on the end only the first instance is replaced.

Wednesday, 23 January 2008

Setting Folding@Home to run on boot up

On Linux Folding@Home doesn't run manually when you boot up your computer. One way around this is to install it as a service. This will make Folding@Home start up in the background every time your computer boots.

To begin download the Folding@Home client. Once downloaded you will need to extract the contents. The best way to do this is to create a folder somewhere and extract there. I created a folder called folding in my /etc directory:
sudo cp -r folding /etc/folding
Once you have extracted all the files make the Folding@Home client executable with the following command:
sudo chmod a+x /etc/folding/fah
Now run the client manually and enter your user details when prompted. Once you have the client set up and running successfully, exit out by pressing ctrl+c:
cd /etc/folding sudo /etc/folding/fah6
Now that you have Folding@Home set up you can create a bash file which will run the client. This script will be used to start Folding@Home for you at boot. Create a text file containing the following code and save it as /etc/init.d/folding:

#!/bin/bash

cd /etc/folding/
./fah6 >> /tmp/folding@home 2>&1 &

Make this bash script you just created executable by typing:
sudo chmod a+x /etc/init.d/folding
Finally you need to add Folding@Home as a service. To do this type the following command:
sudo update-rc.d folding defaults
This command adds the bash script you just created to the system's startup scripts. So now when you boot up, Folding@Home will start, and when you shut down Folding@Home is stopped.

To check the status of Folding@Home at any time you can check the log:
tail -f /tmp/folding@home
Since the log is placed in /tmp it will be removed every time you reboot so you don’t need to worry about it filling up disk space