Category: Open Source

Windows-free zone!

Ha! Been wanting to say this for a while!

I am now a Windows free zone – no Windows systems lying around. :D

Goodbye Windows

Goodbye Slackware – yes, I know, I know, was a long time fan of Slackware ever since I  acquired Walnut Creek CDROM set with kernel 1.2.13 .. :)

And now I welcome in open arms….(drum roll please)

Arch Linux (Ba-dum-tish!)

Well, what can I say, its a rolling release distro… put simply, updates come out and all dependencies taken care of :D The simple chant of the command sudo pacman -Syyu and pulls down the latest updates from the Arch Linux’s repository. Now, I have currently a testing repository selected – heh, I like to be on the bleeding edge, and so far, extremely impressive and fast!

Now for you winblows (l)users xD try shutting down and reboot back, time it, now, there’s a catch with this challenge – no SSD disks please.

Personally, I can go from Gnome 3.2 desktop to reboot and back again in under 1 minute. There’s no delay, its instant boot up – well, a lot faster than winblows that’s for sure :)

Yes, Gnome 3.2… Its actually quite a neat GUI system, sure there are rough edges that need smoothing out but its way better than Gnome 3.0, which caused ire among the Linux users… Will blog about that later on :)

And you know something, it feels good to have a non-windows system running as there’s no associated stress and frustration with applications freezing or locking up due to bloated registry size and flaky drivers.

Everything works as it is out of the box with Arch.

Post to Twitter

Setting up your own GitHub

This article is about how to set up your own private github repository on Linux, in a few easy steps. I have tried a few packages that I personally, found, convoluted and complicated. Sometimes the simplest way is the best way. A few pre-requisites here needed:

  • A user id that has been created by root, make sure that the said user id does not have a login shell, in this case, call it gituser (This should create /home/gituser!)
  • A group id that, also, has been created by root, in this case, called it git. (The above two are for reasons of security to prevent exploits etc, should the Linux box be ever compromised)
  • That there is the latest git binaries or compile from source which can be found here from the main git site. And that it is installed, the installation path will vary depending on your Linux Distribution.
  • There is a super-internet daemon running, xinetd.
  • Optional: Open the port on your firewall, 9418 for the git protocol.

Now, root access is needed for the most part to get this set up and running.

The pre-requisites out of the way, let’s go ahead and create the github server.

  1. All the source code changes will be tracked and stored inside the /home/git/scm directory so create the directory. And this will be referenced by the super-internet daemon configuration.
  2. So. inside that directory /home/git/scm, create a directory for each git repo that you want to set up, for example, Kernels and inside that directory you would have different kernel versions, ending in .git. E.g. /home/git/scm/Kernels/2.6.32.9.git This will be perceived via way of git protocol as this: git://localhost/Kernels/2.6.32.9.git (See the tip below if you wish to make this accessible outside of the localhost address)
  3. Taking the above example, that the directory is created, issue the following command:
    1. git –bare init
    2. touch git-daemon-export-ok
  4. Now, still being as root, change the owner-ship of all of the directories/files within the /home/git/scm directory (chgrp -R git:gituser *).
  5. Edit the super-internet daemon configuration, found usually in /etc/xinetd.conf like this:

service git{

disable=no

type=UNLISTED

port=9418

socket_type=stream

wait=no

user=git

server=/usr/lib/git-core/git-daemon

server_args= --inetd --export-all --reuse-addr --enable=receieve-pack --base=/home/git/scm

log_on_failure += USERID

}

Now, restart the super-internet daemon and all should be okie. That’s the server side done and ready to accept files.

As a tip, instead of confining the github repository to be at just localhost, set it to the IP address of the actual linux box that you are hosting the repo at, for example, 192.168.10.1.

As an ordinary user, and have a need to check in the files into your private github, do the following:

  1. git init # This initializes the current directory to be used for git-tracking.
  2. git add * # This tells git to accept a list of files that needs to be tracked.
  3. git commit -a -m “Initial comment and initial version” # Tell git to store the commit message that is related to the the list of files added.
  4. git remote add origin git://localhost/Kernels/2.6.32.9.git # Tell git that we’re using the server side address that will be the centralized point of tracking changes. This is only done once!
  5. git push origin master # Tell git to push the list of tracked files and changes across to the server. Again, do this once, as it will be stored in the configuration within the directory and will remember next time, i.e. git pull, git push, git log, git status, etc.

Now, your own private github repository is working.

Repeat the steps for each repository/directory that you want tracked by git.

Happy Git’ting :)

Post to Twitter

Windows free Zone!

