01.23.07
Posted in Linux at 12:59 am by are
My new toy, the GP2X! A handheld game console running Linux.
This beauty runs every emulator you can think of, C64, Amiga, Dosbox, Mame, Snes, Sega, etc etc. This means tons of games… and fun fun fun.
It looks like this:

Runs on two AA batterys and has a SD-card slot. I’m using a 4GB card now, lots of space.
Some games I have tried, and is working great:
Doom, Quake, Wolfenstein 3D, Keen 1-2-3, Monkey Island (+other scummvm games), BubbleBubble, Duke Nukem 3D, Sonic the Hedgehog, Mario Bros, Outrun 2, Arkanoid 2, Street Fighter … well, you get the picture.
It can also play movies and mp3… and really anything as long as you can compile the linux program for ARM920 cpu.
http://wiki.gp2x.org/wiki/Main_Page
powered by performancing firefox
Permalink
04.23.06
Posted in Linux at 5:30 pm by are
After realising that I have a lot of files in my home directory, scripts and config files, that I have used a lot of time creating and tweaking…I needed a backup solution. It had to be easy, fast, incremental and take as little space as possible.
Incremental is important here, because sometimes you destroy config files, or want to go back to a known working version.
Using rsync
First I used a script found at http://rsync.samba.org/examples.html. It works great (with a small modification so ssh does not ask for a password). It creates incremental backups, 7 days. But it takes much space, because when a file is modified, a whole new file is stored in the incremental dirs. Also, restoring is easy with a simple cp or scp, but restoring a whole directory from 3 days ago is not that easy.
Also I don’t know if it went well or not, and you can’t run more than one backup a day (without modification to the script)
Ssh trick:
The ssh trick is to have the backupscript know the sshauth socket so it can use your already running ssh-agent socket (the backup script will be running in a crontab, and therefore does not have the SSH_AUTH_SOCK environment var set).
Do this (each time you start your ssh-agent):
echo "export SSH_AUTH_SOCK=$SSH_AUTH_SOCK" > /home/username/.sshauthsock
Then in the backup script do:
. /home/username/.sshauthsock
Using rdiff-backup
Then I came over rdiff-backup. It’s very similar to the rsync method, but for the incremental backup it creates diffs of the files, both text and binaries work. So it’s very space friendly. Also, restoring is easy. The last “complete” backup can be restored with a simple cp or scp, but the incrementals you must use rdiff-backup to get. (there is a manual way).
Statistics:
To get statistics, you can use rdiffWeb. It creates a nice interface where you can browse your backup and restore whole directories, single files and previous versions of those. Also it has a rss feed with status of the backups run. Very handy.
Setup:
Many distributions have rdiff-backup in their packages. Or install from source, it is a python script, and needs librsync library. (see webpage)
You probably don’t want it to backup tmp directory etc. I am using this exclude-file:
- ./vmware
- ./tmp
- ./.thumbnails
- **Cache/*
- **fake_windows/Games
- ./.local/share/Trash
- **hidden_*
I don’t want it to backup the big vmware image files, and not the tmp directory. And all files named “hidden_*” will also be skipped.
Now just run: rdiff-backup –exclude-globbing-filelist backup_excludes_rdiff /home/username hostname::/path/to/backupdir
PS: remember that rdiff-backup is not secure, all files are stored plain on the backup server. If you need security, use duplicity
Also you need rdiff-backup on both client and server side.
Permalink
04.17.06
Posted in Programming, Linux, HTPC, Projects at 2:51 am by are
I upgraded MythTV from 0.17_cvs to 0.19 yesterday. It went smoothly, just a simple “emerge mythtv” and a long wait.
Well…it seemed smooth, until my pc hung and I had to reboot.
After it got up again, everything seemed fine, but when a recording started MythTV segfaulted. Now the hunt begins.
In the syslog I saw:
go7007: unsupported ioctl -1069263306
wis-sony-tuner: tuning to frequency 175.2500 (VHF_H)
Aha, something wrong with the new mythtv tuning…maybe. I tried the Plextor TV402 gorecord program (comes with the driver). It worked like a charm. So nothing wrong with the hardware or tvcard drivers. I’ll have to find out what the ioctl number means.
So I dive into the MythTV sourcecode. Looking at different files. Browsing the linux headers, and finally i find out that the macro _IOC_NR(nr) will decode the number. I then patch the go7007 (tvcard driver) code so the syslog output now is:
go7007: unsupported ioctl -1069263306, type: 86, nr: 54
wis-sony-tuner: tuning to frequency 175.2500 (VHF_H)
So, type 86 nr 54…is not supported. Maybe that’s why it segfaults.
I grep the mythtv sourcecode, but find nothing. I also start mythbackend with –verbose all. It seems it crashes directly after a sql query. hmm.
I then compile mythtv again, now in debugging mode.
I then start “gdb mythbackend”
After it crashes I type “trace” and get a backtrace of the calls. And voila…I see where it crashes.
MythTV has four recording profiles. In the frontend you can change their names…but if you do, mythtv does not work anymore, because the profilenames is hardcoded in the source. So changeing it back to the default profilenames, everything works again.
The mythtv bugreport is here: http://svn.mythtv.org/trac/ticket/1691
(And this was the short story. Finding out how to use gdb, and browse the linux source etc etc takes time…lots of it…and compiling mythtv is not a fast task…god bless distcc)
Permalink
04.07.06
Posted in Programming, KDE at 5:49 pm by are
Zend Studio has a good cvs integration, and you can just right-click to commit and add etc files. But if your commit or update results in a conflict, or you want to merge your file into other revisions. Well, then you must use other tools… until now.
Using some scripts and KDE tools like kdialog and cervisia, we can change this.
Where I work we have at least three versions that all our patches has to go into. That is alot of merging, and it is boring. With the Zend Merge scripts I have created, I replace the cvs command used by ZDE with a custom shellscript. (Tools->Preferences->Source Control in ZDE)
The shellscript does the usual thing (commits, updates etc), but then checks if there were any conflicts. If it were, it asks if you want to resolve them using cervisia.
After that it asks about merging. One of the scripts fetches all the versions you can choose from (this must be customized). It then merges your file into all the selected revisions.
I have also added a context sensitive menu for KDE in the tarball, so you can merge multiple files at once.
(Take a look at the animation on the right for a demo of ZDE integration)
Download shellscripts here | Screenshot
Permalink
04.06.06
Posted in Linux, Freevo, HTPC at 1:17 pm by are
The hot thing these days is HTPC. A pc in your livingroom that looks like a stereo hifi component, and you use it for playing music and movies etc.
The advanced users also use it to record tv-programmes.
My HTPC is not the kind that looks like a stereo component. This is because they are usually very small, and usually very noicy.
I sold the old MSI Mega 865 because it was noicy and it was so small I could not extend it (and the remote and FM radio did not work in linux). Now I got the “Arctic cooling Silentium 2″. I cannot hear it, and my livingroom is once again quiet.
Inside my HTPC i got:
*Intel(R) Celeron(R) CPU 2.40GHz (it’s cheap)
*400Gb Hdd
*450Gb external Hdd (usb)
*Plextor ConvertX TV402 external USB tv-tuner (works in linux)
*Zalman CNPS7700-Cu cpu fan (the biggest fan I have ever seen)
I use mythtv to capture tv-shows with the convertX, and Freevo for playing music and movies etc. Mythtv is only running the mythtvbackend that does the recording, while I use mythweb to schedule recordings.
Permalink
Posted in Linux, Freevo, HTPC at 1:02 pm by are
My old HTPC was a MSI Mega 865 but the support for Linux was crap. I eventually got the linux kernel to control the fans.
For those of you who has the MSI Mega 865 and uses Linux, here is how I got the fans to work:
The 865 uses the Super I/O smbusSMSC47M15x chipset. This is not supported by Linux. (at least not when I had it on 2.6.9 kernel)
Replace the /usr/src/linux/drivers/i2c/chips/smsc47m1.c with this file.
Then do:
echo 8 > /sys/bus/i2c/devices/1-0800/fan1_div
echo 8 > /sys/bus/i2c/devices/1-0800/fan2_div
echo 180 > /sys/bus/i2c/devices/1-0800/fan2_pwm
echo 210 > /sys/bus/i2c/devices/1-0800/fan1_pwm
and the fans will go really slow.
Do “cat /proc/acpi/thermal_zone/THRM/temperature” to see the core temperature rise…
Permalink