Archive for the ‘Ubuntu 9.10’ Category

Things Ubuntu forgot

I have had to install Ubuntu on a couple of machines and every time I do, I find somethings that I forgot to install. Of course, Ubuntu doesn’t come with all the codecs you need or DVD playback so I have written a little script that installs everything I need.  I have found most of the info all over the web and just put it into one script that I run post install. The script installs all the codecs I use and a lot of the programs I like.
#ubuntu 9.10 add ons for playing anything

#add repos
sudo wget –output-document=/etc/apt/sources.list.d/full.list

#add keys
sudo apt-key adv –recv-keys –keyserver 2EBC26B60C5A2783 0DA7581859566E92 D739676F7613768D 43BB102C405A15CB 6AF0E1940624A220 2ED6BB6042C24D89 632D16BB0C713DA6 A6DCF7707EBC211F F9A2F76A9D1A0061 5A9BF3BB4E5E17B5 A040830F7FAC5991 FA3A1271 7FB8BEE0A1F196A8 0CC1223EE2314809 7889D725DA6DEEAA 28A8205077558DD0 2D79F61BE8D31A30 6E871C4A881574DE 66D5C734F6EFB904 DCF9F87B6DFBCBAE 2A8E3034D018A4CE F0876AC9 978228591BD3A65C 6298AD34413576CB FC6D7D9D009ED615 4FEC45DD06899068 2A423FD95416E75D

#update system before new addiotns are made
sudo apt-get -y update && sudo apt-get -y upgrade

#Installing vlc and mplayer (plays almost everything):
sudo apt-get -y install vlc mplayer

#Common codec packs
sudo apt-get -y install non-free-codecs libxine1-ffmpeg gxine mencoder mpeg2dec vorbis-tools id3v2 mpg321 mpg123 libflac++6 ffmpeg libmp4v2-0 totem-mozilla icedax tagtool easytag id3tool lame nautilus-script-audio-convert mozilla-helix-player helix-player libmad0 libjpeg-progs libmpcdec3 libquicktime1 flac faac faad sox ffmpeg2theora libmpeg2-4 uudeview flac libmpeg3-1 mpeg3-utils mpegdemux liba52-dev

#Gstreammer 0.10
sudo apt-get -y install gstreamer0.10-ffmpeg gstreamer0.10-fluendo-mp3 gstreamer0.10-gnonlin gstreamer0.10-pitfdll gstreamer0.10-sdl gstreamer0.10-plugins-bad-multiverse gstreamer0.10-schroedinger gstreamer0.10-plugins-ugly-multiverse totem-gstreamer

#More programs
sudo apt-get -y install gstreamer-dbus-media-service gstreamer-tools ubuntu-restricted-extras

#Enable dvd support
sudo aptitude -y install libdvdcss2 && sudo /usr/share/doc/libdvdread4/./

#dvd ripping and encoding
sudo apt-get -y install kino handbrake audacity

#compiz config
sudo apt-get -y install compizconfig-settings-manager

sudo apt-get -y install gsfonts gsfonts-x11 flashplugin-nonfree

Or you can download the script here
Another thing I like to do is make sure all my Ubuntu installations have the same packages from machine to machine.
First you need to generate a package list file on your current machine.
dpkg –get-selections > selections.txt
Then move that file to the target machine with a jump drive or ssh or ftp or what ever way you can. Then run these commands on the target machine.
dpkg –set-selections < selections.txt
apt-get update
apt-get upgrade
That is all you have to do and both machines have the exact same packages on them.
Fell free to modify theses scripts as you like. They are just here for you to use or modify.

Keep the Hard Drive Bugs Away With RAID

I recently had a hard drive crash and I lost some important files. So I decided to safeguard my backups a little better buy building a RAID (Redundant Array of Independent Disks). The basic idea behind RAID is to combine multiple small, inexpensive disk drives into an array which is more stable than independent disks. This array of drives will appear to the computer as a single logical storage unit or drive.

RAID: Hardware vs. Software

Hardware RAID is just like it sounds, it is a piece of hardware. It is usually faster than a software RAID but you need to have the piece of hardware. The RAID SATA controllers are really coming down in price but you still need to have the hardware.