Ha! Been wanting to say this for a while!

I am now a Windows free zone – no Windows systems lying around. :D

Goodbye Windows

Goodbye Slackware

And now I welcome in open arms….(drum roll please)

Arch Linux (Ba-dum-tish!)

Will blog about that shortly :)

Stay tuned!!

Post to Twitter

Updated code for ZTE Blade FM Radio + CM7

Hello again, I have updated the code on github to make it a daemon server that will handle the simple and intuitive command set to control the FM Radio. As from the previous blog posting, the code has been revamped. I have discovered a thing or two about the Android NDK that made be go “WTF”…

Read more »

Post to Twitter

ZTE Blade and CM7 missing feature

Cyanogenmod ROM 7 is currently undergoing testing and receiving huge feedback, currently for the Orange’s San Francisco/ZTE Blade, there’s still a lot to be ironed out, one of the notable features inherently missing is the usage of the FM Radio.

Read more »

Post to Twitter

Compiling kernel for Android – Part II

Ok, to keep to the topic as per in the previous posting about how to compile the kernel for Android, I thought I’d share some scripts that I use myself to make life a bit easier….

  • ak_stg1 – (Android Kernel, Stage 1), takes in parameters to create a boot.img.
  • ak_stg2 – (Android Kernel, Stage 2), again, takes in parameters, copies the modules across to a specified directory.
  • ak_stg3 – (Android Kernel, Stage 3), to create a clockworkmod updater script – work in progress…. :D

ak_stg1 bash script.


#!/bin/sh

usage(){

cat << EOF

usage: $0 options

This script creates a kernel boot image for flashing with ClockworkMod 3.0.0.x [Stage 1]

OPTIONS:

-h      Show this message

-k       Location of recently compiled zImage

-r       Location of ramdisk

EOF

}

invoke_mkbootimg(){

echo "$@" | awk '{ system($0); }'

}

KERNEL_ZIMAGE=""

RAMDISK_IMAGE=""

RESERVED_STMT="androidboot.hardware=blade console=ttyMSM2,115200 g_android.product_id=0x1354"

BASE_ADDR=0x2A00000

BOOTIMGF=boot.img

while getopts "hk:r:" OPTION

do

case $OPTION in

h)

usage

exit 1;;

k)

KERNEL_ZIMAGE=$OPTARG

;;

r)

RAMDISK_IMAGE=$OPTARG

;;

?)

usage

exit 1

;;

esac

done

if [[ -z $KERNEL_ZIMAGE ]] || [[ -z $RAMDISK_IMAGE ]]

then

usage

exit 1

fi

BOOTMAKE="$HOME/bin/mkbootimg"

BOOTMAKE_OPTS="  --base $BASE_ADDR --cmdline "\'"$RESERVED_STMT"\'" --kernel $KERNEL_ZIMAGE --ramdisk $RAMDISK_IMAGE --output $BOOTIMGF"

invoke_mkbootimg $BOOTMAKE  $BOOTMAKE_OPTS

ak_stg2 bash script.


#!/bin/sh

usage(){

cat << EOF

usage: $0 options

This script copies the freshly built kernel modules for flashing with ClockworkMod 3.0.0.x [Stage 2]

OPTIONS:

-h      Show this message

-k       Location of recently compiled kernel source

-m      Location of where to copy the modules to

EOF

}

KERNEL_PATH=""

MODULES_PATH=""

while getopts "hk:m:" OPTION

do

case $OPTION in

h)

usage

exit 1;;

k)

KERNEL_PATH=$OPTARG

;;

m)

MODULES_PATH=$OPTARG

;;

?)

usage

exit 1

;;

esac

done

if [[ -z $KERNEL_PATH ]] || [[ -z $MODULES_PATH ]]

then

usage

exit 1

fi

cat $KERNEL_PATH/modules.order | sed s/^kernel\//g | while read -r line

do

cp $KERNEL_PATH$line $MODULES_PATH

done

 

Now, no fuss, no muss, and less prone to errors on the command line. w00t. \o/

Post to Twitter

USB Charge Commander

I promised the forum members over at Modaco, to develop a simple application designed for the ZTE Blade/Orange San Francisco handset. As the title of this blog post, it is exactly that.

A bit of background – I am constantly plugging in the cable into the handset for at most 2 minutes max, just to copy files on it, worrying about the battery getting messed up or shortening the battery life. I set about to pursue an alternative to allow plugging in the cable without charging the battery.

This is the application that is the simplest Android application, which selectively enables/disables the battery charging. It is now available on github repository for anyone to download and tinker with the code. :)

The binaries are available to install directly on to the handset.

