Author Archives: Magnus

Hitchhikers

The storm had now definitely abated, and what thunder there was now grumbled over more distant hills, like a man saying “And another thing…” twenty minutes after admitting he’s lost the argument.

– Douglas Adams

This is the first quote, in Eoin  Colfers sixth book, in the increasingly inaccurate numbered trilogy, about Arthur Dents search for a decent cup of tea, in a universe that rarely makes much sense.

We have travelled through space and time, my friends, to rock this house again

– Tenacious D

That is the second quote. I wast a bit apprehensive before opening the book. Thats gone now, I can’t wait to see what Mr. Colfer has in store for Arthur, Ford, Trillian, Zaphod, Random and me!

Bricks

At home I have a brick wall in my livingroom.

I covered it with wall paper with pictures of bricks on it, just so I could be the only one that knew.

I tell visitors to touch it, it feels real.

New ROM for my Android

I’ve flashed my HTC Hero Android phone with a new ROM and a firmware with new and improved bits for the radiostuff.

The new ROM is based on the upcomming update from HTC (should be almost here now) and it is FAST!

I’m just now trying to figure out how to remove apps I don’t use…

(adb shell is a fun way to make a mess :-D)

This is how:

Needed, Android sdk and fastboot and cm-recovery.img. If you are on a windowsmachine you might need to update your usbdrivers, I have no idea how to do that (it works out of the box on all my linuxboxes) but I imagine you need to doubleclick on lots of buttons…

Get the new ROM and maybe even the updated firmware for the radio.

ROM

Radio

Put both of the zip-files on your sd-card.

Plug in your phone and run

fastboot boot /path/to/cm-recovery.img

wipe your phone (perhaps with a backup first).

Use the menu to install the zipfiles (first the radio, then the ROM) and you are done.

After that I began rm’ing stuf with adb shell to get rid of stuff I never use. YMMV!

openvpn server on a linksys-wrt54gl

First, install dd-wrt (the vpn edition) on the router.

Next, install openvpn on a “real” computer to get access to the openvpn tools. With the tools build the keys:

In Debian do it like this

cd /usr/share/doc/openvpn/examples/easy-rsa/2.0/

#edit vars to reflect reality, then
. ./vars
./clean-all
./build-ca
./build-key-server server
./build-key client1
./build-key client2   # Etc, for other clients
./build-dh

Add the certs and keys in the web.interface like this:

Public Server Cert                   > ca.crt
Certificate Revoke List (CRL) > (blank)
Public Client Cert                    > server.crt
Private Client Key                    > server.key
DH PEM                                  > dh1024.pem
OpenVPN Config                     > (see below)
OpenVPN TLS Auth                > (blank)

This is for the server config file and will give the vpn-network addresses in the 192.168.66.0 scope (and expects that the LAN IP is in the 192.168.1.0 scope):

push “route 192.168.1.0 255.255.255.0”
server 192.168.66.0 255.255.255.0

dev tun0
proto udp
keepalive 10 120
dh /tmp/openvpn/dh.pem
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem

Next, tweak iptables (Administration->Commands->Firewall):

# Replace 1194 with your OpenVPN port number:
iptables -I INPUT 1 -p tcp –dport 1194 -j ACCEPT
iptables -I INPUT 1 -p udp –dport 1194 -j ACCEPT

# Replace 192.168.66.0/24 with your OpenVPN server subnet, this must match the scope from vpnconfig:
iptables -I FORWARD 1 –source 192.168.66.0/24 -j ACCEPT

# These next two lines may or may not be necessary.
# I did not need them, but others did.
# Thus, include them so that this works for more people:
iptables -I FORWARD -i br0 -o tun0 -j ACCEPT
iptables -I FORWARD -i tun0 -o br0 -j ACCEPT

That should be it for the server. Next up is the client-config-file.

remote <IP or host> 1194

client
remote-cert-tls server
dev tun0
proto udp
resolv-retry infinite
nobind
persist-key
persist-tun
float

ca ca.crt
cert client1.crt
key client1.key

The float option is necessary for a routed openvpn.

EDIT:

When pasting stuff in the webinterface on the router, make sure your browser doesn’t fuck up the EOL’s!

ROOTING THE HTC HERO, PART 2

I’m using the following tools:
android-sdk-linux-1.5r3
cm-hero-recovery.img
fastboot
su
superuser.apk
First step is to install the sdk, I’ve installed it in ~/bin/android-sdk
and I have added the tools folder to my PATH.
I’ve copied fastboot, recovery.img, su and superuser to the tools folder.
Shut the phone down and turn it on by pressing both the powerbutton and the back button.
The phone booted a fastboot bootscreen and I plugged in the usb-cable and ran:
fastboot device
(should return you phones productcode if everything is working)
And then
fastboot boot <path-to>/cm-hero-recovery.img
This boots the the phone with the recoveryimage, I used this oppetunity to make a backup by choosing nandroid backup.
It makes a snapshot of the filesystem on the sdCard and can be used like this to recover your phones original software:
fastboot flash boot <path-to>/boot.img
fastboot flash system <path-to>/system.img
fastboot flash userdata <path-to>/data.img
fastboot reboot
The above steps are “just” prep. Now to actally root the bastard 😉
The adb-tool sends commands and files to the phone, I did this:
adb shell mount /system
adb push su /system/bin/
adb shell chmod 4755 /system/bin/su
adb push Superuser.apk /system/app/
adb shell reboot
All the above keyboardgymnastics was to get paid apps in Market, this will help me do just that:
http://code.google.com/p/market-enabler/downloads/detail?name=MarketEnabler_3.0_beta.apk&can=2&q=

I’m using the following tools:

android-sdk-linux-1.5r3

cm-hero-recovery.img

fastboot

su

superuser.apk

First step is to install the sdk, I’ve installed it in ~/bin/android-sdk

and I have added the tools folder to my PATH.

I’ve copied fastboot, recovery.img, su and superuser to the tools folder.

Shut the phone down and turn it on by pressing both the powerbutton and the back button.

The phone booted a fastboot bootscreen and I plugged in the usb-cable and ran:

fastboot device

(should return you phones productcode if everything is working)

And then

fastboot boot <path-to>/cm-hero-recovery.img

This boots the the phone with the recoveryimage, I used this oppetunity to make a backup by choosing nandroid backup.

It makes a snapshot of the filesystem on the sdCard and can be used like this to recover your phones original software:

fastboot flash boot <path-to>/boot.img

fastboot flash system <path-to>/system.img

fastboot flash userdata <path-to>/data.img

fastboot reboot

The above steps are “just” prep. Now to actally root the bastard 😉

The adb-tool sends commands and files to the phone, I did this:

adb shell mount /system

adb push su /system/bin/

adb shell chmod 4755 /system/bin/su

adb push Superuser.apk /system/app/

adb shell reboot

….waiting for the phone to boot

Then I do:

adb devices

(to make sure the phone is talking with my computer)

adb shell

su

(Click Always allow on the phone)

All the above keyboardgymnastics was to get paid apps in Market, this will help me do just that:

MarketEnabler

And guess what, it works 🙂
Now to explore what other options a rooted phone gives me 😉