Tuesday, May 25, 2010

Android 2.2 on Rooted Nexus With Stock ROM

I have a Nexus One and I rooted it to get Arabic to work, which it did but only for SMS. The letters were broken for other things.

To get an official ROM to work, it has to verify that your current system is indeed an official release and it is the exact previous update/release.

I had to restore back the original ERE27 files that I replaced to get Arabic to work:
  • DroidSansFallback.ttf: 4caeadd734f4be9973163bdf02ea6cf5 (md5sum)
  • libskiagl.so: 1b5cedd01b14838320956bea94b0fe97
  • libskia.so: cc692fb57efb199045c720de491cc3cf
  • libwebcore.so: c8b9931ec8771a720497d5197cd1a108
But that wasn't enough, because rooting the phone modifies the boot partition of the phone which is also checked by updates.

Guides on the Internet were all about using a custom recovery image, wiping user data and doing some other unnecessary things. All what is needed is to flash the original boot image again:
  • boot.img: 36a29d765387dd69cde89367def51dda
  • ERE27 stock ROM (2.1-update1): 90700607c04279716b505aa203e9c684
To flash the boot image, you need the Android SDK  to get the USB drivers for the phone working, but you should already know that since you already rooted the phone. Painfully long steps can be found here (Windows).

Files you'll need from Android ERE27 (2.1-update1):
  • Original / stock font & libs
  • Original / stock boot.img
  • Fastboot utility
  • The new Froyo update (Android 2.2) named as update.zip (put it on your sdcard) 
You can download the stock ERE27 font, libs, boot.img and fastboot from me here.

  1. Enable USB debugging on the phone: Menu -> Settings -> Applications -> Development -> USB debugging
  2. Turn off the phone and connect the USB cable
  3. Hold the trackball, press the power button
  4. Using fastboot, open a shell/command line and type: fastboot flash boot boot.img
    You should see something like this:
    sending 'boot' (2560 KB)... OKAY
    writing 'boot'... OKAY
  5. Then type: fastboot reboot-bootloader to reboot the phone into the bootloader screen
  6. To navigate use the volume up/down buttons & to select press the power button once
  7. Select BootLoader then Recovery
  8. The screen will go black for a while then you'll see a Droid with an exclamation mark. Press volume up & power at the same time
  9. In the new menu, use volume up/down to navigate then Trackball to select
  10. Select apply sdcard:update.zip
  11. Now it'll verify your system files and partitions then start patching then deploying new files
  12. The phone will reboot 3 times to unpack multiple updates
  13. Enjoy your new toy
The files that I've linked are hosted on my Google account. I've taken them from official releases. Feel free to compare the md5 hashes.

