Archive for the 'hacking' Category

Mobile Dev Joy : The Adventure with Mobile Browser

My post today will be rather technical, but I’m sure some will find it interesting because it’s about a topic that’s not as widely discussed as others. Some may even find it useful. It’s about my brief stunt with mobile development.

Some time ago I was asked to look at a web-based apps which is to be used with a mobile phone. A Nokia E70 to be exact. It’s based on Symbian S60 3rd edition platform. Basically, a Javascript which is supposed to run won’t. So I looked into it.

This piece of Javascript is vital for usability reasons. Without it, the input process will take up to 50% longer. So I thought, yeah I’ll set aside a bit of my time and hack this.

Then I realized that when I thought the browser situation on the PC / desktop platform is a mess; it actually look very tidy and well-ordered compared to the situation on the mobile platform πŸ™‚

First, mobile platform is much more limited — in terms of CPU / processor power, memory capacity, secondary storage (hard disk / flash ram) capacity, power, etc. These limitations in turn must be taken into account by all mobile browsers. Which causes various quirks / incompatibilities to surface when you dig deeper into it.

Second, free(dom) software has not yet made as much impact here as it is on the desktop. Therefore we have plethora of proprietary technologies, which sometimes doesn’t work together / conform to the open standards.

Third, there’s not as many documentations available on the topic. As I googled around, I realized in horror that I may have to hack around much more than I thought necessary.

Back to the hack – first thing I tried was to install Opera mobile (not Opera mini). Yes, we’re willing very willing to pay Opera if it works. In short – the Javascript works on it.
Unfortunately, Opera mobile crashes around so much, it’s impossible to enjoy any kind of productivity with it.

Also there are a LOT of quirks with Opera mobile when used with keypad.
They are small things, but gets annoying very quickly. Which doesn’t help when you’re trying to accomplish good amount of work.

Maybe it’d be better if I try an older version of it, but seeing it consume too much RAM anyway; I thought I’ll give the built-in browser a try first.

Called “Nokia Mini Map Browser” because of its “mini map” feature, it’s speedier than Opera mobile and doesn’t use as much memory. However, the Javascript on our web-apps doesn’t work there.

So I thought, perhaps this browser doesn’t support the latest version of Javascript. Or worse, perhaps it has its own version of Javascript. That would suck greatly.
Anyway, I started to try looking for documentation on the topic, also for a tool to help me debug the problems there.

I found Nokia Mobile Browser Simulator 4.0. It’s Java-based. However, it seems to be hard-coded for Windows, with Windows installer too. Ok so I found a Windows machine, and set it up.

To my dismay, it doesn’t work very reliably. To be precise, it won’t even load the web-apps. While the actual browser in Nokia E70 will display it correctly.

With documentation on the subject (Javascript capabilities of Nokia Mini Map Browser) also very lacking, this is starting to look like a dead end.
Until I found out that the Nokia Mini Map Browser is actually an open source project !

Code named “S60browser”, or “S60Webkit”, it’s available from opensource.nokia.com
There’s hope – if there’s code available, then anything can always be traced / found out.

My sharp-minded readers will quickly realize another thing – yes, it’s basically the same as the Safari browser, the one on Mac OS X πŸ™‚

Nokia Mini Map Browser aka S60browser aka S60Webkit is based on another open source project called WebKit. Which happens to be the foundation used as well by Apple to build their browser, Safari.

Now this is getting interesting πŸ™‚

I dug deeper into these new clues, and began to feel sure that both browser’s cores are indeed identical. Which means that I’d be able to debug the problem with Safari browser.

safari-pref-advanced
I fired up Safari, invoked the Preferences screen, and clicked on Advanced icon. I enabled “Show Develop menu in menu bar”, then I restarted Safari. A new menu then showed up. I chose Develop – Show Web Inspector (also accessible via Cmd-Alt-i)

I got the detailed error message in no time. It’s “Object [object HTMLInputElement] (result of expression document.getElementById(“testForm”).submit) does not allow calls“.
As I already mentioned, the script works on Firefox and Opera, but somehow it doesn’t work on Safari. So it’s Googling time again.