Software RAID is controlled by the Kernel and it is little slower than the hardware RAID but if you are using it for backups it only has be be faster than the network connection. Plus it is Free!

I went with a software RAID. I had 3 300gig IDE hard drives so I installed them and then configured the RAID.

First you have to set the drives up to take the RAID.

Run fdisk to find all you drives, you don’t want to wipe out the wrong drive by accident.

sudo fdisk -l

In my case the drives were sdc sdd and sde.

sudo fdisk /dev/sde

You must set the tag to fd (Raid Auto-detect), if you need to know how to use fdisk let me know and I can post a short how-to. Repeat this for each drive.

After I change each drive I run partprobe, you probably don’t have to run that until you are done with all of them but I do it just to be sure.

sudo partprobe

Now that your drives are configured lets build the array. I opted for RAID 5. Run the following command to create the array. Be sure to change the drive letters for the ones you configured during the fdisk steps.

sudo mdadm -C /dev/md0 –chunk=64 – -level=5 –raid-devices=3 /dev/sd{c,d,e}1

Now format the array.

sudo mke2fs -j -b 4096 -E stride=16 /dev/md0

After the format is complete check to see if your array is up and running.

sudo mdadm –detail /dev/md0

Next we need to ad the array to the fstab so it comes up during boot.

sudo gedit /etc/fstab

Add in your drive by adding a line something like this (you fstab may be slightly different).

/dev/md0 /RaidArray ext2 defaults,errors=remount-ro 0 1

Remount the drives,

sudo mount -a

Then watch what you have done, the array should be building.

sudo watch cat /proc/mdstat

Now for extra credit, lets set up email notification. This way you can get an email id there is a failure or a drve goes to a degraded state.

sudo gedit /etc/mdadm/mdadm.conf

Add your email


Start the monitor

sudo mdadm – -monitor /dev/md0 &

There you go! It will be used like a regular drive from now on. If something goes wrong with one of your drives you will not loose all the data, and you should get a email of the failure.


Home Theater with the PS3

My new home setup consists of a Toshibia 1080p Monitor, Pioneer Surround Processor, a Sony PS3 for HD video playback, and Megatron my server which houses all of my movies. Connections are made with HDMI between the PS3 and the TV and optical to the surround. The sound is up to 7.1 surround and the video is full 1080p.

I just recently upgraded from the Xbox 360 to the PS3 (thanks to the best wife in the world) and the improvement was noticeable. The 360 only does 1080i on component video while the PS3 does full 1080p on HDMI. There seems to be a great sound improvement on the PS3 over the Xbox. The Xbox was having some issue with the larger HD video files, the processor didn’t seem to be able to keep up. The PS3 also does have a gigabit nic, this makes a huge difference when streaming HD video.

Now for the how to.

The hook up to for the PS3 to the TV was a simple HDMI. Then I ran optical to the Surround processor from the TV, this way I can switch the inputs via the TV remote. I hooked up the gigabit network line to the PS3 and I was set to watch a movie.

I had Megatron setup with uShare DLNA server to share my movies (see how to at my other post Media Sharing). The video share showed up on the PS3 right away and I was able to select a movie. The first on played fine, but the second caused and “Format not Supported” error message. As it turns out some of the movies I had on the server were not supported by the PS3. I needed to change the format, for that I used Handbrake.

Using Handbrake to re-encode my movies was easy. Just select the movie and for the setting use “Normal”. The only issue I really had was with sound. The PS3 seems to like the ACC (faac) codec. Once I had that figured out it was only a matter of waiting for the encode to finish.




Megatron is my computer and the home work horse. The machine started off as a rack mounted server, but it was to loud to run all day and night even if it was in the basement. Also it only had room for 3 drives… not enough. So I got a Extended ATX case for the monster motherboard and built it up.

The specs:

  • Dual 2.5 ghz Opteron 64bit
  • 8gig  Ram
  • 2 – 1000 nics one 100 nic
  • Nvidia 8400 video card dual monitor output
  • 6 USB2.o ports
  • 3 terabytes of Harddrive
  • 7.1 surround sound

The Software:

