Skip to content

Enlarge and run Raspbian image with QEMU under Ubuntu

To run Raspbian with QEMU might help to compile projects like mongopi or node.js with a bit more powerful environment than on raspberry pi itself. For sure, a cross compilation would be the best option, but is not as fun as virtual machines…

This short blog entry shows how to enlarge and run an virtual raspbian image with arm emulator qemu under debian/ubuntu and unifies three different blog entries to get this done.


Posted in Nicht kategorisiert.

Tagged with , , , , , .

Unit and E2E Tests with AngularJS in a Browser

I was playing with the great JavaScript Framework which gains some momentum (from AngularJS – some initial thoughts) in the last weeks. AngularJS is very easy and enjoying to get into it to write one page web pages. The tutorial videos from from John Lindquist helped a lot and clarified some behavior and tricks of Angular.

The documentation of Angular is very good in general and has always a block how to test a specific function of Angular. The standard way for testing is to use Karma (previous Testacular) and runs server side with node.js. If you like to run tests on the client side within a browser the unit testing doc has some missing sections. This blog describes who to setup AngularJS unit tests and end-to-end test within the browser.

Posted in linux.

Tagged with , , , .

Recursive Duplicate Finder

Recently I needed quickly a tool which compares two directories file by file and delete duplicate copies on one side. So it checks the source directory with the copy directory file by file. Each file is compared by inode, size and md5sum. If the source file and the copy file have the same md5 hash value (but not the same inode) the file copy could be deleted via the -d parameter or moved with the -m parameter.
At the beginning I found fslint which was to fancy for this task. And at the end of this blog post I found fdupes which seems to do exactly what I needed. I love YAGN programming 😛

Download script

Posted in ubuntu.

Tagged with , , , , .

Coping mp3 to iPod with Rhythmbox on Ubuntu 10.10

Recently I was unable to copy some audio files to my iPod Touch using Rhythmbox. The copy seems to be OK and I was able to playback the songs of the iPod using Rhythmbox. However, the playback from the iPod did not work. The play sign in the right top corner on the iPod was blinking and the iPod tried some next songs without playing anything. Didn’t it work some days ago?

After depressing searches I found the solution here. You need to install some extra (or simply all) gstreamer plugins with

sudo apt-get install gstreamer0.10-plugins*

and everything works fine again with Ubuntu 10.10, Rhythmbox, mp3s and the iPod again. I love open source!

Posted in ubuntu.

Tagged with , .

Top 20 Travel Advice

Between 2008 and 2010 my girlfriend and I did a world trip through Asia, Australia, India, Africa, and South America. Here here the summarize of our Top 20 Travel Advice

  • First of all: DO IT!
  • The most important things are your passport and your credit card – everything else is optional and replaceable!
  • All preparation you need for a (long term) travel is a good health insurance and the first flight ticket including required visa to your first destination country. Everything else will change during to your trip…
  • Do not book trips from home! They are much cheaper if you buy them local
  • Before you leave your country, leave the half of your luggage at home and double you money on your credit card
  • You need about three weeks to get in touch with one country (How much is a dollar worth, how to travel, where to sleep, where to eat)
  • Take some days off! Traveling and sightseeing is demanding
  • Monkey see – monkey do ! Adapt your behavior in the foreign country – if they cross the street on red – do it as well!
  • Before you enter a country get to know the exchange rate
  • Ask you travel fellows for advices – they might know better places than Lonely Planet
  • Eat in places where Moms eat with their kids. If it is good for them it is good for you
  • Drink water always from sealed water bottles – only in some countries you can drink water direct from the pipe
  • Treat locals always with respect
  • According beggars: Money is not everything. Having a nice and funny conversation helps a lot – especially for child beggars
  • Take care of your belongings in crowded places like main sights, carnival or festivals. (Did you backup your pictures before?)
  • Get to know the local money to detect false money (especially Chinese Yen)
  • Relax: The first taxi drive is mostly overpriced until you know the price (You cant know until you know)
  • If you do not know the price – ask different places and walk around (also helpful for bargain)
  • There will be bad situations – but they are temporary. The worst and coldest 9 hour bus ride on the dirtiest bump road at night has its end
  • Wear a money belt underneath your trousers containing the credit card and the passport
  • Have a fake money pocket with the daily money and some unimportant documents. Just in case you get stolen – the thief is happy with your fake wallet
  • Reduce money transactions as much as possible. A friend back home can do it for you. It is safer
  • Use a partially loaded credit card and reloaded it from time to time (by a friend back home). If your credit card gets lost not all money might be gone
  • For medical care: Keep your own hygienic clove and injection needle with you – you never know how bad world hospitals are
  • Pay always after the service (especially in Sieam Reap, Cambodia)
  • Label you important belongs with your contact details. Sometimes you just forget or lose your items. There are good people out there and want to contact you – at least give them a change 🙂
  • On bus rides: Keep the important stuff always in your hand luggage with you. On sights: leave most things in your hostel
  • You do not need an notebook. There are plenty cheap Internet Cafes out there and you have one item less which you have to take care of
  • Backup and duplicate your digital memories as much as possible to minimize data lost
  • Not a high end camera itself takes awesome pictures – you take the pictures. So get to know how to take pictures well
  • Bind the camera belt around your wrist while taking pictures against thieves
  • For media backup of your photos/videos: Backup your data! Make two DVD copies and ship one to your friend at home. If your friend confirms the shipping, you can trash your 2nd copy. If the shipping gets lost, create another copy and repeat these steps (BTW the shipping is faster than uploading your photos in the world and your friend can upload the pictures for you)

