Walkthrough to Root the Nexus S under Android 2.3.4

This has been done under MacOSX 10.6 with the current AndroidSDK. First a little advice: Root first setup all Apps later because the data will be lost during the unlock process.

Step 0

Necessary Software:
Android SDK
Fastboot for Mac
Superuser setup
Clockwork Recovery

Step 1 – Software

With all the Software together you are half way there, just install the Android SDK (unzip) somewhere. For me it is in “/Developer/android-sdk”. And run:


$ cd /Developer/android-sdk/tools
$ ./android

And install the newest SDK stuff just to make sure everything recognizes correctly. Extract fastboot and Clockwork and keep the files at hand.

Step 2 – Bootloader unlock

Boot the Nexus S in fastboot mode by holding down “Volume Up” and “Power” to boot. Now your are able to connect via fastboot so run


$ ./fastboot devices

This should show a serial number, which confirms the phone connects correctly. Now it’s time to unlock the bootloader, which will wipe all your data.


$ ./fastboot oem unlock

Step 3 – Flash recovery

Now its time to install a custom recovery which allows for the superuser mod to install correctly.


$ ./fastboot flash recovery recovery-clockwork-3.0.0.0-crespo.img

Step 4 – Install root mod

Finally we are now able to install the Superuser mod. So reboot the phone and copy the su-2.3.6.1-ef-signed.zip to the device. Reboot again into the recovery mode, and run the recovery.
You need to mount system as well as USB storage and now its just a simple install from SD Card to get the rooting going.

Step 5 – All done

Be happy and get some root Apps such as Wireshark :)

References

theunlockr
nexusshacks

Networking with NodeJS @munichjs

Yesterday I did a quick talk about ‘Lower’ level networking applications with
nodejs at munichjs. Lower in this
case means sending binary Data via a UDP/TCP socket, handle DNS resolving and
such. Interested? Talk a look at the slides

Examples can be found on github like Nodrrr to use growl from nodejs, the DNS channel patch for node and also even though it is alpha an will be broken from time to time the RDNS resolver

Slimy Vim

Since taking a look at clojure again I was looking
over at Emacs thinking, even though it feels unusable to me it has the nice
feature of evaluating an expression right here and now. Since I’m kind of
invested in both Vim as well as Textmate, with Vim being my current favorite,
I was looking around to get similar. What I came across first was running the
VimClojure Plugin which includes the Nailgunserver, running a single clojure instance evaluating the code you sent to it.
Even though it feels nice to use it mainly works for clojure and is kind of
heavy weight to set up. A simpler solution was described in a post about setting
up clojure on Vim and uses slime to pass
code to a screen window running some interpreter. The nice thing is it works the
same for ruby, python, nodejs, clojure, etc.. My current setup is available found at
Github

Simple git work flow

Simple git work flow

The concept of having multiple branches of code and merge them when needed is
a complicated concept to many people. When SVN was first introduced it started
with the premise to be a “CVS done right”. This means cheap branches, as well as
what is supposed to be easy merging. Actually SVN is a great hassle to use especially
when working with branches, which is why a lot of developers are actually
not really fund of branching and merging all the time. But git is different,
really, honestly… well at least to me ;)!

After working with git for some time now I got in the habit of a pretty basic
usage pattern which works quite well for me, so let me introduce you to it. Whenever I
want to work on a new feature I first branch of the current master to have my
own little sandbox to work and explore in.


$git checkout -b feature_XYZ

Now I got an unchanging environment, in which I can work and there is no one
else changing stuff except me (or maybe a small team). Commits only happen to
this branch.

After the feature is done the code needs to be merged in the master again.
Since the master probably changed during the implementation, I first rebase the
feature branch so I can actually do the merge inside the branch and don’t break
the master. So first pull the newest master and than rebase.


$git pull
$git rebase master

If there is a conflict I resolve it and create a commit describing the merge and
continue the rebase


$git add CONFLICTINGFILE
$git commit -m
$git rebase --continue

After rebase is done I switch to the master and do a merge which should not have
any conflicts now


$git checkout master
$git merge feature_XYZ

Now the whole thing can be pushed, while the master was working all the time,
and therefore a real parallel work on multiple features is possible. This is
possibly not suitable for work in large teams but for me as a single developer
working in small teams most of the time it works amazingly well.

Set DNS servers in NodeJS on a per channel bases

In NodeJS DNS request are handled in the background via the ares library to enable asynchronous requesting. Ares allows the DNS server to be used set on a per channel bases, but this is not exposed in NodeJS, but is is quite simple to enable it by patching node_cares.cc. In essence this enables setting the DNS server via the parameter CHANNEL_NS on creation. To expose this towards NodeJS there needs to be an extension on the default dns.js module. The reason for me to enable this was to use different nameservers on each request, so the extension creates a new channel each time a new nameserver is needed.
I packed everything in a Github repository including some examples.

Me can haz IPv6 with Airport Extreme at Home

Me can haz IPv6 with Airport Extreme at Home

