December 20, 2011

Balik Kampung: Memori Cinta Sekolah Rendah


'Kampung' is a village, hometown or parent's home/place. It's a Holiday season. Holiday = Wedding Ceremony. I went back to my 'kampung' for my brother's wedding last weekend. Congratulation bro! :D

In my 'kampung', I have one favorite spot. No matter where we moved, the spot will moves along. It is a small library.

1 of 4 bookshelves.

During my childhood, I hate 'ABC'. I hate '123'. I hate learning. I love to draw. I love to make stuff. I love playing, I love LEGO, Manila cards, A4 papers, empty plastic/Aluminum bottles, polystyrene, etc.. I always cried when my mom trying to teach me how to read. I always cried when my mom scolded, 'cubit'(pinched) and 'rotan'(whipped with rattan) me because I was very lazy. I was very stubborn compared to my little sister.

My sister can read earlier than me. Until later, I have basic fundamental of reading and counting. I'm very thankful for my parents effort in teaching me. I can read signboard, so that I won't get lost. Now, I have access to unlimited written information and knowledge.

'Mat Sains' (The Science Guy) series by Matlob, Dewan Bahasa & Pustaka was one of my favourite book. Came out in the early 80's.

Mat Sains by Matlob, DBP.

When I was in primary school, my hunger for information and knowledge becomes greater. I need more input. I asked my mom and dad a lot of questions. Most of the time, I got no answer - because most of the time they have no idea on what am I asking about. They said "Go find it yourself and tell us". They bought more and more books.

I read more and more books. By reading books, I know more, I can make more stuff. I am a control freak. Now, I have more controls! 'An USBorne Guide to Technical Drawing', 'How to Make Computer Model Controllers' and 'Practical Things to Do with Microcomputers' became my favorite books during mid 80s. Browse more Usborne's books here!. At that time, 'budak darjah 2' (primary 2 school boy) looking for electronic supplies was very challenging. The 'Tauke' (shop owner) don't want to sell those stuff to a small boy - and the access of supplies (ICs) are very very limited. He kept asking me a lot of question. So, I have to lie and trick him - by writing down all the items on a paper and hand it to him, saying that "My dad are looking for this stuff" - quick fix huh!

Books by Usborne.

Having a 8086 computer gave me a lot more access to what I can do - Programming! Now I can make things virtually. My books are not as exciting anymore. I want my dad's book - and he actually gave it to me! Yeay!. I brought these books anywhere I go! 'MS-DOS: GWBasic 3.3' and 'Learning IBM Basic for the Personal Computers' is one of the earliest. To test and run the examples given by the books, I have to re-type all the source-codes. There are no diskettes/CDs comes with the books. There are no GUI or easy-to-use editor and the source-code need to be 100% correct to successfully run. There are no easy-to-use code checker/debugger too. Checking and editing have to be done manually in text based, terminal like command-prompt. If people said that doing programming in Notepad is hard, these are 10 times harder and without a mouse and limited access to printer.

Some sweet dad's Books.

I made friends with a few Chinese guys. They were Form 6 (Secondary 6) science students in a secondary school nearby (around 10 years older). We were sharing the same hobby. To do experiment and learning things easier and faster, we exchange codes. Everybody will make a copy of each other books, break up the codes, assign the task of typing and merge the codes during testing. It was seriously fun! (typing 10,000 lines of codes alone - are tiring!)

At school. My friends called me 'Kura-kura' (tortoise) - I carried a large back-pack. Besides the computer books, I have my own 'Scrap Book' - containing paper cutting and my notes, ideas, unanswered questions, etc.

The ugly 'Scrap Book'.

Things inside my 'Scrap Book'.

My hand-writing sucks until at the final year in my secondary school. I improvised and beautify my 'hand-writing' font-face because I need to write and send love letters and greeting cards to pretty girls. Nowadays, most of them got married and transformed to not-so-pretty anymore, my hand-writing 'went with it'. Ekekeke...

Let's continue.. One fine day, there was a 'spot check'/'Search' at school. The prefect found my 'Scrap Book' and said it is 'inappropriate and illegal' and it was taken away. I was in rage and sad.

There are parts in my book containing 'illegal stuff'. The 'illegal stuff' are playing cards.

Those 'Illegal Stuff' with with spelling mistake. :p

I have a lot of playing cards on Jet Fighters, Helicopters, Warships, etc and glued it in my 'Scrap Book' - for my references about each machines properties - Speed, Height and Weight, Ceiling service, etc. I was begging for them not too take my 'Scrap Book' but, they don't care. It is illegal in school, confiscated and kept in the school Disciplinary Unit's locker.