The Jobs:

  • Media streaming (Audio and Video)
  • Encoding
  • Network backups
  • Shared Drives
  • Torrent server
  • Internal webserver
  • Podcast downloading

Anonymous browsing with Tor


Anonymous browsing is simply browsing the World Wide Web with most of your identity hidden. Browsing anonymously is easy with Ubuntu or Debian. I have some easy steps to get you going.

You’ll need to set up our package repository before you can fetch Tor. First, you need to figure out the name of your distribution. If you’re using Ubuntu 9.10, it’s “karmic”, while 9.04 is “jaunty”, 8.10 is “intrepid”, and 8.04 is “hardy”. If you’re using Debian Etch, it’s “etch”, and Debian Lenny is “lenny”.

Then add a line to your sources.list file

sudo gedit /etc/apt/sources.list


where you substitute the above word (etch, lenny, sid, karmic, jaunty, intrepid, hardy) in place of <DISTRIBUTION>.

Then add the gpg key used to sign the packages by running

gpg –keyserver –recv 886DDD89
gpg –export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add –

Now refresh your sources and install Tor by running

sudo apt-get update

sudo apt-get install tor tor-geoipdb

Install Privoxy

Simply make sure you have universal repositories and then:

sudo apt-get install privoxy

Configure Privoxy

Edit the file “/etc/privoxy/config” doing for example using nano:

sudo gedit /etc/privoxy/config

Add the following line (anywhere in the file is fine):

forward-socks4a / localhost:9050 .
That last . is very important don’t forget it.

Starting Services and Checking Status

sudo /etc/init.d/tor start
sudo /etc/init.d/privoxy start

Check that the service is running on port 9050

netstat -a | grep 9050

You should see the following output:

tcp 0 0 localhost:9050 *:* LISTEN

Now ad the tor button to your browser. Open Firefox, Go to Tools > Add-ons, In the search bar put in TorButton. When it finds it install the add-on. Restart Firefox and click on the Tor button in the lower right hand corner of the browser.

Test your installation:

There you have it, be safe and smart.

Congratulations. You are using Tor.

Ubuntu 9.10 to Xbox 360 Media Sharing

Like most people I have a couple TVs in my house. One of the TVs has the MythBox on it and the other has the Xbox 360. Now I keep all my movies on the MythBox (all legal backups of course). I wanted to play these on my Xbox on the other TV. I noticed that after the Xbox 360 dashboard update the Xbox saw my shared drive and I could browse to my media directories. When I tried to Play one of these I got some cryptic Microsoft error code. So I did a little research and found out that Xbox media streaming uses the DLNA protocol to receive content from a peer on a network. Great, does Linux have a DLNA protocol server, YES, it is called uShare.

Here are the easy steps to set it up.

sudo apt-get update
sudo apt-get install ushare


Once finished, you’ll have uShare installed and ready for configuration. Out of the box, it won’t work for our purpose. You’ll need to edit /etc/ushare.conf to enable Xbox compatibility as well as define the standard port – 49200. Open /etc/ushare.conf as root and change the following lines:


Before these changes will take effect, you’ll need to restart ushare using its init script. However, an issue I’ve noticed is that the last line (’ENABLE_XBOX=YES’) does not always work. So before we restart uShare, we’ll need to make a small change to the init script that resides under /etc/init.d/ to force Xbox compatibility:

sudo vi /etc/init.d/ushare

and add the following line at the beginning of the script:


This tells uShare to start with Xbox compatibility. Now restart uShare using the init script:

invoke-rc.d ushare restart

Now you are finished. You may need to restart the Xbox. Now navigate to ‘My Xbox’ and then select ‘Videos’ and finally you should see ‘uShare’ at the bottom (computer icon). Selecting that will connect to your Linux box and you’ll be able to browse your media just as you would on your PC.

When I tried to play a xvid file it said I needed a download to play this file. I sure it was the codec, but it was free and worked great. Now I have another TV with a HD feed that can Play all the movies on my Media server.

This works with versions of Ubuntu back to 8.10 and Fedora 9,10 1nd 11. For Fedora you have to use yum not apt-get.


Get Adobe Flash player