Tripmeter Talking about everything

22Jun/100

Custom smileys for Android Messaging Application (SMS)

After I got my Samsung Spica i5700 Android phone I realized that there was no official update from Samsung from the stock Cupcake (1.5) to Eclair (2.1). A little help from the friendly folks at Samdroid forums I had the latest firmware (I570EDDJC5) Eclair 2.1 and rooted it too.

A little while later I realized that, the smileys in the upgraded version were really messed up. They were some kinda weird Android bots that you can't differentiate if they are smiling or laughing or sad. People have actually opened issues against this poor design here, here and here which the Android team have disregarded.

I looked around for a while and since I had the Samdroid mod which supports applying arbitrary updates to the Android OS via a simple update zip in recovery mode, it seemed like the way to go, and it was!

The resources for the smilies are part of a framework file called framework-res.apk. I followed these steps to replace them:

  • Got the original framework-res.apk from the phone
  • Found 20px x 20px PNG smileys from the internet
  • Replaced them in the apk file. APK is essentially a zip file and WinRAR did the job perfectly
  • Wrote a simple update-script that the recovery mode needs
  • Signed the update zip with signapk.jar
  • Applied the zip to the phone
  • Voila!

The smileys before I applied the mod:

The smileys after I applied them:

As you can see, I've not replaced everything but the most common ones have been. :)

Steps to apply the update:

  • Ensure that you have Samdroid mod applied from the samdroid forum
  • Connect the phone to your PC/Mac and copy the desired emoticon zip file (there are 2) to the root of your SD card.
  • Boot the phone in recovery mode by pressing Volume Down + Call accept + Call hangup
  • Choose Update from any zip and select the zip from the SD card. Press Home to confirm and reboot the phone

That should do it.

I've created two smiley packs.

Let me know if you run into any issues or create your own packs. Mirrors are welcome. :)

15May/100

Setting up Python 2.6.5 universal for PyObjc development

Moving up from 2.6.2 (i386) to 2.6.5 intel universal binary (i386, x86_64) is not that simple and after many hours of trial and error I finally got the following setup working:

Python 2.6.5:
/python2.6.5/lib/libpython2.6.dylib: Mach-O universal binary with 2 architectures
/python2.6.5/lib/libpython2.6.dylib (for architecture i386): dynamically linked shared library i386
/python2.6.5/lib/libpython2.6.dylib (for architecture x86_64): dynamically linked shared library x86_64
 
py2app 0.4.4 (trunk)
macholib 1.2.2 (trunk)
altgraph 0.6.7
setuptools 0.6c11
pyobjc 2.2

Getting it all setup...

5Apr/100

Getting SSH to work with Public Key Authentication

Me got tired of logging into ssh terminals manually for work and my personal hosting environments and friends, so I started using the SSH public key authentication. This post is not about how to get it working, you'll find this howto to be more than adequate to explain you everything.

I just forgot one thing when I setup PKA on my new host recently, and couldn't get it to work no matter what I did. A simple set of permissions on the server. Aaarghh!

chmod 700 ~/.ssh

and

chmod 600 ~/.ssh/authorized_keys

Thats it! Now that I've typed it out, I will never forget it.

30Mar/103

Sending limited traffic over VPN in Mac OS X

Long time no see. Been busy with StockMeter releases lately and now that its successfully out there another Mac OS X tip.

Due to my work requiring domains being mapped to internal IPs I found myself using the Location feature of Max OS X. One of the things that changed was that I had to add my company VPN to the new location. Unknown to me, whenever I logged into the VPN, I couldn't connect to my office network and the traffic was always routed thru the default network. After looking around for a while I found two good suggestions:

  • Send all traffic over VPN: This caused all of my traffic being routed thru my office network. I don't want that!!!
  • Set Service Order: Moved my VPN at the top and this caused all of my traffic being routed thru my office network. I don't want that!!!

As I said, both good options. Searching around a bit and playing with the "routes" I figured a simple and more elegant way to do what I wanted.

25Mar/100

Finding memory issues with PyObjc

This is more of a mental note from the mailing list rather than a full fledged post but informative nonetheless.

Instruments and leaks aren't very useful because because those tools don't know about Python objects, and more importantly the Python memory manager. I tend to use a combination of leaks and Python's gc module to find sources of unexpected memory usage.

What also can help is to create a separate python build using '--without-pymalloc'. This results in a slower binary, but one that uses straight malloc/free instead of Python's memory manager. This makes using Apple's tools more productive. - Ronald Oussoren

This website uses a Hackadelic PlugIn, Hackadelic SEO Table Of Contents 1.7.3.