Compile mplayer from source in Ubuntu Karmic

Monday, October 19, 2009
I have had some trouble the last little while with mplayer and mencoder in Karmic (beta). I am not sure if it is the result of mixed repositories or not, but I had to find a solution.
I was unable to find a procedure that worked completely. I mixed up what I had read from forums and mplayerhq. I wrote a script to compile mplayer from source and install using "checkinstall".
I have only tested this on my laptop (Karmic 64bit) and my desktop (Karmic 64bit) and they both compiled without any issues.

Here is the script


Just save it to your home directory.
Make it executable with
chmod +x updatemplayer
and execute it by typing
./updatemplayer
Enjoy!!




How to create a Multiboot ISO with Grub2

Thursday, October 8, 2009
Edit(March 17 2011): I now use Multisystem.


Edit: Before you read this article, You should be aware that This method only works when burned to a cd/dvd or by using the iso file in a virtual machine. I have used the Ubuntu USB Startup Disk Creator as well as Unetbootin and I haven't figured out how to make things work just yet. Please bookmark the link to this article and I will update as soon as I get everything working.


I have been playing with grub2 and booting linux iso files since I watched episode 602 of Hak5.
This method is attractive to me bacause I do not need a separate usb stick for each distro I want to play with or install. I could have a 16 gig usb stick with 20 distros or more on it if I wanted to. I have found a way that is fairly simple to install grub2 to my usb stick and boot linux iso's with the "loopback" option of grub2. There is a package in Ubuntu called grub-rescue-pc.
You can install this software by issuing the command
sudo apt-get install grub-rescue-pc
Or by using synaptic if you prefer.
While we are at it why don't we install qemu and isomaster as well.
sudo apt-get install isomaster qemu
After installing this package there will be two files in /usr/lib/grub-rescue. The grub-rescue-cdrom.iso is the file that we will be using. This file contains a bootable image of grub2. We can also edit this image file with a program called Isomaster (also available in the repositories). If you prefer, you can install the grub image onto the usb by using the ubuntu 'usb-creator' or unetbootin.
This will make the editing and adding of iso files easier but to test the end result you will need to reboot your pc every time. Time can be saved by editing the grub2 iso image directly and testing the file with Virtualbox, VMWare or Qemu yada, yada, yada. Pick your poison.

After you have installed grub-rescue-pc, Virtualbox and Isomaster, we can open up the grub-rescue-cdrom.iso image with Isomaster. In the directory "/boot" of the grub2 image you will need to create a folder called "iso". Once the folder exists you can now add your linux iso files in this folder. It is as easy as browsing to the iso file that you want to add in the top pane of the program and clicking on the Add button. Now that you have some distros in there, let's see if we can make them work.

The file we will be editing is /boot/grub/grub.cfg of the grub2 image file. Not the one installed on your hard drive. (This can be done within Isomaster)
I used this site as a reference for the distributions that I am playing with.
Just under the line that says:

# For booting GNU/Hurd
you can start to add entries for your distros that you want to boot.

I decided to try Ubuntu 9.04 (32 bit) as well as Ubuntu 9.04 (64 bit).
Here are my two entries that allow them to load.

menuentry "Ubuntu Live 9.04 32bit" {
loopback loop /boot/iso/jaunty-desktop-i386.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/jaunty-desktop-i386.iso --
initrd (loop)/casper/initrd.gz
}

menuentry "Ubuntu Live 9.10 64bit" {
loopback loop /boot/iso/karmic-desktop-amd64.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/karmic-desktop-amd64.iso --
initrd (loop)/casper/initrd.lz
}

Notice that the last line for each entry is different. Ubuntu 9.04 says /casper/initrd.gz and the Ubuntu 9.10 says /casper/initrd.lz . This is important, so if you do any editing, keep this in mind. You can make your own entries for other distrobutions as you wish. Once you are satisfied you will have to save the image as a new iso file.( this will be the one you will load to your usb drive.

I find the easiest way to test the end result is with qemu. It loads fast and your results are prety much instant. I have also made a nautilus script so that I can launch an iso with qemu right from the right click context menu.
Here is the script
qemu -cdrom $* -boot d
If you want to allocate a certain amount of memory to the virtual machine add " -m 700". This will allow 700 mb of system memory to be used by the vm. Place this in a text file. Name it qemu-livecd and save it to ~/.gnome2/nautilus-scripts/ and make it executable. Now when you right click on the iso file go to Right Click>Scripts>qemu-livecd.

Once your configuration is complete and you have tested that all of the menus work you can load the image to your usb stick using unetbootin or the ubuntu USB Startup Disk Creator. Or your favorite app that you normally use for this task.

If you decide later that you want to update any of the distributions on your usb stick you can just plug it in to your pc and replace the iso files with the new ones. Pretty simple huh?

If there is anyone that wants to make a gui for this, please let me know.




How to run hamachi ( VPN) as a service on Ubuntu (All) 32 bit and 64

Monday, July 13, 2009

This procedre will make hamachi start as a service without any interaction from the user on ubuntu 8.04, 8.10, 9.04, 32 and 64 bit versions.

Hamachi is a vpn solution that will not require any firewall port forwarding. I use this program to connect to my work computer from home and vice versa. I have been using it for a couple of years and I find that I could not live without it. Through many months of searching and testing I have created an easy way to get hamachi to run as a service in ubuntu. Normally you would have to run /sbin/tuncfg with sudo to get hamachi to run. If you are logged in to a remote location and you rebooted the remote machine, there was no way to log back in until someone ran “sudo /sbin/tuncfg”, and “hamachi start” from the keyboard of the remote machine.

I have been using a script that I found in the ubuntu forums that works perfectly. I have gone a step further and made another script to automate the process of installation. Below you will find two files that are needed to install hamachi from scratch. The first file is my script, and the second is a text file.

The first thing you will have to do is download both files posted below and save them to your home directory. On line #5 in the text file it reads

USER=username

You have to change 'username' to the user you are logged in as. Ie: drew

You will also have to edit line #9 in the script to reflect the username that you are logged in as.

Before running the script you must make it executable by typing

chmod +x autostarthamachi

You will need to run the script with sudo, so you can run the script by typing

sudo ./autostarthamachi

The script will download and install hamachi from sourceforge.net and install it as well as create the files needed to run hamachi as a service.

Now it is time to setup hamachi. First you will need to run

sudo tuncfg

And then run

hamachi-init

This will generate the keys for hamachi

Then you will need to start hamachi

hamachi start

Then run

hamachi login

to put the daemon online and to create an account.

hamachi join 

to join the network.

hamachi go-online 

to go online in the network.

hamachi list

to list network members and their status.

Once you have hamachi installed and running you can reboot your machine and check that hamachi is running and logged in by typing

hamachi list

If hamachi does not complain then everything was a success.

If you would like to try a very nice gui, I highly recommend 'hamachi-gui'


autostarthamachi

autostarthamachi64

hamachi