Archive for July, 2008

System Administration Appreciation Day

25.07.2008

Well,

Here it is again. The System Administration Appreciation Day.

Lucky me, I’m the only one in the office today, if you don’t count my kids who are keeping company for me today :)

It’s my wife’s last day of her vacation, so we decided to let her enjoy of it as much as possible.

JVC Everio GZ-MG132E and Ubuntu Hardy 8.04

24.07.2008

Right,

This little HDD Camcorder is starting to be really handy. Start with it was a bit of a pain, but with great patience from Jartza, as he managed to get the correct settings for mencoder just right. Need to buy him few beers when he gets back from his tour.

So, the problem with the camcorder is that it creates almost standard MPEG2 movie clips, but those are saved in .MOD type and the “real” video scale is 1.33:1 and that creates a small trouble if you don’t want to use the software that came with the camera. Also, the movie clips are huge, one hour clip is 4G, and to my opinion it needs to be smaller for reasonable storing.

So! Now we need mencoder. $ sudo apt-get install mencoder should do the trick to get it installed.

After a short talk with Jartza, we decided that H264 MPEG4 would be good. 4Gb clip shrinks into about 700Mb and that starts to look much prettier in terms of storing.

Now the actual conversion of the .MOD file into .mp4 is done with two commands, which are long. So I won’t even try to remember them. We need a bit of scripting. Below are the commands, notice that there’s two passes for the same files, so if you have for example MOV011.MOD as original and you give mov011.mp4 as output filename, you need to give those exact names for the second command too.

$ mencoder original.MOD -sws 9 -vf pp=ci,dsize=1.78,harddup -oac faac -faacopts br=128:mpeg=4:object=2:raw -ovc x264 -x264encopts pass=1:turbo=1:bitrate=1500:vbv_maxrate=2500:vbv_bufsize=2500:nocabac:level_idc=13:global_header:threads=2 -of lavf -lavfopts format=mp4 -o output.mp4

$ mencoder original.MOD -sws 9 -vf pp=ci,dsize=1.78,harddup -oac faac -faacopts br=128:mpeg=4:object=2:raw -ovc x264 -x264encopts pass=2:bitrate=1500:vbv_maxrate=2500:vbv_bufsize=2500:nocabac:level_idc=13:global_header:threads=2 -of lavf -lavfopts format=mp4 -o output.mp4

For someone to remember those is seriously damaging to the brain, so we probably like to somehow shorten the procedure. Here’s how it’s done in the easiest way.

Open editor which you prefer, and copy the following code to it and save with some name which is easy for you to remember.

#!/bin/sh

# Script to convert JVC Everio .MOD files into x264 mpeg4 movies#

mencoder $1 -sws 9 -vf pp=ci,dsize=1.78,harddup -oac faac -faacopts br=128:mpeg=4:object=2:raw -ovc x264 -x264encopts pass=1:turbo=1:bitrate=1500:vbv_maxrate=2500:vbv_bufsize=2500:nocabac:level_idc=13:global_header:threads=2 -of lavf -lavfopts format=mp4 -o $2

mencoder $1 -sws 9 -vf pp=ci,dsize=1.78,harddup -oac faac -faacopts br=128:mpeg=4:object=2:raw -ovc x264 -x264encopts pass=2:bitrate=1500:vbv_maxrate=2500:vbv_bufsize=2500:nocabac:level_idc=13:global_header:threads=2 -of lavf -lavfopts format=mp4 -o $2

After saving the text, you can use it as follows: open terminal and cd to the same directory as the script you just saved. will ease up if you have the .MOD file also in that same folder. Then use the script like

$ ./scriptname inputfile.MOD outputfile.mp4

After awhile, you should have outputfile.mp4 in the same directory. Be patient, conversion takes long. I like to open a screen and start the conversion in it, as it can be detached and then attached from other locations too to see if it’s ready.

However, that little script will not check wheter the inputfile exists nor if there’s already an outputfile in the same folder. I use that just to get a shitload of files in a conversion “pipe” by opening screen and then using the script as

./scriptname inputfile1 outputfile1; ./scriptname inputfile2 outputfile2; ./scriptname inputfile3 outputfile3

and then ctrl-a d to detach it and let it do it’s magic.

I’ll post more about how to get some error-checking into the script tomorrow or soon, it’s getting late and I need a hug and sleep to be fresh tomorrow morning. Last day before my one week holiday.

Taa-Taa.