Posted in travel.

Tagged with , .

KlarMobil XSSurfstick W14 mit Ubuntu 10.04

Hier möchte ich kurz beschreiben, wie man mit dem Surfstick von KlarMobil (Tarif Internet Flat500) unter Linux/Ubuntu mobil ins Internet kommt. KlarMobil liefert den UMTS Stick XSStick W14 von 4G Systems mit – doch Ubuntu bzw Linux steht weder bei KlarMobil noch bei 4G Systems auf der Supportliste. Die beschriebene Lösung benutzt usb-modeswitch und wvdial unter Ubuntu 10.04. Sie benötigt weder Windows noch Mac OSX und ist recht zuverlässig.

Die Foreneinträge Baustelle XS_Stick_W14 und mobilcom-debitelstick-t-mobile beschreiben das Problem recht ausführlich, auf denen diese Kurzbeschreibung basiert.

Man installiert die benötigten Pakete usb_modeswitch, usb-modeswitch-data und wvdial.

$ sudo apt-get install usb-modeswitch usb-modeswitch-data wvdial

Man erstellt /etc/usb-modeswitch.conf

# 4GSystems XS Stick W10/W14
# USB-ID im Datentraegermodus
DefaultVendor=  0x1c9e
DefaultProduct= 0xf000
# USB-ID im Modemmodus
TargetVendor=   0x1c9e
TargetProduct=  0x9603

Dazu erstellt man /etc/wvdial.conf und gibt die eigene PIN der SIM Karte unter [Dialer pin] an.

[Dialer Defaults]
Init1 = AT
Baud = 460800
Phone = *99***1#
Modem = /dev/ttyUSB2
Modem Type = Analog Modem
ISDN = 0
[Dialer pin]
; Die eigene PIN eingeben
Init3 = AT+CPIN="1234"
[Dialer reset]
Init3 = ATZ
[Dialer umts]
Stupid Mode = on
Carrier Check = on
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = ATS0=0
Init4 = AT+COPS?
Init5 = AT+CGDCONT=1,"IP","internet.mobilcom"
ISDN = off
Password = "klarmobil"
Username = "klarmobil"
Dial Attempts = 3

Nun ist alles konfiguriert. Nach jedem Systemstart führt man das USB Modeswitch aus, um den Stick zu erkennen. (Bei mir auf Ubuntu 10.04 läuft der Stick ohne weiteren Änderungen wie in den oben genannten Foreneinträgen beschrieben wird. Man kann USB Modeswitch mit udev automatisieren, siehe dazu die Foreneinträge.):

$ sudo usb_modeswitch

Jedes mal, wenn man den erneut Stick W14 einsteckt (bzw. wenn der Stick wieder Strom bekommt), muss der UMTS Stick W14 per PIN wieder freigeschalten werden:

$ sudo wvdial pin

Danach kann man per wvdial sich ins Netz einloggen mit:

$ sudo wvdial umts

Dabei wird eine PPP Verbindung aufgebaut und man kann endlich surfen, nachdem die DNS Einträge übermittelt wurden. Unter Umständen muss man sich öfters einwählen, bis man einen vollständigen Verbindungsaufbau hat. Die Verbindung wird durch ein STRG+C beendet.

Bei mir ist der Verbindungsaufbau recht zuverlässig, auch wenn die Qualität stark variiert. Viel Spaß beim mobilen surfen!

[Update] Laut einem Kommentar ist modeswitch nicht notwendig. Siehe Kommentare.

Posted in linux, ubuntu.

Tagged with , , , .

Convert PalmDB to iCalendar

Reasently I hat the problem to convert a palm DB to iCalendar format. But with jpilot and some scripting tricks it was possible to import the final iCalendar into SunBird.

  1. Export the your palm calendar with iCalendar format to palm.ics
  2. cat palm.ics | perl -n -e 's/\n/BBRR/g; print;'| \
    perl -n -e 's/BBRR //g; print'|perl -n -e 's/BBRR/\n/g; print;'| \
    iconv -c -f utf8 -t utf8 > palm4sunbird.ics
  3. Import palm4sunbird.ics in SunBird.

The command converts the multi-line descriptions to single line descriptions (If you know a shortcut for this, please tell me). Afterwards the encoding is fixed to UTF8. With this it was possible to import a palm DB with over 10000 entries. Cheers.

Posted in info.

Tagged with , , , .

Convert Image to DIN A4 PDF

Following commands shows how to convert an image to an A4 pdf using ImageMagick’s convert and GhostScript.

$ convert input.jpg
$ gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=a4 -sOutputFile=output.pdf
$ rm

Posted in info.

Tagged with , , , , .


Größere Kartenansicht

Posted in info.

Diamond Lane

Als ich vor kurzem in den Staaten war, habe ich mich beim Anflug auf den Flughafen gewundert, warum die linke Spur der Autobahn so leer ist. Als ich später mit dem Taxi zum Hotel fuhr, erklärte mir der Fahrer, dass es eine besondere “Car Pool” Regel gibt: Werktags dürfen auf der linken Fahrspur (gut gekennzeichnet mit einem Diamantensymbol) nur Autos mit mehreren Insassen fahren. Dh. auch besetzte Taxis. Und so fuhren wir ohne viel Stau Richtung Hotel während auf der rechten Seite die einsamen Fahrer zu ihrem Ziel dahin krochen. Eine schöne Regel (siehe auch: Wikipedia).

Posted in travel.

Tagged with , , .