Category Archives: Coding

Fractal terrain generation

Recently I became aware of how fractals are used in random terrain generation which is historically used to generate realistic looking backgrounds on the fly, particularly in older games. Below is a video example of such a terrain.

Generating Random Fractal Terrain – Paul’s article is a little old but walks through the algorithms demonstrating their results in a well written piece.

Fork me on GitHub

Android debugging ADB permission problem

It seems that the Android debugger (adb) has problems on Ubuntu when trying to connect to a physical device, a Nexus One is this case. The issue is relating to user permissions with the debugger being unable to access the usb device. I have seen a number of solutions for this with the most common being simply killing the adb process and restarting it as root.


cd android-sdk-linux_x86/platform-tools
adb kill-server
sudo adb start-server
adb devices

But unfortunately this was not sufficient to resolve the problem for my configuration and also it would be necessary to restart adb on every system restart. A more permanent solution appears to be adding a rule to udev to permit usage of the device.


sudo gedit /etc/udev/rules.d/51-android.rules

and paste the following lines

SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE:="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE:="0666"

The 0bb4 in the idVendor property identifies the device (Nexus One), you can list the currently connected usb devices on your machine running the command lsusb, from here you will be able to identify the vendor id for your android device.


sudo restart udev
cd android-sdk-linux_x86/platform-tools
./adb kill-server
./adb start-server
./adb devices

Even with this second solution be sure to physically disconnect and reconnect the handset.

Animation of Git commits using Gource

Gource is a cool tool for visualising commits to software repositorys (gitcvssvnmercurialbzr), by default gource outputs to a window but using ffmpeg its possible to encode a video from the animation. Below is the command I used:


gource --user-image-dir .git/avatar/ --disable-progress --stop-at-end --output-ppm-stream - | ffmpeg -y -b 3000K -r 60 -f image2pipe -vcodec ppm -i - -vcodec mpeg4 gource.mp4