YAY! Now both of our kids are driving bicycle without supporting wheels!

23.07.2008

Ha!

Took about five hours from Miko, the senior, after seeing Jetro, the junior, drive without supporting wheels, to loose them too!

Oh happy days! :)

Yay! Junior has driven his first meters on bicycle without supporting wheels!

22.07.2008

That’s a BIG hi-five to him!

Wheeeeeeeeeeeeeeeeeeeeeeeeeeee!!!

Threw Gnome-Panel away..

22.07.2008

Mh,

Got tired of gnome-panel and decided to give avant-window-navigator a go. Some problems occurred after installation, as desktop just froze right after the desktop background was loaded.

Seems that it was pulseaudio having issues, needed to go to tty and issue kill -s KILL pulseaudiopid before the desktop woke up again. Did quite much work trying to get it work, but seems that following tweaks solved the problem.

Settings – Preferences – Sound : change all definitions from autodetect to ALSA, make sure that on “sounds” tab the Enable software sound mixing (ESD) is selected.
Open Users and Groups from Settings – Administration and check that your username is in the pulse, pulse-access and pulse-rt groups.
Also, have a look at asoundconf tool and it’s commands.

I’ll post some quick installation quide to avant-window-navigator and it’s extras in awhile.

Edit: Still having small issues with login/startup, need to see how my setup works to determine if I’ve corrected the problem. Hold on..

Small gathering among good friends

19.07.2008

Ah, what a splendid day!

Good friends came to our place for a long picnic. We had few kilo’s of pork, filled mushrooms wrapped in bacon, sliced pineapple, halloumi cheese slices and all of those went to grill!

Not forgetting the whopping amount of fresh salad, potato salad, bread and loads of other good food, we talked for quite a long time, had fun and even the weather was on our side. Nice clear sky and over 30C in sun.

Kids played at yard and occasionally inside too (don’t really like that as the weather really was so good) but didn’t really bother to push them outside as we got a bit of “free” time out of it for the adults :D

Now, after nice refreshing shower, I’ll head downstairs to have some evening snack and watch telly for few moments. Then it’s time for wonderland movies, hopefully (though I think I’m so tired that no movies this night asleep).

HP G7061EO laptop, Atheros wireless card and the webcam on Ubuntu Hardy 8.04 i386

15.07.2008

If you have HP G7061EO laptop that has Atheros AR5007 (AR242x) wireless network adapter follow this procedure to make it work in Ubuntu Hardy 8.04

This is for i386 users. I’m repeating that because you might end up messing your system badly if you have 64bit installation.

- First go to System–>Administration–>Hardware Drivers and disable both selections having Atheros in their description

- Atheros Hardware Access Layer (Hal)
- Atheros driver..

- Then Reboot your system.

Preparing your system

$ sudo apt-get install build-essential

- Then open the terminal from Applications–>Accessories–>Terminal and issue/copy the following commands

$ wget http://snapshots.madwifi.org/special/madwifi-ng-r2756+ar5007.tar.gz

$ tar xfz madwifi-ng-r2756+ar5007.tar.gz

$ cd madwifi-ng-r2756+ar5007

$ make

$ sudo make install

$ sudo modprobe ath_pci

$ sudo reboot

That’s it! Now your wireless connection should work.
Webcam works out of the box. To test it, give the following command:

$ sudo apt-get install cheese

Cheese program should appear after installation in “start” -> “graphics”.

Uh, the amount of sugar(hnnnngH!)

14.07.2008

Ok. Just ate about one fifth of a twelve person strawberry cake.

Let’s see if I can get any sleep at night :D

Changes..

14.07.2008

Mmmhh.

Switched over to wordpress. No real reason, just got fed up with blogger’s thingies.

Need to dip my head deep onto this now, so there might be few more posts than earlier ;)

Qemu / KVM in Ubuntu Hardy 8.04 to virtualize WinXP SP3 and updating TomTom One (v3)

11.07.2008

So, here’s what I promised. Have fun ;)

This is specifically about updating TomTom One New Edition using Ubuntu Hardy 8.04, QEMU/KVM to virtualize Windows XP (SP3), but will apply to broader usb-usage in qemu/kvm as well as installing Windows XP into Ubuntu and qemu/kvm.

This walk-through assumes you have Ubuntu Hardy 8.04 and latest updates installed.

The computer I’m using is Dell Latitude D630 with 160Gb SATA drive and 4Gb memory. Display adapter is Intel GM965 as reported by lspci.

