Git: ignore Mac OSX icon files

When using git on Mac OSX and your project’s folder has a custom icon, you will see a “Iconr” File showing up in your git status or Source Tree. Ignoring this file doesn’t work.

The solution is to ignore the correct way (or syntax), because Apple uses ^M at the end of the filename, which is a CRLF, a hidden character. In fact you have to ignore “Icon^M^M” in your .gitignore file, but it’s not easy to enter these special characters as ^M is in fact one single CRLF character.

I found a hint using the ruby interactive interpreter, but i wanted to use my beloved Python, so here’s the code:

>>> f = open('.gitignore','a')
>>> f.write('Icon\r\r')
>>> f.close()

use this in your home directory as you need to edit ~/.gitignore and ~/.gitignore_global (for Source Tree)

Resize Raspberry Pi SD Card Image

I had the need to shrink a 16GB microSD card to use the image on my other Raspberry Pi, but only had smaller SD Cards lying around. So what now?

After a lot of tests and googling i found a way to get this working on my Mac OSX.

Things you need:

  • Apple Pi Baker
  • gParted Live Image
  • CD Burner and empty CD or an USB Stick with at least 256 MB
  • big SD Card containing current Raspberry Pi image
  • smaller SD Card (2GB, 4GB, …)

Apple Pi Baker is a GUI to copy Raspberry Pi or other .img files to a SD card or USB stick, like using dd from command line, but with the advantage of using a GUI and displaying the time remaining for the process to finish. Additionally you can use it to create a .img from a SD card (backup) or create a Raspberry Pi NOOB SD card.

Part I: gParted

Download gParted live image from

When using a USB drive:

  • convert the downloaded .iso to a .img in the directory containing the .iso with this Terminal command:
hdiutil convert source.iso -format UDRW -o destination.img
  • then use Apple Pi Baker to copy the gParted.img to the USB Stick

When using a CD:

  • open the .iso in Disk Utility
  • Burn this image

Then connect the USB stick to a Mac or PC or boot from the CD.

Start gParted an then select the SD card (on Mac you will need to use a USB SD card reader as the internal SD card reader is not supported) and select the second (big) EXT4 partition and resize it to a bit bigger than the minimum size or a little bit smaller than the desired SD card size (1.9 GB for a 2 GB SD card).

eject the SD card and / or restart your computer.

Part II: create card image and restore

Use Apple Pi Baker to backup your (big) SD card. This will create a image in the size of the card, not in the size of your shrinked image! 

The trick is to restore this image to the smaller SD card. This will work, because you shrinked all partitions below the size of your (smaller) SD card. Apple Pi Baker will diskplay a warning that the image is to big to restore to the SD card, but it will stop when the card is full.

Now we have the smaller SD card and we’re almost finished.

Part III: fix the SD card

Now insert the smaller SD card into your Raspberry Pi and power it on to boot.

Booting will fail as fsck will fail to repair the card automatically. But pressing CRTL-D to continue will fix the problem and reboot the Raspberry.

Part IV: backup the smaller SD card (optional)

Now it’s a good idea to backup the small SD card to a now smaller .img because the backup will always have the size of the card used. Use Apple Pi Baker for this again.

To fill the whole SD card use this command in the Terminal of your gParted Live CD / USB stick, where XXX is the name of the SD card (eg. /dev/sdc2):

# resize2fs /dev/XXX

Upgrading XServe (2009) Drive Modules

Lately i thought it’s a good idea to reuse the old XServe 2009 Model (only capable of running OSX up to 10.6) as a VMWare Sphere Host. But this model has just one harddrive installed in an ADM (Apple Drive Module) with a capacity of 80 GB.

I grabbed a 2 TB Western Digital green harddrive and replaced the 80 GB drive in the drive carrier.

