Pages

Tuesday, September 30, 2008

Wine vs Virtualization



For this 'lebaran' holiday i've managed to free up some time to try out virtualbox. Something i wanted to do along time, but got no time to actually do it. The goal is simple, try out virtualization and able to run some windows application in my ubuntu laptop, namely CounterStrike and Warcraft :D


Installing VirtualBox

Installing virtual box is quite easy, you can install it using apt, but I choose install it from the deb package. Just go to http://www.virtualbox.org/wiki/Downloads, and download the appropriate package, in my case it was for ubuntu 8.04 hardy heron.

After the download has finished, install the deb package using sudo dpkg -i [virtual_box_package. deb]. After answering couple of question and license agreement VirtualBox should be available under application > system tools > Sun xVM VirtualBox

Installing the Guest OS

My ubuntu OS in virtualization is known as the "Host OS". While the OS i want to install in VirtualBox is known by the term "Guest OS". In my case I'm planning to install Windows XP as my Guest OS.

The first step in installing the guest os is having the Installation CD or the image for that Installation CD. So i created an image from my XP Installation CD. The first try is a failure. Somehow the image i created using nero express couldn't be booted. So i try making a second image using UltraISO, and it worked. Boot from the CD and installing the Windows XP OS is like a walk in the park.

When you're installing the Guest OS for the first time you will be asked to set the memory and hardisk for your Guest OS. 2GB memory should be enough for my needs. And for the hardisk, I choose 10 GB dynamic hardisk allocation. By using dynamic allocation, it allow the space to grow, from the minimum installation to max 10 GB. Its better instead of allocating 10 GB right away. With fixed hardisk allocation you'll gain better performance, but the dynamic thing fits my need.

With this finished i have two OS running on my laptop, and my work is complete without a hustle. But here come the show stopper.

The Show Stopper


To be able to play a network game, my Guest OS Should be able to connect to the same local network as my Host OS. In VirtualBox 2.0.2 they say that if I'm using DHCP the NAT would work out of the box. To bad my home network only have static IP address :(

After tampering a while, trying couple of the network setting, my Guest OS Network connection still couldn't connect to my local network or the internet. The windows lan connection say that it is connected. But i couldn't ping my gateway.

After googling in the internet, i found out that i need to create a bridge between my Host and Guest OS. But i couldn't find this settings in VirtualBox Network tab. It turn out you need to install uml-utilites and bridge-utils package for ubuntu. You can install it using apt command or synaptic package manager.

I've got the general step from this Post.

Basically you need to set-up a bridge and/or a tap connection in your network interface. And then change the network setting in your VirtualBox Guest OS network setting Attached To option to Host interface. Then use the created tap0 name as the interface name (the bridge name shold work as well but i haven't test it). Then set your Guest OS Network Settings to use your Host IP as it Gateway.

The Other Problem

After succeded doing this. I try running warcraft on the Guess OS. It worked , but i can only go as far as the main screen. Can you guess what the problem is ?

Should have guess it from the start. In virtualization, you got the whole OS virtualized, but that also mean that the hardware is also virtualized. Though it worked out fine for some application. But for games that uses OpenGL and DirectX. It simply wasn't enough.

And that sum up my trial for virtualization. You can play arround with couple of cool stuff in virtualization like guest addition and seamless mode. Try it, its very cool.

A Taste of Wine


While my trial for virtualization is a success, i still didn't get what i wanted. Its time to try a different approach.

For many people that migrating from windows to linux, there's one definite stopper. Games !!

You can find many application that can run in linux and windows. Or find some alternative that have similar capabilities with it windows compatriot. But with games, its a real problem. And wine has been the heroes for this kind of people.

Although its not the real windows, wine implemented almost all of the Windows API in its own way. In same cases it even perform faster than the original windows implementation. Since it stripped down a lot of things that doesn't needed.

In my case after installing wine 1.0.0 from ubuntu repository using apt-get. Installing Counter strike and Running Warcraft like my previous post. Is as simple as a single click :)

An Unimportant Conclusion

In virtualization, you've got the whole package. The real OS, yeah i repeat the real one, run on top of your Host OS. Re-installing the Guest OS wouldn't cause a problem to your primary OS like using dual boot. And you can also run many Operating System at once on a single computer that act like a separated machine.

There are many other advantaged using virtualization, but one thing that it lacked is the access to the real hardware. But I think the advantage still far outweigh the disadvantage.

In my special case i need to be able to run windows program and access the hardware capability. In this part Wine is still the best. There's a lot of program that wine can do, but that also the disadvantage of wine. You need your application to be supported by wine, to know that it will run smoothly on wine. But still there's a whole lot of application that wine supported, including spore *Wow*.

And also since Wine is Windows Emulator, it emulate the application for windows platform only. So your OS option is far more limited.

