Saturday, May 03, 2014

A multiprocessing map function for python

Often one wishes for a simple way to speed up CPU intensive tasks in python. This version of python's map( .. ) function takes of process based parallelization and circumvents the restrictions of the global interpreter lock (GIL). One problem with using the multiprocessing Queue in python is that the submitted jobs are not processed in the submitted order. Therefore, before anything is returned, it is sorted by the input. Now just use mp_map instead of map and enjoy unrestricted speed :)

Thursday, February 07, 2013

Setting up a Raspberry Pi for OSX using a direct ethernet connection

The Raspberry Pi is a great piece of hardware. However you don't always want to hook it up to some screen and keyboard when working with it. I in fact never did since I like to do everything using SSH which is enable out of the box if you are using the raspbian distribution. So just hook it up to your router and start hacking. But what if you have no router and only you Mac?
The Raspberry Pi is configured by default to receive an IP address from a DHCP server. So you need a DHCP server.

This can be done using the sharing option in OSX. Just set it up like that, ignore the warning about your ISP, since you are not connecting to anything but you Raspberry Pi. You can also share your wifi-connection if you are at home but if you have secure enterprise wifi this option doesn't work. Once you have enabled this option just connect your mac and Raspberry Pi using an ethernet cable and THEN connect the power to the Pi.

Also note that you don't need a cross-over cable, any normal ethernet cable will do. If it doesn't work at once try disconnecting the power from the Raspberry Pi. Now you can login using ssh to the Raspberry Pi at Happy hacking!

Wednesday, June 29, 2011

Mounting SSH on Mac OSX

If you want to stay stay with free tools and mount ssh shares on OSX MacFusion is the tool of choice.

However for me MacFusion quits with an error "Failed to mount" and the log revealed:
(SSHServerFS,, 29.06.11 19:27) /Library/Filesystems/fusefs.fs/Support/fusefs.kext failed to load - (libkern/kext) link error; check the system/kernel logs for errors or try kextutil(8).

This is a bug in the current MacFuse version (2.0.3).

The solution is to install the NTFS-3G Project's MacFuse binaries at

Thanks to Jacobs UNIblog

Friday, June 24, 2011

2011 Macbook Pro: State of linux wireless support

Want to use your favorite operating system of your favorite laptop?

The 2011 Macbook Pro uses a Broadcom 4331 chipset for which there exists no driver at this point. And according to the Ubuntu forums NDISwrapper does not work either.

However Broadcom states that:

"We have plans to support the BCM4331, and other new chips, with the
brcmsmac driver. I don't have an ETA, but new chip support is the first
thing on the priority list after getting the brcmsmac driver out of staging."

Also there are also community efforts to create a driver and today one kernel-hacker told me:

"Hey, the work has just started and its really hard as we don't have ANY specs. Everything I write is from dumps without knowing real stuct of the driver. There is a lot if guessing, starring at the dumps and trying to find a relation with specs for older cards.

I'm on vacations right more, I expect to perform first tests in 2-4 weeks, do then ill be able to tell you more."

So all one can do at the moment seems to be buying an wifi-stick (which sucks, since the macbook wifi was four antennas and should provide a really nice connectivity) or wait.

Sunday, February 06, 2011

OSX Snow Leopard on VirtualBox

Can't afford a Mac? Wanna do iPhone development with Ubuntu?

There are reasons why one would want to have OSX running on VirtualBox but getting it to run is not so easy.

First of all you need

- VirtualBox
- Hazzard OSX Distribution, can be found on the net

Now set up a new virtual machine in VirtualBox and select Mac as operating system.
The harddisk size should be at least 10GB, I chose 20GB

This gives you EFI enabled in the system tab of the virtual machine's settings.

Next boot the Hazzard OSX Distribution an start installation. Use the Disk-Tool to make a new partition.

Don't start the Installation yet!

You need to customize it and only install the Legacy Kernel and the latest Chamealeon bootloader.

This is all and you can begin the installation.

When you're done and before you boot into you new system go the the virtual machine's settings again and switch off the EFI option in the system pane.

The last step is to switch off Apple CPU power management by deleting /System/Library/Extensions and trashing AppleIntelCPUPowerManagement.kext

Otherwise you will have full CPU usage even in when OSX is in idle because it is flooding the CPU with debug messages.

Remember to redo this step after installing Apple's software updates.

Saturday, October 23, 2010


So let me cover an innovation that actually look good on me - like an iPhone.

The andtie.

It's gonna keep you warm since the folks from Denmark know what cold and wet means. They came up with the idea and the material feels pretty high-quality.

Check it out.

Tuesday, August 11, 2009

Dry-Ice Canon fun

Use frozen carbon dioxide (dry ice), mix it with water and pipe the steam into a PET bottle. When the bottle at roughly 22bar explodes you can shoot for example a toy chicken over more than 80 meters (We had serious problems to build a projectile that is not destroyed by the power of the launch). We built the device for a creativity competition at our university.
And well, we could not place an object accurate on 20m but for shure we did it with the biggest impact.

Music on Amazon and iTunes

If you are curious, here some detail about the construction:

For us secure handling was not only an option. We have seen some people that put water and dry-ice together into an bottle close it and put it into a pipe. But you have good chances that it will explode in your hands. So we put an PET bottle into our pipe and connect it with an CNC made adapter to the presure reservoir outside. Beside that, all parts are made from steel and welded. We experienced that a 1.5l coke bottle (actually we used Deit bottles that explode in a better way) can withstand up to 22bar of pressure (what is more than most sources on the internet report)

The next design decision we had to make was a system to quickly inject all the water while not blocking the exhaust of the considerable amout of CO2 gas that is generated as the water mixes with the dry-ice. We first tried it with an single valve but had a problem to get more water it at some point when to much CO2 was exhausted. Howerver two, one for water injection and the other valve for the gas exhaust were ways better.

Finally, the manometer is not necessary but nice to have as it makes the firing a bit less surprising. All in all we spent about 90 Euros.