Warning: Do not run this on any other handset!!!

Post to Twitter

Compiling kernel for Android

Here are the steps required to build your own kernel for your Android handset. All commands are italicized and precedes the $HOME variable to indicate the directory.

Prerequisites:

  • Linux box up and running that contains the full developers tool-kit such as bison, flex, automake, bash, gcc, git, curl, kernel sources of your choice, adb. Your mileage will vary in accordance to different Linux distributions of your choice so refer to your package manager if you do not have the above developer tools. I am using Slackware 13.0 distribution.
  • A Android based handset, in my case, its Orange’s San Francisco/ZTE Blade, running Modaco Custom ROM 11, and also, that you are using a ROM Manager, in my case, I use Clockwork Mod recovery.
  • Tools to extract the kernel from your android’s boot image, namely, split_bootimage.pl which can be found here.
  • Java – You will need Java 1.5 runtime and sdk, if you ever want to build a Android release from the Android Open Source (AOS), crucially, 1.5 is required for releases up to Froyo (Eclair, Donut, Cupcake releases), Gingerbread and upwards requires Java 1.6 or better. The thing about it is, it’s difficult to obtain the official 1.5 from Sun since Oracle took over….
  • That you have $HOME/bin in your $PATH, this is where the split_bootimg.pl and repo, mkbootimg, testsign.jar will be found in.

Steps:

  1. Obtain the Android SDK from the official download page here, in my case, I installed it into $HOME/ANDROID.
  2. Pull down the entire Android Source tree by following the instructions from here. I installed this into $HOME/mydroid, this is a clone of the current source tree as maintained in the public repository. Be warned, this will take a while depending on your broadband connection, the source is well over 3.5Gb. You need to follow the instructions there, this step is required so you could obtain the necessary tools to build the kernel.
  3. Now when that’s done, I cloned the repository residing on github into $HOME/repository.
    1. $HOME/repository: git clone https://github.org/ZTE-BLADE/ZTE-BLADE-2.6.32.git
  4. Obtain the original ROM that is used in your handset and unzip the ROM into $HOME/myrom.
    1. $HOME/myrom: unzip -d my_rom.zip
    2. There should be two directories – META-INF and system. The one that we are interested in is boot.img.
    3. Using the split_bootimg.pl, we extract the information from boot.img:
    4. $HOME/myrom: split_bootimg.pl boot.img
    5. There should be two files, boot.img and boot.img-ramdisk.cpio.gz(your mileage will vary as the ROM may be different…) boot.img is the actual kernel, the ramdisk.img is the image that is loaded into ram which the kernel runs the initialization of hardware etc.
  5. Plug in your handset and using adb, obtain the kernel’s configuration
    1. $HOME: adb pull /proc/config.gz $HOME/androidconfig.gz
  6. Go into the kernel’s sources and issue the following commands:
    1. $HOME/repository/ZTE-BLADE-2.6.32: zcat $HOME/androidconfig.gz > .config
    2. Now, we need to set up a special flag to indicate that we’re cross-compiling to the handset’s chipset architecture $HOME/repository/ZTE-BLADE-2.6.32: export CCOMPILER=$HOME/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
    3. You can at this stage, if you’re feeling adventurous, to browse through the configuration of the kernel via the kernel’s menu: $HOME/repository/ZTE-BLADE-2.6.32: make menuconfig
    4. To build the kernel, issue this, $HOME/repository/ZTE-BLADE-2.6.32: make ARCH=arm CROSS_COMPILE=$CCOMPILER
    5. The above step will take a while…
    6. The kernel will reside in $HOME/repository/ZTE-BLADE-2.6.32/arch/arm/boot/zImage
    7. Also, watch out for the optional kernel modules, this can be found in $HOME/repository/ZTE-BLADE-2.6.32/modules.order
  7. Navigate back to the $HOME/myrom, and go into the system/lib/modules directory:
    1. cat $HOME/repository/ZTE-BLADE-2.6.32/modules.order | sed s/^kernel\//g | awk ‘{ system(sprintf(“cp $HOME/repository/ZTE-BLADE-2.6.32%s .\n”, $0)); }’
    2. What we have done here, is copied the freshly built optional kernel modules here.
  8. Navigate back to $HOME/myrom and copy the freshly built kernel image here.
    1. $HOME/myrom: cp $HOME/repository/ZTE-BLADE-2.6.32/arch/arm/boot/zImage .
  9. Now, to recreate the boot image, this part is extremely important, ensure the hexadecimal address is correct as this is where the kernel will get loaded on the handset in the region of memory as specified by the hexadecimal address. Check around first before doing this, as when you re-flash the new ROM, the addresses will conflict and worst case – the handset will refuse to boot. For the Orange’s San Francisco/ZTE Blade, the address is 0x2A0000:
    1. $HOME/myrom: mkbootimg –base 0x2A00000 –cmdline ‘androidboot.hardware=blade console=ttyMSM2,115200 g_android.product_id=0×1354′ –kernel zImage –ramdisk boot.img-ramdisk.cpio.gz -o boot.img (Thanks to hecatae from blade.modaco.com for the correction by pointing out that –cmdline was left out – whoops! ;) )
  10. Next step, re-zip up the ROM:
    1. $HOME/myrom: zip -r my_new_rom.zip META-INF boot.img system
  11. Finally, we need to re-sign the newly created ROM:
    1. $HOME/myrom: java -classpath $HOME/bin/testsign.jar testsign my_new_rom.zip my_new_rom_signed.zip