What ever it takes, I want my 'Scrap Book' back! Planning to break-in the locker, I know I have no strength to knock open the lock with a hammer. After school, I went to meet my friends in the secondary school. I need their help to get me the 'break-in' supplies - Magnesium and Aluminum strips (I know its reaction - I've played these before - Ref: Form 5 chemistry books on Thermodynamics Reaction).

As for backup 'distraction' plan for the teachers/guards, I will use 'Ubat Nyamuk' coil and Chinese fire-crackers (easy access! - one of my friend's father owns a Chinese burial shop! Yeay!) to be set-up at the other end of the school. The coil burning time are measured and will be timed to fire-up the fire-crackers if the mission taking too long risking captures.

I went out to school early the next morning with less books but with extra weight on my back-pack. Dropped by friend's house and he handed-over the supplies - no question asked. I 'borrowed' my dad's mini fire extinguisher from the store room too - Just in-case! I love to play with this thing when there are no one looking. Burning Aluminum and Magnesium will be too hot for water to handle. Adding water will breaks it to hydrogen and oxigen and will makes bigger fire and bigger 'pops' or 'kebabowww' or 'kolecik-kebummm' (oh no no.. not this.. this is the sound from RPG). I don't want that. I just want to make a tiny buzzing small-scale-extremed-temperature-thermodynamic-fireworks-metal-liquifying action for that eve!

During the morning break, I was instructed to go to the teacher's room. I was afraid that my plan were detected. In the teacher's room, suddenly, my class teacher took out my 'Scrap book'. She asked me either it is mine. I said "Yes. It's mine. I need it back, please." She opened and flipped the book page by page and wrote something on it. Then, she gave it to me. I opened the book and asked her..

"Kenapa cikgu conteng buku saya?" ("Teacher, why are you scribbling on my book?")

She replied.. "Kalau sesaper rampas lagi, bagi tau dia, saya bagi awak kebenaran buat buku nie." ("If anyone took your book again, tell them that you have my permission to do this.")

..I thanked her and her name is Pn. Samsiah (my class teacher when I was in 'Darjah 4'(primary 4))

Solid 'Ruby' Laser.
Cikgu 'Conteng' buku saya. : ' (

Thermodynamic fireworks mission was aborted. What happened to Magnesium and Aluminum strips? = 'Top Secret Underwater Burning Experiment in the bathtub' - Shhh.. don't tell my mom ya.. :)

Thanks mom and dad!

Note: During any experiment, I have a very high standard of safety and precaution procedures. I won't take any 'direct'/'known'/'highly possible' risk of injury or death.

December 13, 2011

Digital File Signatures: Magic Numbers


Haizz.. lembab btul courier service nie. Kang aku dah nak shutdown baru la hegeh-hegeh gegar pintu. So, ada 100plus + Nescafe + Asap.. Meh aku nak citer sket pasal file.

Files/data dalam computer disimpan dalam bentuk binary. '1' atau '0'. Time skolah dulu memang dah ada blaja benda nie.. 1 + 1 = 10, 10 + 01 = 11, etc.. every tempat '1' atau '0' = bit. Computer akan groupkan 8-bit jadi 1 byte. Untuk Hexadecimal (16-bit) memerlukan 2-byte (8-bit + 8-bit).

Dulu-dulu, time awal-awal dulu. Setiap programmer mesti tau benda nie untuk read/baca atau save/simpan file. Nie adalah benda yang paling asas. Coding read/save file nie dibuat dalam C/C++, Pascal, PHP, ASP, VB dan almost semua languages.

Setiap jenis file/file type boleh dikenal pasti dengan mudah melalui extension. Contohnya macam 'Awek01.jpg', 'exAwek.png' atau 'Surat.doc'. '.jpg', '.png' '.doc' adalah extension file tersebut. Berbeza dengan extension '.txt', file-file tersebut tidak dapat dilihat dengan mata kasar without decoding. Content file tersebut disimpan dan dibaca oleh computer dalam bentuk 'Hex' atau 'Hexadecimal'.

Computer tak kisah sangat pasal extension yang korang taruk. Computer akan buka file tu dan baca header atau permulaan file tu. Header nie dipanggil 'File Signature' atau 'Magic Number'. Handphone pun macam tu jugak. Dia akan check file signature. File signature ini biasanya mengandungi format file, compression, file structure dan lain-lain.

Ada banyak tools untuk bukak/edit file dalam bentuk 'Hex'. Contohnya.. wxHexEditor http://www.wxhexeditor.org (Free, OpenSource, Linux, Windows, Mac) - download jer la sesuka hati!

wxHexEditor in action. (in Windows XP)

Benda nie pun boleh digunakan untuk modified game/program, hacking, inject virus, tukar highscore kat game, taruk cheat, etc. apa-apa pun boleh (kecuali memasak, basuh keta, usha awek yg jaga tol belah utara, etc.)

So, pada permulaan file yg dapat dilihat kat nilai Hex adalah 'File Signature' atau 'Magic Number'.

Contohnya:

  • jpg = FF D8 FF E0 ?? ?? 4A 46 49 46 00 
    (dan seterusnya adalah data image, compression, etc.)
  • png = 89 50 4E 47 0D 0A 1A 0A 
    (dan seterusnya adalah data image, etc.)
  • ico = 00 00 01 00 
    (file icon, dan seterusnya adalah data image, etc.)
  • pdf = 25 50 44 46 
    (dan seterusnya adalah content pdf, etc.)

Sama la jugak dengan bermacam-macam jenis file-file yang lain yang tak menggunakan text format (yang tak boleh dibaca/disimpan tanpa decoding/encoding)

Ia juga digunakan dengan meluas time upload gambar pastu automatic resize, automatic taruk watermark, embed-code, etc. Tak kira la korang pakai Linux ke, Windows ke, Mac ke, nie sumer kira standard aa..

Adios!

December 5, 2011

Changing GRUB 2 Menu List

I always forgetting.. As  reminder to myself and others, here's how. In the terminal..
gksudo gedit /boot/grub/grub.cfg
That's it. Enter SU (super user password), edit & save! Reboot!