Turn out it’s a generic error message whenever Safari have problems executing a function.
So it could be that the function doesn’t exist. Or the function name is mispelled. Or any other function-calling related problems.
Great, looks like this will cause more questions than it answers…

Thankfully I wasn’t on the wild goose chase for too long. A comment on a blog post gave me the hint I needed :

I gave a form button the *same name* as the function it was calling in its onclick. This error was the result.

Joshua, thank you. That’s exactly what happened in my case πŸ™‚
A line in the script is as follows :

document.getElementById(“testForm”).submit();

While there’s also a button on the same script named, you guessed it, submit :

<input type=”submit” name=submit />

So Safari got confused, and threw this generic error message.

And it’s very easy to fix, I just need to change the button’s name value to something else – and it works now on Safari & Nokia Mini Map Browser, as well as on Firefox and Opera.

I love happy endings πŸ™‚

Moral of the story ? Open source software empowers developers.

And this is not the first time – my MSc thesis was about to fail; when I found ping’s source code on the Internet. It gave me the hint needed to continue the project. The thesis got among the best mark at that year.

With availability of the source, we can learn from the brightest minds on Earth with ease. The knowledge and wisdom become available for all.
Even to the ones with feeble minds, like me.

Here’s another cheer for free(dom) software movement : May the source be with you πŸ™‚

(oh, and also, all hail Google !)

Cheating game WORDZ dengan GREP + random.org

Tadi saya melihat anak saya sedang pusing di depan komputer. Ketika saya lihat, ternyata dia sedang memainkan game Wordz.

Game ini cukup unik. Seperti Scrabble. Tapi semua hurufnya sudah ada di layar, dan diacak. Sehingga cenderung jadi memusingkan. Cukup lumayan juga sih untuk asah otak dan memaksa anak jadi sering membuka kamus, he he.

Setelah sampai di level 18, kasihan juga melihat dia pusing tujuh keliling begitu πŸ™‚
Akhirnya saya tunjukkan triknya : Project Gutenberg + Grep.

Project Gutenberg adalah proyek digitalisasi buku-buku yang sudah habis hak ciptanya, dan sudah berada di public domain. Ada sangat banyak literatur klasik pada situs proyek ini, sangat menarik. Dulu saya suka membaca novel science fiction klasik yang disediakan oleh proyek ini. 20000 league under the sea, journey to the center of the earth, dst. Sungguh menyenangkan.

Nah, termasuk salah satunya adalah kamus Webster dalam format HTML πŸ™‚
Ini yang akan membantu kita dalam game WORDZ tersebut.

OK, mari kita download dulu kamus tersebut. Yaitu bisa dilihat di http://www.gutenberg.org/etext/673.
Saya kemudian download dari mirrornya di Taiwan, sehingga sangat cepat selesai.

Setelah itu unzip file pgwht04.zip tersebut. Akan muncul file pgwht04.txt
Lalu rename menjadi (misalnya) webster-dictionary.txt

Kembali ke game WORDZ, pada permainan ini ditampilkan berbagai kata yang beberapa hurufnya sudah fixed, dan ada juga beberapa hurufnya bisa kita tukar-tukar. Contoh : F__C__O__Y , dimana jawaban yang tepat adalah “factory”

Pada contoh tersebut, kita bisa menemukan kata tersebut, pada kamus Webster yang tadi kita telah download, dengan sangat mudah. Gunakan GREP ! πŸ™‚

Pada contoh ini, perintahnya adalah :

cat webster-dictionary.txt | grep -o ” f.c.o.y “

Tanda titik pada perintah grep berarti adalah suatu huruf yang tidak kita ketahui. Nah, maka kemudian grep akan menampilkan semua kata yang memiliki pola F__C__O__Y
Sehingga dalam waktu sekejap mata saja Anda akan langsung menemukan jawabannya, yaitu FACTORY πŸ™‚