But the key is know the right tool for your needs. In my case this time, the right tool is Wine :D

how to play warcraft 3 in wine with no installation step

It turn out to be very easy.

I'm using ubuntu 8.4 Hardy Heron.

- All i need to do was install wine
- Copy my warcraft installation to my drive_c folder, you should find it arround /home/[user name]/.wine/drive_c/
- in my case my warcraft installation is named wc3. So i just "cd /home/[my username]/.wine/drive_c/wc3/"
- and then execute it using "wine Frozen\ Throne.exe -opengl
- and voila, it worked wonderfully :D

Friday, September 26, 2008

Jadi Pertanyaannya Adalah ....

What kind of Life do you want to Live ?

Pertanyaan itu kembali menelusuri tiap ujung sel-sel kelabu gw. Seperti virus yang tidak bisa dimatikan, walaupun dormant untuk beberapa saat, tetapi selalu muncul kembali.

Kalo melihat karir gw, dimulai dari part time sebelum kuliah. Kerja diperusahaan 'religius' dengan gaji minim. Kemudian menghabiskan waktu 3 tahun menimba ilmu dengan gaji average, pindah ke perusahaan multinasional, hingga sekarang berada di perusahaan kelas A dibidang gw. Waktu terasa begitu cepat, tidak pernah gw bayangkan sebelumnya dalam waktu belum sampai 5 tahun gw bisa berada di posisi ini. Padahal di awal karir, progressnya begitu lambat.

Semua hal itu gw coba jalani dengan ikhlas, dalam rangka pencarian apakah makna profesionalitas itu sebenarnya. Untuk urusan gaji, selama masih cukup buat ongkos, makan, ngasih ortu dan bersenang-senang sedikit, itu masih dirasakan cukup oleh gw. Harus belajar mensyukuri nikmat yang diberikan.

Selain itu yang ada dipikiran gw adalah, uang bukanlah satu2nya hal yang gw raih. Gw ingin belajar, tentang a lot of things, yang bisa membantu gw mewujudkan impian gw nantinya.

Tetapi sekarang yang menjadi pertanyaan. Sampai kapan mau belajar terus ? Apakah selamanya, alasan belajar digunakan untuk menutupi ketidakberanian mendobrak posisi yang sudah nyaman dan mungkin berlebih ini. Disaat materi lebih dari cukup dan masa depan penuh kepastian ? Ataukah memang benar bahwa sekarang belum saatnya, belum cukup waktu, belum cukup belajar ?

Terkadang gw iri dengan orang2 yang bisa hidup bebas. Dimana prinsip mereka tidak membelenggu mereka. Disaat orang-orang kantoran ketakutan kehilangan kemapanan, sehingga rasa keadilan dan kreativitas mereka semakin hari semakin terbelenggu dan lama2 lenyap.

Is it worth it to live like that ?

Karena orang-orang seperti itu akan disanjung-sanjung seperti pahlawan ketika masyarakat membutuhkan pendobrak terhadap peraturan2 yang sudah tidak sesuai jaman lagi. Tetapi dilain hari mereka bisa dianggap outcast karena orang-orang yang tadinya mendukungnya kembali kekehidupan mereka yang nyaman dan tanpa resiko.

Susah sekali menjawab pertanyaan ini, karena yang bertanya pun sebenarnya tidak tahu inti dari pertanyaan itu apa. Apakah sekedar gundah gulana, atau hanya bagian dari masa perubahan ? Tetapi apapun maknanya, tetap saja, hati yang gundah gulana harus menemukan jawaban untuk ketenangannya.

Sunday, September 21, 2008

5 Centimeters Per Second

Even now, I Still love you ... I Wrote that in a text message to a woman I went out with for three years. But I'm sure that even if we had written 1000 text message back and forth ...

... our hearts probably wouldn't moved even 1 centimeters closer.


One more time, One more chance

I'm always searching for you, always searching for your figure.
At the opposite train platform, or through a window into a back alley.
Though there's no way you could be here.

If wishes do come true, I want to be at your side.
There's nothing I can't do.
I'd give up everything to embrace you.

If I'm just diverting my sadness, anyone will do.
On this night where it seems the stars will fall from the sky, I want to be truthfull to myself.
One more time, don't fade away, seasons.
One more time, I want that time when we fooled around together.

I'm always searching for you, always searching for your figure.
At the intersection, or in my dreams.
Though there's no way you could be here.

If miracles do occur, I want to show you now
the new dawn, how I'll be from now on,
and the words of love I could never tell you.

The memories of summer revolve arround me,
and your throbbing heartbeat that suddenly vanished.

I'm always searching for you, always searching for your figure.
In the city at dawn, or in Sakuragi-cho.
Though there's no way you could be here.

