Android on iPhone 3G

I’ve been trying to jailbreak my iPhone (iOS 4.2.1) for few days. I thought it would be cool if I install Android on my phone, after jailbreaking it. I used redsn0w several times to jailbreak, however I couldn’t manage to jailbreak even if it says “it’s done”.

I didn’t want to downgrade the firmware. If I downgrade to iOS 4.0.1, I can easily jailbreak my phone over JailbreakMe.com, but this method does not provide me full access that I need for installing custom bootloader. So I had to try something else.

I found a tool (sn0wbreeze), that is not only able to jailbreak iOS 4.2.1, but also allow me to install custom boot loader. It sounds perfect! I created a custom (jailbroken) iOS 4.2.1 firmware using sn0wbreeze 2.2.1, restored it using iTunes and boom! My iPhone is now jailbroken!

After jailbreaking, I installed Android. There is a package in Cydia that handles this process. Install Bootlace to your phone using Cydia. Open it and follow the instructions. Once, your kernel is patched and your phone is rebooted, run Bootlace again. Go to OpeniBoot tab and install it. It’s a custom boot loader for iPhone which can boot both iOS and Android.

Installing Android requires download of lots of data. I recommend you to switch to Wi-Fi connection if you’re connected to the internet using cellular data network. There is a project which creates custom Android for iPhone. In Bootlace, go to iDroid tab and install it. This process can take a while. After installation is finished, click to “info” button on the top right corner. Install multitouch and wireless device firmwares too. Installation is now finished. You can switch to Android using QuickBoot tab in Bootlace. Voila!

Now, I have a iPhone which can dual boot iOS 4.2.1 and Android 2.3.2. Some features and not supported yet, and power consumption is high. But I loved it!

For list of supported devices and more information please refer to the official Installing iDroid using Bootlace document.

Comparison of Free Twitter Apps in iPhone

I have iPhone 3G which is running on iOS 4.2.1. Since it has a slow processor and low memory, some apps crash all the time. Official Twitter app, “Twitter for iPhone” drove me crazy last weekend. So I decided to switch to a new app.

I tested some of popular apps in App Store with my own criteria. I also re-installed official app and tested it too.

Please note: The tests are not finished yet. Since I do not have an iPhone anymore, I will not be able to finish these tests.

Twitter Echofon for Twitter Seesmic for iPhone TweetDeck for iPhone Twitterrific for Twitter TwitBird free for Twitter HootSuite for Twitter
Twitter Echofon for Twitter Seesmic TweetDeck for iPhone Twitterrific for iPhone TwitBird free for Twitter HootSuite for Twitter
by Twitter, Inc. by naan studio, Inc. by Seesmic, Inc. by TweetDeck by The IconFactory by NibiruTech Limited by Hootsuite Media Inc.
link link link link link link link
Performance (out of 5) 3 5 4 5 4 3 4
Ease of use (out of 5) 5 5 4 6 4 4 4
Notifications
Mentions ?
Direct messages ? ?
RT’d tweets of me ?
Faved tweets of me ?
Supported features
Geolocation ?
URL shortening – bit.ly ?
Image upload – TwitPic ?
ReadItLater ?
Multiple accounts ?

“Performance” and “ease of use” was scored by my own observations.

How Fast is Pardus?

Today, I made a Pardus 2011 installation to my notebook PC. I used an USB flash drive as my installation media. If truth be told, I was -really- fast.

I agreed the license terms, hit start button on the stopwatch timer and clicked next. I also check the integrity of my installation media by clicking validate. I have a lot to configure. Since I use my operating systems in English, I had to change keyboard layout and timezone with “Turkish Q” and “Europe/Istanbul” in YALI. I also created and used a custom disk layout.

After the installation has finished, configuration with YALI continues. I created my user account, and set it for auto-login. Finally, when the desktop had shown, I’ve personalized my installation with Kaptan. After installation, configuration and personalization, I pushed the stop button on my stopwatch. Guess it?

It took approximately 15 minutes! Go ahead and enjoy the speed. 😉

Windows İadesi Macerası – Gün 1

Recently, I bought a new laptop. Not suprisingly, a Microsoft Windows operating-system had been preinstalled. I wanted it to be removed. This post tells the first day of the story… in Turkish.