But the ESXI installer couldn’t find the drive :-(

After some online research i found a hint that the ADM only use 1.5 Gigabit Mode for Serial ATA. So i installed a jumper on position 5-6 on the Drive and voilà – it worked!

Vagrant and VirtualBox 4.3.10 not mounting /vagrant

seems to be a bug in VirtualBox 4.3.10, but there is a quickfix available. Do vagrant ssh and then:

sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

Moving from Sublime Text 2 to Sublime Text 3

Screen Shot 2013-11-15 at 16.46.02As Sublime Text 3 is around in public beta for quite some time, i thought i upgrade from my 2.x version to the new and – as it’s written on their homepage – faster version 3.

Ross Lawley has a perfect guide how to upgrade painlessly:

And thanks for the hint to check the compatibility of the plugins first on this great page:


Steps how i upgraded:

  • download Sublime Text 3
  • install package manager in Sublime Text 3 by showing the console (view -> show console) and entering this text:
import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( '' + pf.replace(' ','%20')).read())
  • using the package manager install all your (green) plugins you used on Sublime Text 2
  • copy and paste user settings (Preferences -> Settings -> User)
  • go to terminal and copy TM Themes, other settings and relink the commandline “subl” to the new version (i have ~/bin in my path):
$ cp ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/*.tmTheme* ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/
$ rm ~/bin/subl
$ ln -s /Applications/Sublime\ Text\ ~/bin/subl


Use multiple email addresses (SSH keys) with GitHub

There is a good tutorial on Gist that shows all the required tasks:

This post is to remind me how to do it 😉

Shairtunes (airplay audio client) on Mac OS X 10.7

Based on Thias blog instructions on building shairtunes for Mac OS X.

  • install XCode using AppStore on Mac OS X 10.7 (a AppleID is needed for that)
  • open XCode, in the Preferences “Downloads” click on button to download and install the Command Line Tools
  • Download and install Mac Ports (
  • Open Terminal and type:
$ sudo port install git-core libao p5-io-socket-inet6 p5-libwww-perl p5-crypt-openssl-rsa
$ sudo port install pkgconfig

install shairtunes as a damon:

$ sudo mkdir -p /usr/local/bin/
$ sudo cp hairtunes /usr/local/bin/
$ sudo vi /usr/local/bin/ # change the path of cli_hairtunes  /usr/local/bin/hairtunes
$ sudo cp org.mafipulation.shairport.plist Library/LaunchAgents/
$ launchctl load org.mafipulation.shairport.plist
$ launchctl unload org.mafipulation.shairport.plist # (to remove)


works only while a user is logged in! (on the login screen there is no shairtunes possible) consider using autologin for this mac (but be aware of the possible security risks!)

OpenWRT on TP-Link MR3020 as infopoint with local webserver

Howto install OpenWRT on an TP-Link MR3020 mini router with external filesystem on a USB stick running a local webserver (lighttpd) to serve up webpages to act as an info point e.g. in a exhibition.

Inspired by the Piratebox Project:

New Fritzing parts

I recently built two Fritzing parts, as i needed them for documentation and since they are Sparkfun breakout boards, i thought they might be useful to others, so i shared them on the Fritzings Google Code page. Today i found this comment and i’m happy that two parts i made will be integrated in one of the next Fritzing versions :-)

If you can’t wait till the next Fritzing release, here are the parts:

SHT15 humidity sensor breakout board from

Humidity Temperature Sensor SHT15.fzpz

ADJD-S311 color sensor breakout board from

Color Sensor Breakout ADJD-S311.fzpz

iChat 6 (Lion) as a Adium replacement?

For years i used Adium, but sometimes i miss the video and audio features iChat provides.

As i updated to Mac OS X 10.7 aka Lion i thought i should give iChat a try. Suprisingly iChat 6 has some features which come close to Adium’s user experience:

  • now supports Yahoo! Messenger, even with audio and video – that’s good!
  • has an open plugin interface for thirdparty protocols
  • Facebook (using Jabber): works
  • Jabber server from work works out of the box
  • GMail / GoogleTalk works (audio / video not tested)
  • AIM out of the box
  • ICQ works (you have to use an AIM account and change the server to and disable SSL)
  • Bonjour works out of the box

Protocols i used in Adium and missing in iChat out of the box:

  • Twitter (workaround: – seems to work)
  • MSN (“Cocoon” plugin is in early development, but seems promising)
  • IRC (iChat 6 plugin is also in early development, but promising, was able to connect to a room, but many features missing)
  • Myspace (but who is still using it anyhow 😉 )

right now iChat seems to provide almost all important protocols i used to use on Adium plus the video and audio chatting.

Sprache ändern