Ketika saya perlihatkan trik ini, mata anak saya langsung terbelalak. “wahhhh komputernya hebat !!”
Jadi nyengir deh saya, he he

Selanjutnya kami berdua melanjutkan permainan WORDZ tersebut bersama-sama. Dalam waktu yang tidak lama, kita sudah sampai ke level 25. He he. Seru sekali memainkan game ini bersama anak-anak ini. Mereka terus heboh ketika kata-kata yang sulit sekalipun bisa ditemukan oleh “komputernya papa” dalam waktu singkat πŸ˜€

Sampai kemudian istri saya mengingatkan – bahwa sudah saatnya dia mengerjakan PR nya. Ternyata PR nya musti dikerjakan bersama-sama dengan orang tua.
Jadi. orang tuanya membuat soal, dan sang anak membuat jawabannya.

Apa soal yang musti saya buat? Ternyata, soal-soal berupa akar tiga. Saya perlu memilih 3 buah angka 6 digit, yang nanti akan dicari akar 3 nya oleh anak saya.

More fun πŸ™‚

Saya bilang ke anak saya, “Eh, angka-angkanya biar dipilih oleh langit saja yaa”. Matanya kembali terbelalak.
Sambil nyengir saya membuka RANDOM.ORG, dan dalam waktu singkat muncul 3 buah angka 6 digit untuk menjadi soal PR nya.

Dia kemudian mengerjakan PR nya dengan riang gembira.

Mission accomplished ! πŸ˜€

Filesystem SSH di Ubuntu

Seringkali saya perlu meng copy file antar server Unix / Linux, dengan parameter cp tertentu, seperti /u (updated files only). Namun fasilitas ini tidak ada di scp. Atau, perlu mounting remote filesystem, namun secara secure. Apa akal ?

Dengan ssfs / fuse, maka kita bisa melakukan ini dengan mudah.

Copy-paste di Ubuntu perintah-perintah berikut ini :

sudo aptitude install sshfs
sudo modprobe fuse
sudo sh -c β€œecho β€˜fuse’ >> /etc/modules”

sshfs / fuse telah terpasang, dan otomatis akan selalu berjalan.

Untuk mounting, ketik perintah berikut ini :

sshfs user@hostname:/path/to/folder /local/folder

Maka kini kita bisa mengakses folder di server remote tersebut via /local/folder, nice!

Ketika sudah selesai, ketikkan perintah berikut ini :

sudo umount /local/folder

Ingin agar ini selalu dilakukan setiap booting ? Cukup edit file /etc/fstab, dan tambahkan baris seperti ini :

[hostname/IP]:/path/to/folder /local/folder fuse defaults 0 0

Semoga bermanfaat.

Ref: ubuntu-tutorials.com

Net Tools

Bagi peminat masalah security / networking, Net Tools adalah satu koleksi utility yang bisa berguna bagi Anda.

Beberapa fitur Net Tools:

1) IP Address Scanner
2) IP Calculator
3) IP Converter
4) Port Listener
5) Port Scanner
6) Ping
7) NetStat (2 ways)
8) Trace Route (2 ways)
9) TCP/IP Configuration
10) Online – Offline Checker
11) Resolve Host & IP
12) Time Sync
13) Whois & MX Lookup
14) Connect0r
15) Connection Analysator and prtotector
16) Net Sender
17) E-mail seeker
18) Net Pager
19) Active and Passive port scanner
20) Spoofer
21) Hack Trapper
22) HTTP flooder (DoS)
23) Mass Website Visiter
24) Advanced Port Scanner
25) Trojan Hunter (Multi IP)
26) Port Connecter Tool
:
:
107) File Shredder
108) Local Access Enumerater
109) Steganographer (Art of hiding secret data in pictures)
110) Subnet Calculater

Dan terus bertambah setiap saat.

Memang ukuran downloadnya agak besar, tapi dari segi fitur cukup lengkap.

            








SEObox: Web Hosting Murah Unlimited Komik Indonesia Homeschooling Indonesia