Family, Work, Life

Howto boot ISO images via grub2 with ubuntu

February 6th, 2010 Ansi

Moin

I am using Ubuntu “Daily builds” for some time inside Suns VirtualBox. Unfortunately the daily builds are not longer booting inside VirtualBox for more then 2 weeks now. Christian told me about a new feature of Grub2. You can boot ISO images directly from your hard disk without burning them on CD or USB. Awesome feature and I had to try it today. Here is the description on how to do it with Ubuntu 9.10.

First I am using this tiny script to update all daily builds with the zsync tool. It transfers only the changed parts of the ISO so you and the Ubuntu teams save a lot of traffic.

zsync http://cdimages.ubuntu.com/daily-live/current/lucid-desktop-i386.iso.zsync
cd kubuntu
zsync http://cdimages.ubuntu.com/kubuntu/daily-live/current/lucid-desktop-i386.iso.zsync
cd ../netbook
zsync http://cdimages.ubuntu.com/ubuntu-netbook/daily-live/current/lucid-netbook-i386.iso.zsync
cd ../xubunutu
zsync http://cdimages.ubuntu.com/xubuntu/daily-live/current/lucid-desktop-i386.iso.zsync
cd ..
rm `find ./ -name "*.zs-old" `

This script keeps all my daily builds up to date.

Next Step is to enable the grub menu. In Ubuntu it can be done in “/etc/default/grub“. Change the following lines

GRUB_HIDDEN_TIMEOUT=10
GRUB_HIDDEN_TIMEOUT_QUIET=false

With this change you will see a 10 seconds count down when booting up. With the shift-key you get access to the grub boot menu. Next is to add the ISO images to the grub menu. Change to the “/etc/grub.d” dir.

Here you can find the grub menu entries and configuration files. Add your ISO images starting with 50 here. For example my entry for the normal Ubuntu ISO image (50_ubuntu) looks like this:

echo "Adding $(egrep menu[e]ntry $0 | cut -d'"' -f2)" >&2
 cat << EOF
menuentry "Ubuntu 10.04 Daily Build" {
       loopback loop (hd0,3)/ansi/software_and_config/ISOs/ubuntu/lucid-desktop-i386.iso
       linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ansi/software_and_config/ISOs/ubuntu/lucid-desktop-i386.iso file=(loop)/preseed/ubuntu.seed quiet splash bootkbd=sg --
       initrd (loop)/casper/initrd.lz
}

My ISO files are stored on sda3 under /ansi/software_and_config/ISOs/ubuntu/. In order to change it for your needs there are 3 elements to change. The loopback line contains your hard disk in grub style (hdx,y  x=0->sda x=1->sdb aso) and the path. The third element to change is in the linux line. Store this file as “50_ubuntu” in “/etc/grub.d“, make it executable with “chmod a+x 50_ubuntu” and activate the changes with “ubdate-grub“. After a reboot you should be able to activate the grub menu with the shift-key and select the new entry. Have fun.

I found some pages on this topic but the description there was not working for me so I changed it. But take a look on your own:

  • Share/Bookmark

Chrome extentions

December 20th, 2009 Ansi

Moin

I just run through several Chrome Extensions and here is my list of extensions I can recommend. Please write some comments if you have additional  recommendations.

  • Share/Bookmark

Ansi now on weather underground

June 26th, 2009 Ansi

Moin
Since 5 minutes I push my local weather station data (which can be seen in near real time here) to the weather underground network. See the sticker on the right side or this cool one here:

  • Share/Bookmark

Picture Mashup

April 10th, 2009 Ansi

Moin
Cooly just pointed me to a nice and very funny online mashup service for pictures. Made this funny picture at Hetemeel

einsteinshow.php

  • Share/Bookmark

Twitter analyse

January 27th, 2009 Ansi

Moin
I love these twitter mashups. More and more services are using the API and adding meta services.

  • Share/Bookmark

RSS Torrent List from Onlinetvrecorder.com

January 5th, 2009 Ansi

Moin

Onlinetvrecorder disabled the good old RSS where I can get the list of my torrents of recorded movies. Unfortunatelly the new RSS link requires a session cookie what is not so easy with a bash script. Here is a small solution how to enable the automatic download of the RSS stream in order to download the feeds automatically.

First get an session cookie for www.onlinetvrecorder.com and store it into a local file.

wget \
    --save-cookies ~/.cookies/onlinetvrecorder \
    --keep-session-cookies \
    --post-data "email=name%40provider.com&pass=whatever&checkbox_remember=checkbox_remember&btn_login=Login&do=login" \
    -O - \
    http://www.onlinetvrecorder.com/index.php \
    > /dev/null

With this command you store the onlinetvrecorder session key to a file what you can use later on to download the RSS feed. “keep-session-cookies” are important because the key is only valid in the session. Replace “name”, “provider.com”  and “whatever” with your personal data. the “%40″ is url code for @.

wget -o /dev/null -O - --load-cookies ~/.cookies/onlinetvrecorder "http://www.onlinetvrecorder.com/rss/rss.php?hash=hashcode&userid=id"

Also replace “hashcode” and “id” with your personal data. You can see it in the browser when you check the RSS feed in your browser. Thats all. I think the uTorrent or other trackers can deal with a local file to parse. So just use a cronjob to store this file from time to time to local disc and let uTorrent do the rest. :-)

  • Share/Bookmark

How to export display via SSH after sudo su

October 8th, 2008 Ansi

Moin
Just figured out together with DrScofield how to export the Display via an SSH tunnel after changing user to root via sudo. And hey it sound trivial but was not easy to find out. Here is the step by step way.

  1. ssh -X server #as normal user
  2. xterm #for testing if export display as normal user works
  3. echo $DISPLAY #write it down
  4. xauth #enters the shell of xauth
    1. list # find the line with the display number from step 3 for me it was “wpsvm054/unix:12 MIT-MAGIC-COOKIE-1 071df2e12cfff0ed75fd0af5869665f7″ remember the first part of it
    2. quit #to leave the shell
  5. xauth extract filename system/unix:12 # the line from step 4.1
  6. sudo su – # to become root
  7. xauth merge filename # filename from step 5
  8. export DISPLAY=:nummer.0 #Displaynumber from step 3 resp. 4.1
  9. xterm #for testing

Hope it works on other systems too.

  • Share/Bookmark

Convert

September 18th, 2008 Ansi

Played around a little bit with ImageMagick and specially with the convert command.

Nice feature is to add Text on a picture like a watermark:

convert -font \
/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/luximri.ttf \
-pointsize 160 -fill black -draw "text 0,590 'Text auf Spike'" \
P1020049.JPG spike.jpg

or make a border arround a picture

convert -border 10x10 -bordercolor "#000000" P1020049.JPG spike2.jpg

Nothing special but was nice to play with it.

  • Share/Bookmark