Geçtiğimiz perşembe günü (13.01.2011) Profilo AVM’deki (Mecidiyeköy / İstanbul) Teknosa Extra mağazasından Casper marka bir bilgisayar satın aldım. Şaşırtıcı olmayan bir şekilde, Microsoft Windows (7 Home Premium) işletim sistemi yüklüydü. Bilgisayarın herhangi bir işletim sistemi yüklü gelmesi, benim istediğim işletim sistemini kurmama engel değil. Fakat kullanmayacağım ürün(ler)e (bilgisayarın içindeki işletim sistemi, virüs koruma yazılımı, DVD hazırlama yazılımı gibi) lisans ücreti vermiş olma düşüncesi ve bu ücretin, bilgisayar ücretinin %10-15 gibi büyük bir bölümünü oluşturuyor olması oldukça rahatsız edici.

Bu sebeple bugün, Çanakkale’deki Teknosa şubesine giderek işletim sisteminin iadesi için yapabileceklerimi konuştum. İade alınan işletim sistemi tekrar mağazada satılabilir (kutulu olmaması, kurulum medyasının Casper tarafından hazırlanmış olması, lisans etiketinin bilgisayar kasasından sökülecek olması) durumda olmadığından, doğrudan iade kabul edemeyeceğini belirtti. Anlaşılabilir, makul bir itiraz.

Teknosa’nın ürünü kabul etmesi için Casper yetkili servisinin kaldırma işlemini kabul etmesi ve iade için “uygundur” raporu hazırlaması gerekliymiş. Teknosadaki yetkili kişinin gösterdiği yolu takip ederek, verdiği adresteki Casper yetkili servisine gittim. Yetkili servisten sorumlu kişi, daha önce böyle bir taleple karşılaşmadığını belirtip Casper çağrı merkezinin telefon numarasını verdi. Bugün cumartesi olduğundan, pazartesi günü numarayı arayıp talebimi iletmemi, olumlu yanıt alırsam, çağrı merkezinde görüştüğüm kişinin ismi ile birlikte servise tekrar gelmemi söyledi.

Pazartesi günü Casper çağrı merkezinden olumlu yanıt alırsam, bilgisayarımla birlikte yetkili servise gideceğim. Bilgisayarımdan işletim sistemini kaldırmak için iade kabul edilebileceğine dair bir rapor hazırlayacaklar. Bu raporla birlikte Teknosa’ya gidecek ve bilgisayarımı tüm paketiyle iade edeceğim. Teknosa, bilgisayarı yeniden teknik servise gönderecek, orada işletim sistemi bilgisayardan kaldırılacak.

Anladığım kadarıyla süreç yukarıdaki şekilde işleyecek. Nasıl sonuçlanacağını henüz bilmiyor, merak ediyorum. Bu yöndeki taleplerin artması, bilgisayarların herhangi bir işletim sistemiyle önyüklü gelmesine engel olmayacak, şüphesiz. Ama işletim sistemi iade etme sürecinin hızlanacağı konusunda umutluyum.

Storing MAC address in a MySQL database

Today, I encountered a problem: storing MAC address in a MySQL database. MAC addresses (something like “01:23:45:67:78:AB”) contain six hexadecimal (base 16) values. This means each hexadecimal field can store 256 (2 to the power of 8, in base 10) values. It’s 8 bits (= 1 byte) for each value.

6 field x 8 bit = 48 bit = 6 bytes

Thus, instead of storing the address as string, I prefer to store it as an integer. Because as a string (without colons “0123456789AB”), it can be stored in 12 bytes. Storing MAC address as integer allows us to store it using less space and also fast indexing.

In database, we can use unsigned BIGINT data type as it can store up to 8 bytes. While reading from database,

SELECT HEX(mac_addr) FROM `devices`;

While saving,

INSERT INTO `devices` (mac_addr) VALUES (x'0123456789AB');

If you prefer to make conversions in PHP,

function mac2int($mac) {
    return base_convert($mac, 16, 10);
}

function int2mac($int) {
    return base_convert($int, 10, 16);
}

You can use this function to make the address human readable