Now, copy the file my_new_rom_signed.zip to your SDCARD on your handset and reboot, using your ROM manager to install and flash the ROM. In my case, I can tell Clockwork Mod Recovery to install the zip and flash the system.

Post to Twitter

Cygwin 1.7.7.1

Have went through the trouble in downloading cygwin 1.7.7.1, so have decided in spirit of open-source, I am willing to burn a copy of it into ISO format for burning on DVD for anyone.

For a small donation to cover the postage to anyone, anywhere in the world, for every 3 euro donated, 1.50 euro will go to the cygwin foundation…

Now, is that fair? :)

Post to Twitter

Samsung Bada GCC toolchain

I have opened up the project on github that is a replacement bash script intended for Linux, to ease building the Codesourcery’s cross-compiler bada toolchain that targets the Samsung Wave. Read more »

Post to Twitter

Samsung – a lesson for you to learn

Samsung, if you are reading this, this is my open letter to you. Read more »

Post to Twitter

Bitlbee + MSN glitch…

There has been a slight glitch in the bitlbee server running on my linux box, it refused to sign into MSN. Accordingly there’s a change in the MSN’s passport protocol and the authentication failed. If you have downloaded the source tarball, then head here to get the patch. Download the patch as diff file. Patch it in the directory (You will have to change into this directory to patch it) bitlbee-1.2.6a/protocols/msn and invoke the patch patch -p1 < changeset_rdevel,578.diff.

Recompile bitlbee and restart the inetd server. Then it should work this time round! :)

Thanks to Wilmer van der Gaast for the patch!

w00t w00t…

Post to Twitter

Terminal Multiplexer

Yes, you’ve read this correctly…terminal multiplexer…what’s that? Is it a hardware gadget? uhhh No…. Is it some kind of funky monitor? uhhh No… Is it something to do with Linux? Ummmm… Yup… kay…. Some kind of software to handle Linux Terminals?….Yes….Enlightenment please?

Read more »

Post to Twitter

Multi-Tail

I stumbled on this darn useful utility for monitoring logs on screen…ever use tail -f /var/log/messages and getting frustrated at not being able to see the other logs also, implying that another session has to be started, and issue another command tail -f /var/log/syslog for instance.

This utility is a much more powerful tail tool, called MultiTail, is uses the curses library to create panes where you can view different logs on the one tail session. As an example:

  • multitail -s 2 /var/log/messages /var/log/syslog
    • A neat window appears with the screen split into two, messages on one pane, and syslog on the other, in real-time…

How cool is that..there are a plethora of options such as custom colours for certain keywords to highlight when scrolling by or going backwards in the window’s pane.

Some astute readers may point out, “Hey I can use screen for that… “, but you would be missing the point, this is really a dedicated screen for monitoring logs… Enjoy

Post to Twitter

Virtuawin

This utility virtuawin is way better than any of the virtual window managers I have tried for Windows, the really neat thing is that it works straight out of the box!

There’s a good reason, the taskbar can get too cluttered thus distraction increases, by using virtuawin, the window manager can move other windows to a separate desktop (same background, same icons and shortcuts) with a distinctive ALT+TAB for each virtual desktop thus compartmentalizing the tasks into that virtual window.

In effect, the taskbar under one virtual window will be less decluttered and therefore less distracting. For an example, the first virtual window is called ‘Main’, the second is called ‘Linux’ and anything related to it such as putty gets moved out of the way, the third is called ‘Dev’, in which anything related to development like Visual Studio and so on… in that way, no need to be overwhelmed by so many windows and getting distracted in the process!

Here’s to productivity increase thanks to virtuawin. :) Go on, download it, it’s open-source and free and does exactly what it says on the tin!