Enhancements that I noticed in Android 2.2:
  • Exchange calendars now sync
  • Trackball was flashing blue for Facebook updates & white for emails
  • The phone now can tether using USB or act as a wireless access point
  • Notifications have new funny icons
  • Flash 10.1 from Adobe (go to adobe's website then click on Get Flash Player)
  • Call log groups calls from a single contact (like in SMS)
  • In the market, you can enable application auto-update
  • In the market, there's a button to Update All apps
  • The on-screen menu button now has 2 more brothers: browser & phone, so you can delete the icons from the desk/screen
  • In GTalk, clicking menu gives you the signout option (no need to click more)
  • I noticed a Twitter app
  • Faster camera response on the display
  • More camera options: Focus, Exposure, Zoom, ...etc.
  • Arabic font builtin but it looks weird and the letters are broken (unconnected)
  • 170-250 MB free RAM rather than the previous 40-60MB free RAM!!!

Sunday, May 23, 2010

AirLive WL-5460AP v2: Almost An Enterprise Access Point

I have two of these at home. They're cheap and sturdy Access Points (APs) that pack many features, most of which I didn't know they existed before poking into them today.

In case you don't believe that these cheap APs are worth it, here are some numbers to shock you: One AP had 78 days of uptime (no restart) and another had 101 days of uptime!
And I say "had" because I updated them with the latest firmware, so they had to be rebooted.

91 images were the total to cover all the features this AP provides! The only downside is that even though the firmware is being updated once in a while, the documentation still refers to the old firmware, so you may have to invest in some trial & error episodes to get things done.

Wireless modes:
  • Access Point
  • Client: Client-Infrastructure / Client Ad-Hoc
  • Bridge
  • WDS Repeater
  • Universal Repeater
  • WISP
  • WISP + Universal Repeater
  • Gateway: AP + Router (Static IP, PPPoE, PPTP & L2TP)
  • Bridge (send beacon)

Features in various modes:
  • 802.1x / RADIUS authentication and encryption (includes accounting support)
  • Encryption: None, WEP, WPA-PSK (TKIP), WPA-PSK (AES), WPA2-PSK (AES), WPA2-PSK Mixed
  • Fragment & RTS threshold control
  • Preamble: Long or Short
  • SSID Broadcasting (Enable, Disable)
  • Single SSID support
  • Inter Access Point Protocol (IAPP): Used to handoff between different APs
  • 802.11g Protection: Prevents network degradation when b & g clients use the same network
  • Transfer Power Level (Tx): Default = 18dB. Lowest = 8dB. Highest = 20dB
  • Watchdog: Reboots AP when watched host can't be reached
  • Wireless Client Isolation: Prevents hosts connected from seeing each other
  • Wireless MAC Access Control (Filtering): Allow/Deny Listing
  • IP/MAC/Interface Traffic Control/Shaping: Quality of Service (QoS)
  • DHCP: Disabled, Client, Server, Relay agent
  • Packet Statistics: WiFi Interface, Ethernet LAN, Ethernet WAN
  • MAC Address Cloning
  • System Logging: All system or Wireless only, and can log to a remote syslog server
  • Network Time Protocol (NTP): Time synchronization
  • 802.1d Spanning Tree support
  • In WISP mode: WAN port (Static IP, DHCP, PPPoE, PPTP, L2TP)
  • In WISP mode: IPsec pass through support over VPN
  • In WISP mode: Virtual Servers - Port forwarding (single or range)
  • In WISP mode: Special Applications (port mapping / port remapping)
  • A single DMZ host support
  • Enable / Disable remote management on WAN port
  • Dynamic DNS (dyndns): support for dyndns & TZO only
  • Encryption choices: On WLAN, WAN or both
  • In Gateway mode: Denial of Service (DoS) prevention
  • URL filtering (doesn't say if it's blocking or allowing!)

All of these features are slapped into a 2MB firmware image!

Wednesday, May 19, 2010

Optimizing WordPress Performance: KuwaitPaperDump Gets a Boost

Updated on May 20th: Benchmark results!

The awesome guys at KuwaitPaperDump (KPD) have been doing a great effort into reducing paper usage and providing almost all kinds of brochures and leaflets online.

For such great efforts, I felt obliged to help them gain even the tiniest performance boost possible. And they did!

WordPress introduced a set of options since 2.6 that would help take advantage of some features of the HTTP protocol: A protocol that all websites and browsers speak and communicate with.

Currently, KPD have taken one of several steps into boosting the performance. The next steps require some coding and some ritual dancing. Hopefully we'll get those done and invite everyone for the paperless party soon ;D

I've already created a presentation for KPD to simplify the concept and ideas, so rather than rewriting, I'll link to that presentation and just summarize things in here for reference.

Optimization tricks:
  • Load files in parallel
  • Separate the static content from the dynamic one
  • Enable GZIP on the server, not WordPress
  • Serve files from a geographically closer location
The last point is possible to achieve  with mirroring the content between 2 servers and create a failover scenario using free Dynamic DNS services.

You may want to check back here in a week or two, because we'll try to benchmark before and after each enhancement to know how much performance gain we're getting.

  • Before using a subdomain to point at same server: 16 seconds to full page load
  • After (on Mac): 10.6 seconds (33.75% performance boost)
  • After (on Linux): 8.9 seconds (55.6% performance boost)
There will be more benchmarks as PaperDump goes for extra enhancements, so stay tuned!

The presentation can be found here. (browser and mobile friendly!)