If wishes do come true, I want to be at your side.
There's nothing I can't do.
I'd give up everything to embrace you.

I'm always searching for you, always searching for even a fragment of you.
At a store I'm going to, or in the corner of a newspaper.
Though there's no way you could be here.

If miracles do occur, I want to show you now
the new dawn, how I'll be from now on,
and the words of love I could never tell you.

I'll always end up looking somewhere for your smile.
While waiting for the express train, or at a railroad crossing.
Though there's no way you could be here.

If i could live life over again, I would go to your side every time.
For I want nothing
more precious than you...

----

Damn, made me want to quit my job. And do something that could touch the heart of people like this :(

Don't fade away, season.

Wednesday, September 17, 2008

BFR - An Update

It started with a simple need. I wanted, if I'm moving my downloaded file using BFR, it will store the latest chapter that I've download And show it at the mapping table. Simple right, i thought so to, well at least when i started doing it.

Basically i need to add a method that can recognize a pattern like volXX chapterYY. But since there's no fixed format for this. I need to add series of pattern that *possible* for such thing. Simple enough.

Then i need to store the latest chapter so it can be compared with future chapter that i move. To do this, i need to update my xml data. This is what i like about serializing with XML, since you know the format you can modify it using external program. Trying to do this with Java Serialization API would be nearly impossible :(

Here is the thing where it get tricky. I can do it manually, but if do that, than it would beat the purpose of creating this application. So i want to do it Automatically.

What i do is, when the application start it will try to serialize the xml data using the format known to the program. If the data is outdated, the serialization will fail. And it will throw a value required exception. When this happened i just switch to the old serializer, copy the data to the new serializer, backup the old file and then save the new XML data file. Simple but a bit tricky, wasted the whole weekend for it :(

And the last part is to create a simple rule that can determine which one is the latest chapter between 2 filename. I wanted the rule to be able to handle more complex comparison, like when there's only the volume info available and no chapter information. Or comparing which one is latest volXX chapterYY or ChapterYYY only format.

For now, the rule only consider the volXX chapterYY compared to volXX chapterYY format. Creating and plugging a new Rule should be simple enough in the future though.

You can download it from Here

Saturday, September 6, 2008

BFR - A Release

Well its not something fancy or even complete, yet its very useful for me :D

I've often download my manga collection from many website, put it down on a folder to sort it out later. As time goes by, suddenly that folder already filled up with about a hundred files with different naming convention. So i just let it be, and now its to late for me to gather a will to sort it out. So instead I'm making this utility to do that for me, and i called it Bunglon File Renamer *yeah the name is lame, but what ever :P*

Basically its got 3 panel. Remover panel, Incremental Renamer, and Counter.



The Remover panel got three button, Remover, Move and Add Mapping. The remover button is usefull for removing that dl number like 140950-Ares_v14_c098-kmts.rar to Ares_v14_c098-kmts.rar (you know where i get such a naming from right :P). While Add mapping button, will add a catalog that maps a key string to a folder you want. After adding the list to your catalog, just select all of the files in a folder, and then click the move button. It will move that file into the appropriate folder.



The incremental renamer will rename a list a file into a prefix+counter, note that the exetension name will be the same. So if you rename aa.jpg , a1224.jpg with prefix "reunian" you will get, reunian01.jpg and reunian02.jpg

The counter panel means to count a list of file, to know if there's a file missing in that list of files. To bad i haven't implement it yet :P

You can download-it from sendspace And thanks to that amazing SimpleXML library its only 403KB. Note that you need jre 5.0 installed on your sistem. And if its show some exception for the first time. Just close the application and start it again. It will automatically create the files that couldn't be found for the first time.


Well have fun :D

Friday, September 5, 2008

A perfect match

Untuk kerjaan iseng-iseng gw dirumah, gw lagi coba-coba mem-persistance-kan data aplikasi gw dengan menggunakan Java Serialization API Just for the sake of Learning It:P Tapi ternyata walaupun mudah, serialization memiliki banyak batasan. Gak flexible terhadap perubahan struktur data, dan yang lebih penting, susah diedit dari luar program.So i guess back to xml. Tapi gw gak mau pake library xml yang biasa gw pake. Karena kebutuhannya sebetulnya simple aja. Bisa serialize/deserialize object ke xml and write to file, gak butuh yang canggih2.

Sempet ngeliat2 xml beans, soalnya direkomendasi banyak orang. Tapi setelah baca-baca doc and tutorialnya, mulai patah arang dan berpikir untuk bikin sendiri aja.

Itu pikiran gw beberapa hari yang lalu. Hari ini ada sedikit waktu luang, dan googling lagi sebentar dan ketemu simple. Thank god for a good refined query :P

Simple adalah semua yang gw inginkan, and even more :
- sederhana
- besar library + dependencies < 1 Mega
- cepat dipelajari, less than 15 minutes udah bisa masuk ke mode production:P thanks to tutorial yang tidak berbelit-belit
- pake annotation, jadi code lebih clean
- dan ternyata yang paling bikin gw seneng, pake stax (streaming api for xml) so its gonna be fast :D

kelemahannya karena pake annotation jadi harus pake java 5 ke atas. Tapi ini sepadan dengan performance gain yang didapat di java 5.

Simply said, its Simple and Amazing :D Bakal jadi pilihan pertama gw nih untuk hal-hal yang tidak membutuhkan schema and code generation. Yay.. \(^-^)/

Thursday, September 4, 2008

Menasehati dengan indah

Walaupun udah jarang banget nonton TV, tapi kadang masih nyantol juga kalo udah pegang remote. Apalagi kalo ada hal yang menarik, kayak Para Pencari Tuhan. Walaupun gak sengikutin waktu dulu jilid satu, tapi tastenya tetap sama, jadi nyambung2 aja walaupun nontonnya sekilas2.

Dan gw masih salut gimana skenario-nya bisa membuat nasehat untuk orang lain, ternyata jadi solusi buat masalah pribadi yang menggantung sekian lama. Yah agak corny sih kalo langsung dapet kesimpulannya aja. Makanya harus di ajak ngalor-ngidul dulu ceritanya sampe momennya pas :P And thats the art of the story telling.

Well anyway, i found it really hard to do that in real life. Entah kenapa kalo memberi nasehat, bawaannya sok tahu, sok wise, ngerasa bener melulu. Padahal kalau dibiarkan dan hanya memberi petunjuk, mungkin lebih mengena. Mungkin karena rasa egois ingin punya pencapaian membantu orang lain, mengubah jalan hidup mereka. Well its human, but can't we be a better human ?

Chrome

The hottest word of the week. Google really know how to innovate and deliver. Its everything that they said. Its fast, smoth, the javascript engine is amazing compared to other competitors (V8 is so amazing), And more importantly for me, its very reliable. I've crashed my shockwave plugin twice and yet this post managed to survive without a single restart like in firefox. And thats because chrome using multiprocess instead of multi thread, i guess multi thread doesn't always win over multiprocess like in OS environment. Good to know that each thing has its own place in this world :D

What so great about this browser, is that the end user could feels the difference in performance. I've opened like 30 tab in 3 different window with one of the window is using incognito mode. This mode gives you a whole set of privacy, a mode that currently lacking in firefox 3. Using that 3 window to access site with heavy javascript usage gives me such a pleasure, because it run so smooth and fluid. Usually opening 2 window with couple of tab that access heavy javascript site, would make my firefox hang after an hour or two.

This could be a start of a major shift in the internet. Since all of google site is a heavy javascript application. GMail, GDocs, Google Calendar, and even the heaviest one Google Maps has rise up a level, maybe even two level :D. When it comes to editing a document online. Office need to becareful because your competitor is getting dangerous :D It lacked something though, the smart tab navigation that exist in firefox 3 :( well its a minor thing compared to all of its breakthrough

On the opposite side, as a web developer you will appreciate chrome even more. Since its packed with a whole developer tools. The inspect element in right click menu that worked just like firebug, but with more elegant GUI. The task manager that show real time process report in chrome, showing memory and processor usage. So you can see which process that hogging your computer resource. The stat for nerd showing this reports in more detail and elegant layout. And the task manager even smart enough to group tab generated by the same domain. Even the hidden config like about:dns and about:networking has a capability to help you in debugging your application.

Google has done it again. Just like GMail and Google it self, it managed to shock the internet, and brought it to a whole new level. I'm pleased and very happy with all of its innovation and yet somehow i feel scared.

Anyway congrats for google, managed to hide this for two years. And swept us out of our feet when it is released. I coudln't find more elegant way to announce chrome :)

Wednesday, September 3, 2008

Kangen..

... kangen banget gw dengan gw yang dulu. Yang bebas tertawa, kuliah for the sake of learning and enjoying life. Main bola setiap sore, berdekil2 ria dengan peluh dan debu di sekujur tubuh. Saat dimana merasakan benar-benar hidup.

Entah saat tepatnya. Tetapi somewhere along the way, itu semua sedikit demi sedikit memudar. Apalagi setelah mengenal dunia bekerja. Hingga akhirnya saat ini, dimana gw merasakan kehilangan sebagian diri gw. Begitu berat membuka mulut untuk berkata-kata, karena tahu kemungkinan itu akan berbalik berkali-kali lipat sebagai beban. Hanya dapat tersenyum simpul, sedikit miris tanpa mampu untuk menyelesaikannya menjadi sebuah tawa yang lepas.

I think i need some rest...