Ok so since I really like to have access to my home machine, and also like to be able to server
some web stuff for testing proposes it decided to setup IPv6 at home. After all the process took
about 10 minutes and using my Airport Extreme as a Tunnel endpoint was rather painless to my
surprise.

Setup an account with tunnelbroker and create a tunnel

This is really easy, just go to the tunnelbroker-page and create an
account. Afterwards create a so called “Regular Tunnel”

Configure the Airport Extreme

Open the Airport Utility and go to Advanced and IPv6. There you configure IPv6 as Manually and enter the
configuration presented by tunnelbroker when creating the tunnel. The configuration mapping is:
Server IPv4 -> Remote IPv4; Server IPv6 -> IPv6 Default Route; Client IPv6 -> WAN IPv6, Routed /64 -> LAN IPv6.

Airport Extreme IPv6

Now set the IPv6 DNS Server under internet TCP/IP to the server provided by tunnelbroker as well,
to get more of the IPv6 goodnessm, which isn’t really much after all so… take what you can get ;).

Try it

To confirm that everything works check in the terminal via a simple

ping6 ipv6.google.com

ping6 ipv6.google.com

Yay you can now use IPv6, at least whats out there, which isn’t much after all. The good thing is you get a lot of
addresses accessible so no more “Port 1337 forwards to fu, 4848 forwards to bar”-mapping.

BTW: I blacked out some numbers just because everybody else does it ;)

EDIT: To make setting the IPv4 endpoint easier I created a script to do that for you. It can be found on
github. This is especially useful if you are on a dynamic IP connection
like normal DSL or Cable.

Introduction to Git and how to using it

Recently git gained a large userbase, and is quickly becoming the default standard for version managment. So for me it
was time to get a larger understanding of it besides just “using it like I think it works”. So to get up to speed
quickly I decided to search for some talks on it. So here my quick introduction worth watching.

GoogleTechTalk: Git

Great talk by Randal Schwartz about Git. Even though it’s not the newest it really is a great explanation of the concepts. Since embedding sadly is disabled check it out at youtube. Like with pretty much everything Randal does the talk is really worth it.

O’Reilly Webcast: Git in One Hour

For an introduction to actually using git the O’Reilly Webcast is a great resource

Cheat Sheet

Nice command overview

Git Tower

For those not really that familiar with the command line, or people like me who keep forgetting the command, Git tower is quite a nice app to use with Git.

Palm Pixi and Salling Media Sync

Ok so I got all my Music and Movies in iTunes, and I’m using a Palm Pixi. So far
I only knew of one pretty, let’s just say not that well engineered solution
doubleTwist. I know a lot of people like it but
to me it’s slow as molasses and as reliable as … oh well.
Now I found a solution, Salling Media Sync,
I actually gotta admit “Yes I found it on the App Store” but I’m still not a fan ;).

So what about the tool, it works great as well as fast and syncs my Palm with
my iTunes library. Everything without any big configuration and such, it just
works.

So if you are looking for a great tool to manage your Palm or any other Phones
Media, check out Salling Media Sync there is a Demo Version on the
Website FYI.

Setting up Django on Snowleopard

I found this tutorial to setup django on Snowleopard. Since I realized it is a little outdated I decided to document the steps I took based on it to get this up and running.

Install

As far as package managers on the Mac go, Homebrew is the new kid on the block, but in my opinion it outperforms Macports in many ways. So for all my installs I tend to use it as much as possible, if anything is not available it is easy to build it using it as well.

So for this tutorial we need the following:

  • Git
  • Mercurial
  • libjpg
  • pip
  • virtualenv
  • virtualenvwrapper

Installing all this is pretty straight forward:

brew install git
brew install pip && pip install mercurial
brew install libjpg
sudo easy_install virtualenv
sudo easy_install virtualenvwrapper

Configuration

Virtualenv changed a little since the original tutorial so setup is done by first of all creating the directory for the environments

mkdir ~/.virtualenvs

Now the directory needs to be exported and the virtualenvwrapper.sh needs to be sourced, this is done by adding

export WORKON_HOME=$HOME/.virtualenvs
source /path/to/this/file/virtualenvwrapper.sh

to .bashrc and running

. ~/.bashrc

Now let’s create an environment by running

workon
mkvirtualenv magicalenvironment
workon
workon magicalenvironment

Now you are running in the magicalenvironment.

Django and the Firstapp

Finally it is time to create a file containing some basic setup

nano django-basic-requirements.txt
# Docutils for admin documentation.
docutils
# Latest Django version
-e svn+http://code.djangoproject.com/svn/django/trunk#egg=Django

Thats it, now it’s time to setup the app using pip and switch in the environment

pip install -E testapp.com -r django-basic-requirements.txt
workon testapp.com

Time to get Django up and running

django-admin.py startproject testapp
cd testapp
python manage.py runserver

Now we can visit http://127.0.0.1:8000 an should see this

Django Testapp

Here we go a running Django development environment. Next on the agenda integrate MongoDB with Django.