Post to Twitter

Bitlbee

I was introduced to this utility bitlbee while on IRC, this is one heck of an aweseome tool – to put it simply, you can get rid of all your client applications for MSN, Yahoo, ICQ, Gmail, Pidgin, Miranda, Jabber and use your trusty ol’ IRC client, I use irssi, and simply install bitlbee, it can send the messages across those different IM platforms…

It works quite well, actually, it would be preferable to compile it from source and install it on a Linux box, and use irssi to connect up to the localhost, then from there on, instant IM across MSN, ICQ, etc.

The installation from source tarball is a bit confusing as it is not clearly documented, it is preferable to let inetd take care of the bitlbee daemon, you need to create a new user and group and create the appropriate directory residing in /var/lib/bitlbee – Don’t forget to change the ownership of that directory for bitlbee to work properly based on a newly created user and group!

entry in inetd.conf

6667 stream tcp nowait bitlbee /usr/sbin/tcpd /usr/local/sbin/bitlbee

then

chown -R bitlbee:nobody /var/lib/bitlbee

Then, using irssi, connect to the local host, and, register your password with bitlbee, then add your MSN/GMail/Jabber/ICQ/Yahoo accounts and irssi will remember them (don’t forget to /save it!)

Away you go then, bitlbee will take care of the negotiation protocols with those IM platforms and to message your buddy, do /msg buddy howdy there, which will create a new channel to do IM chat!

You can check if your buddies are online by issuing blist.

The only confusion arises is a lot of irssi commands are prefixed with a slash, for bitlbee commands, there’s no slashes…remember that and you’ll be fine…

Happy IM’ing with bitlbee

Post to Twitter

List Viewer

Would anyone remember the infamous program called ‘List‘ by Vernon D. Buerg? This is going back to early 1990′s. That was the program that I grew up with, learning and poring over ASCII text files…Ahhh…those were the times, what was useful about it was it can open the text’s very quickly and instantly switch to hexadecimal viewer…the times I have spent staring at file dumps of machine code working it out and learning…

I have looked everywhere for a replacement for Windows version…I think I have found it, but it is slightly limiting, it is called ListXP.

It is noted that the code is open-sourced and is available. The original site on listxp.com is out-of-date as the domain name is for sale, however there is a archive copy of the website found here.

I have saved the archives and intend to put it up here in case the links disappear.

The only thing missing from it is the tab pages so that you can have one single instance of the viewer with multiple tab pages with different files viewed – that I think would be useful…

ho hum… let me work on this code and see where the change could be made… ;)

Post to Twitter

E Editor Open Sourced

Wow, just saw this on stackoverflow.com, the E Text Editor (commercial programmer’s editor) is just open-sourced.

The announcement on E Editor’s website e-editor’s blog about the Open Source and the future.

The announcement on E Editor’s website here announcing the source to be released e-editor”s blog.

The link to the question on stackoverflow is stackoverflow.

The link to the git repository is github.com/etexteditor/e/.

Have fun! :)

Post to Twitter

Nice font Inconsolata

I was reading Computer Active magazine, and there was a small article detailing downloads to try out, and this one caught my eye, a nice mono spaced font called Inconsolata by Ralph Levien. I downloaded it and installed it, went into VS, set the font, and I have to say, it is neat and looks easy on the eye, clear and readable.

Now, every programmer has their own personal opinion and I shall not spark a flame-war on what is the best font to use, but however, the one big thing that I look for in a font designed for doing programming is:

  • A slash through the zero to distinguish it from uppercase O, some fonts are bad at this!
  • The digit one and the lowercase l, it can be misleading with other fonts which makes it look near alike to the naked eye. This font has a nice slope to make a one look like a one instead of lowercase l.
  • Mono spaced, and of course fixed width.

This font Inconsolata satisfied my requirements and fair dues to Ralph for his work, and by the way it is free. Incidentally, at the bottom of the page at his website is a link to the top 10 programming fonts. Also, it is on CodeProject’s Hans Dietrich writes about the different fonts used for the job in programming – go on, take a look and see for yourself.

Aye, free as in free beer!

Post to Twitter

Skype for Linux will be Open Source

It was announced on theregister.co.uk that Skype will be open source in the ‘nearest future’…however, this begs the question, how long is ‘nearest future’, nonetheless, it will be very interesting to see how much of Skype goes open source in terms of the code base. I would think, a very small portion of the code will be open source…will have to wait and see…

Post to Twitter

WordPress Themes

Bad Behavior has blocked 847 access attempts in the last 7 days.

Stop SOPA