function int2macaddress($int) {
    $hex = base_convert($int, 10, 16);
    while (strlen($hex) < 12)
        $hex = '0'.$hex;
    return strtoupper(implode(':', str_split($hex,2)));
}

WikiLeaks Cablegate Count v2

Since the official WikiLeaks page has changed, the previous script needs to be updated. Here it is:

import urllib, piksemel, re

wleaks = int(re.search(r"(d+) / [0-9,]+", piksemel.parseString(urllib.urlopen("http://www.wikileaks.ch/cablegate.html").read()).getTag("body").getTag("div").getTag("div").getTag("a").nextTag().getTag("p").toString()).groups()[0])

Please remember to install piksemel module.

WikiLeaks Cablegate Count

Today, I wrote a small script to get the count of released WikiLeaks cables. Actually, it’s extremely small. Just two lines of code.

import urllib, piksemel, re

wleaks = int(re.search(r"(d+) / [0-9,]+", piksemel.parseString(urllib.urlopen("http://cablegate.wikileaks.org/index.html").read()).getTag("body").getTag("div").getTag("div").getTag("a").getTag("p").toString()).groups()[0])

Generally, I don’t code like this. But I wanted to write it quick (5 minutes?) and keep it short. It uses piksemel to parse the page.

Enjoy!

Pardus at CeBIT 2010 Eurasia

This week had been an exhausting one. I was an exhibitor at Pardus at CeBIT 2010 Eurasia. I’ve talked about Pardus, Linux and open software for 4 days, all day long. Being there as a volunteer and working hard didn’t matter. WE HAD FUN!

While we’re giving visitors gifts (Pardus 2009.2 CD’s, posters, brochures and candies), they asked questions about Pardus. Such as: “Is this really free, but why?”, “Where do you get money from?”, “What does free mean?”, “Can I contribute Pardus?”, “Can I use it in my office?”, “How many people uses that?”, “How secure is it?”…

The crowd was enthusiastic about using Pardus. All we have to do is let them play with it a little. There was 10 computers for trying Pardus, and Pardus handled rest of it. Interfaces, effects, ease of use and (open source) games were good enough to attract them! They were just scared to try something different. We gave them enough courage to try Pardus, now we’re waiting for their feedback.

I will save my CeBIT badge forever and I’m too glad to met other volunteers from Özgürlükİçin.com in person, and they’re all awesome! I took a lot of photographs. Cannot wait until next event!

Show forecast using Yahoo! Weather

Note: This snippet uses piksemel module to parse XML files. If you don’t have it, read this article to install it.

First of all, you need the WOEID (Where on Earth Identification) of the city. In order to learn it, go to http://weather.yahoo.com and search for the city. You’ll find the WOEID at the end of the url of the page.

# for Istanbul, TR
woeid = 2344116

Use this id in Yahoo! Weather API url, for w parameter.

weatherUri = "http://weather.yahooapis.com/forecastrss?w=%d" % woeid

If you want the results to be in metric units, add u=c parameter into your query.

weatherUri = "http://weather.yahooapis.com/forecastrss?w=%d&u=c" % woeid

Using urllib, fetch the XML file:

import urllib

xml = urllib.urlopen(weatherUri).read()

We can parse this XML easily using piksemel:

import piksemel

temp = piksemel.parseString(xml).getTag('channel').getTag('item').getTag('yweather:condition').getAttribute('temp')

You can also view XML file and look for other resources such as: humidity, visibility, wind, etc.

How to install piksemel module

piksemel is a easy to use python XML parser, based on iksemel.

Not: If you’re using Pardus, piksemel is preinstalled on your system.

Not: If you’re using Windows, before you continue make sure you’ve already installed mingw32 to your system and its directory is included in PATH.

Steps for Linux users:

  • Download the package from http://cekirdek.pardus.org.tr/~bahadir/piksemel/piksemel-1.3.1.tar.gz and unpack it.
  • Run:
    python setup.py build
  • Run:
    python setup.py install

Steps for Windows users:

  • Download the package from http://cekirdek.pardus.org.tr/~bahadir/piksemel/piksemel-1.3.1.tar.gz and unpack it.
  • In piksemel-1.3.1 directory, run:
    setup.py bdist_wininst build --compiler=mingw32
  • Run the installer file under the piksemel-1.3.1/dist directory.