From the scratch:

Install qemu and kvm

$ sudo apt-get install qemu kvm

Create an image file to be used as the hard disk (in this case sized 30G) for the Windows XP. Note that using raw image format will only use as much space actually as the installation plus software etc is taking, added few percent. So you won’t actually lose that 30G straight away. It’s a good idea to have plenty of reserve for Windows or any other virtual OS, as it’s a pain to try to expand the image later.

$ qemu-img create -f raw desired_harddisk_name.raw 30G

Get windows XP installation cd as .iso file. “Why?” you’d be asking now. Simple answer is that the installation is way much faster when using a .iso file which is read from hard disk. To use actual cd/dvd-drive, replace “-cdrom filename” with “-cdrom /dev/cdrom”.

Now, start KVM with the following command. Note that “-k fi” is for the desired keyboard layout, in this case fi for finland and “-m 1024″ is the desired memory amount to be allocated to the virtual pc.

$ sudo kvm -localtime -no-reboot -no-acpi -boot d -hda /path/to/desired_harddisk_name.raw -cdrom /path/to/iso-file.iso -usbdevice tablet -k fi -soundhw all -std-vga -m 1024

Complete the first steps of the installation until reboot is required by the installation process.

Note that we started KVM with option “-no-reboot”. this, because a straight reboot without any intervention would fire up the installation cd, thus causing the installation to start all over. We don’t want that.

Start KVM with following command to continue normally with the installation process (and for the future, this startup command works fine).

$ sudo kvm -localtime -no-reboot -no-acpi -boot c -hda /path/to/desired_harddisk_name.raw -usb -usbdevice tablet -k fi -soundhw all -std-vga -m 1024

Now, once you have completed the installation of Windows and all the updates etc, press CTRL-ALT-2 to get to the qemu terminal.

Now it’s time to connect the TomTom device to your computer. Make sure it’s detected correctly (If the folder content pops up to Nautilus, you’re good to go). Open gnome-terminal and type the following commmand

$ sudo lsusb -v | less

Browse until you come across iManufacturer line which says TomTom. now look a bit up and you should see Bus XXX Device XXX: ID XXXX:XXXX

Make a note for yourself of the line, copy it to gedit or write to paper, we’ll be needing this next.

Now, in the qemu terminal, you need to give the following command

(qemu) info usbhost

Output is somewhat like below

(qemu) info usbhost
Device 5.2, speed 12 Mb/s
Hub: USB device 0b97:7761
Device 3.8, speed 12Mb/s
Class 00: USB device 1390:0001, ONE (v3)

Now you should find out the same ID XXXX:XXXX from the output. If you can’t find it, the you prolly didn’t get the SD memory card showing up in Ubuntu either. Get back and fix that problem first.

Next command we’ll be issuing is

(qemu) usb_add host:XXXX:XXXX

if you get just a new line waiting for command, you should be ok, now have a look at Windows, press CTRL-ALT-1.

Now Windows is wondering that what kind of device has been connected. Help windows out by giving standard disk drive driver to it, and Windows should be happy. Almost. After the SD memory card is detected and you can browse the content, you notice that the SD memory card is listed in Explorer as Disk Drive. TomTom HOME does not like this, so we need to safely remove the device. Now that it’s removed safely, go back to qemu terminal with CTRL-ALT-2 and give the following command

(qemu) info usb

output should be something like

(qemu) info usb
Device 0.1, speed 480 Mb/s, Product ONE (v3)

Give following command

(qemu) usb_del 0.1

now, probably the device got unmounted at Ubuntu too, so make sure it’s still mounted or play safe and check that it’s unmounted and disconnect the usb-cable from the TomTom unit. Then reconnect, make sure it’s mounted, go to qemu terminal and issue command

(qemu) info usbhost

You should see the ONE (v3) device, now give command

(qemu) usb_add host:XXXX:XXXX

Go to Windows (CTRL-ALT-1) and check that the TomTom device pops up to Explorer as TomTom (X:) or what ever the drive letter in your case happens to be, also note that there should be that funny little picture with two red hands next to TomTom (X:).

Open the TomTom to explore the content and double click on InstallTomTomHOME.exe and follow thru the installation. Use this method for installing TomTom HOME, as the most recent version of TomTom HOME might not detect the TomTom device correctly. Don’t get any TomTom HOME updates just yet.

Get updates for your TomTom device and when no updates are offered anymore, update the TomTom HOME software also.