December 24, 2011

Fungsi/camner nak buat/Setup Website/Blog?

Aku tengah main Drupal - sekarang time tengah lemau, boleh la citer sket cara-cara basic buat website. Firstly, terms yang slalu/biasa digunakan:

Website: Basically, website adalah display/paparan interface yang boleh dicapai melalui internet. Internet = web, site = lokasi. Biasanya di access dengan file .html atau .htm melalui browser (Chrome, Firefox, Safari,  Opera, IE, etc.). HTML = Hypertext Markup Language.

Blog: Blog adalah concept. Concept cara maklumat disampaikan/dipaparkan. Lebih kurang macam journal. Ada tarik/masa dan cerita pada tarikh dan masa tersebut.

CMS: (Content Management System) Sistem Pengurusan Maklumat/Kandungan (bukan utk pompuan mengandung). CMS memudahkan pengguna untuk taruk content, type/edit blog, upload gambar, susun articles, etc.

Hosting: Server tempat simpan maklumat dan menjalankan process.

Domain Name: Alamat hosting untuk user mencapai/access website/blog daripada browser.

Linux/Apache Server: OS (Operating System) dan application yang digunakan oleh server OpenSource. Biasanya menggunakan .php (Apache). PHP = Hypertext Pre-Processor.

Windows Server: Menggunakan OS by Microsoft. Biasanya menggunakan ASP (Active Server Pages).

Korang boleh pilih sama ada Linux atau Windows. PHP dan ASP mempunyai fungsi yang sama - menjalankan process untuk memaparkan maklumat pada user - dikenali juga sebagai Server-Side processes. Process kat server > hantar kat user.

HTML: Hypertext markup language. Standard untuk semua browser terpaling asas. Nak blaja lebih lanjut, masuk sini, www.w3schools.com/html/

CSS: Cascading-Style Sheet. Kiranya .css nie macam sarung untuk .html. CSS boleh mempengaruhi macam mana file HTML itu dipaparkan. Contohnya kat .html ada title dan body. CSS akan bagi tau untuk title, font sekian-sekian, color sekian-sekian, size sekian-sekian. Kat body pun macam tu. Nak blaja CSS lebih lanjut, gie sini, www.w3schools.com/css/

Javascript: Javascript adalah code (atau script) yang dijalankan di Client-Side (kat device(PC/HP/etc) korang). Code tu akan di'download' daripada server kemudian di'save' dalam tomporary file dalam PC pastu di process. Pastu baru dipaparkan atau run. Javascript boleh dianggap sebagai program kecik/ringan - dan boleh melakukan aksi-aksi hangat yang gempak. More info, kat sini, www.w3schools.com/js/

Flash/Shockwave: Plug-in atau program atau 'Player' yang menjalankan program yang telah didownload daripada server. Sama gak macam Javascript, cuma code(content) tidak dapat dibaca oleh user(pengguna/penerima code). Was developed by Macromedia, pastu Adobe beli. Adobe (cara sebutannya adalah 'A-dobi' bukan 'edop'.. sket-sket edop.. sket-sket adop).

SQL: Structured Query Language (sebutannya 'sequel'). Digunakan untuk buat database. Ada beberapa jenis database, mySQL(Opensource, free), MS-SQL (Mircosoft) dan lain-lain. Database adalah pengkalan data. Data disimpan dalan table untuk memberi maksud/makna kepada data tersebut, biar senang carik dan senang dikenali. Contohnya, dalam table 'Billing' ada header: 'Customer', 'Date', 'Description', 'Price'. Bawah table tu/content table tu ada maklumat yang telah dimasukkan. So, senang nak cari. Contohnya, nak cari 'Customer' sekian-sekian, pada 'Date' sekian-sekian. Process mencari untuk mendapatkan maklumat juga dipanggil query. Contoh code Query: "SELECT Customer FROM tbl_Billing WHERE (Date='25-Dec-2011')"

Website yang menggunakan concept CMS seperti Blog memerlukan SQL database diprocess oleh PHP kat server dan menghantar maklumat kepada user dalam bentuk .html, .css dan boleh juga dalam bentuk script untuk diprocess atau dipaparkan. Code css dan javascript juga boleh dihantar sekali dalam 1 file .html

Untuk memudahkan user/pengguna, ramai developer Opensource telah bersama-sama membangunkan Script / Database / Process / Queries / Template / Theme dan di packaged/bundled kan untuk didownload atau digunakan oleh user secara percuma. Pengguna boleh download, install atau modify ikut keperluan. Kalau tak mo pakai Hosting yang dibeli sendiri, pengguna juga bleh register untuk mendapatkan free Hosting. Diantaranya..

Wordpress..

Wordpress.org site.
Boleh download Wordpress kat sini, http://www.wordpress.org atau register Wordpress hosting percuma kat sini, http://www.wordpress.com

Joomla..

Joomla.org site.

Blogger menggunakan Joomla CMS dan alamatnya.. (sekian-sekian).blogspot.com. Download Joomla kat sini, http://www.joomla.org atau register free Joomla based hosting kat sini, http://www.blogger.com

Drupal..

Drupal.org site.

Boleh download Drupal kat sini, http://www.drupal.org

So, kalau nak mudah, register.. buat setting sket-sket, masukkan content.. siap! Pastu update content bila rasa nak update.. Since pakai server hosting ngan orang, there are few limitation yang boleh dan tak boleh buat. Tabley modified lebih-lebih.. orang punya! Kalau stakat nak buat blog, website, masuk gambar, masuk video sket-sket, capabilities/limitation pada server yang diorang bagi/tak bagi buat sudah mencukupi..

Kalau nak ada Domain/Hosting Server sendiri, boleh aje. Kena aaa bayar yearly - Bergantung kepada tawaran yang diberi oleh hosting company. Range dia dalam RM30 sampai beribu.. Yang beribu tu kalau buat co-location. Maknanya, ada sebijik server (computer) khas untuk korang - yang disimpan dalam server room (clean-room) on 24hrs. Korang boleh access server tu semacam mana korang boleh access PC - atau Remote Access. Nak main game dalam server pun boleh (kalau line laju).

Nak hosting kat rumah sendiri pun boleh. Takder hal. Kalau korang sanggup on PC 24hrs dan mempunyai line laju. Sama gak macam concept game server time korang nak main online game..

(remote access image)

Kalau hosting yang biasa-biasa, korang boleh access server melalui program/apps/site yang diberikan. Contohnya cPanel. Bila korang dah bayar, company hosting akan bagi password untuk access cPanel. Dalam cPanel, korang boleh setkan database, e-mail address, upload dan download file. Korang juga boleh setkan file/directory mana yang boleh di access atau file/directory mana yang boleh atau tak boleh diaccess oleh orang lain.

CPanel (server-side Control Panel).

Time carik hosting, pastikan tanya dulu "Ramai tak clients dalam server tu? Ramai tak yang berniaga (especially MLM) kat dalam server tu?". Ramai clients tak semestinya bagus. Elakkan share hosting dengan peniaga (especially MLM) yang suka spam (iklan pakai e-mail/SMS lelebih ikut suka hati mak bapak dia, bulk-mailing, bulk-SMS) kepada orang yang tak berkenaan. Bila ramai orang yang tak berkenaan tu sakit hati, received e-mail/SMS sampah dan buat report - atau click "Mark as SPAM", server tersebut akan kena blocked - tak pasal-pasal korang punya website/e-mail pun kena blocked. Tu blum kira lagi total bulk-makian / bulk-doa in real-life. Suey beb! So, jangan spam orang! (termasuk la jugak kat Facebook atau memana laman sosial). Nak tau lebih lanjut tentang kehebatan orang yang jadi jutawan cepat kaya dengan mudah sambil goyang kaki dapat duit, bila masuk MLM, gie usha kat sini http://aididmuaddib.blogspot.com/.

Bila dah ada access ke cPanel, korang boleh la upload dan extract Wordpress, Joomla, Drupal atau lain-lain ke dalam server (directory www atau seumpamanya). Pastu dah bleh buat setting sket dan masukkan content.

Kalau rasa-rasa website/blog korang tak cun, boleh la sendiri modified atau carik memana theme/template free kat internet. Time nie korang perlu ada sedikit pengetahuan/kemahiran tentang graphic editing, HTML, CSS, PHP, Javascript dan SQL Database. Untuk buat/edit HTML, CSS, PHP dan Javascript, aku pakai Notepad++. Kengkadang pakai Chrome (browser) built-in editor (masuk Chrome > clisk gambar spanner > tools > developer tools) - Sama ada kat Linux atau Windows. Untuk buat/edit graphics/images, aku pakai GIMP.

Untuk memudahkan time buat development/web editing, kat Windows XP, aku pakai WAMP Server (free). WAMP stands for (Windows, Apache, MySQL, PHP - 3 dalam 1, takyah susah-susah nak install and configure one by one). WAMP akan jadikan PC korang untuk pretend/kengkonon jadi server. So time tu, tak yah connect kat internet, (off-line) pun tak pe. WAMP akan install Apache, MySQL dan PHP dalam PC. Time ni bleh test samaada website yang korang buat okay ke tidak sebelum di upload kat server sebenar. Download WAMP kat sini, http://www.wampserver.com/en/.

WAMP Server panel in Windows XP.

Ia juga dikenali sebagai 'Virtual Server' yang boleh diaccess melalui http://localhost/.

Kat Ubuntu (Linux) tak yah install WAMP. Sebab fungsi 'Virtual Server' dah memang ada kat dalam tu - built-in.

Dalam Windows Pro ada function ni dikenali sebagai IIS untuk process ASP. Malas nak citer, sebab aku prefer and recommend pakai yang Opensource dan free for everybody.

Citer panjang-panjang tapi aku pakai blogspot... apasal? Sebab bila aku mati nanti, saper nak bayar hosting/domain? Begitu la juga dengan e-mails. Aku harap dan mendoakan blogger/blogspot atau memana/saper-saper yang bagi/provide benda-benda free tanpa niat yang tak baik berada dalam keadaan selamat, sihat dan sejahtera. Thanks to all Opensource communities, supporters and providers and especially donaters -sama ada dalam bentuk wang, codes/usaha/masa, equipments, dll.

Umat manusia sedang memasuki ke era civilization yang baru. Perkongsian/penyebaran ilmu/maklumat amat penting untuk kemajuan. Aku tau macam mana kereta berfungsi - tak semestinya aku mampu bukak kilang dan buat walaupun sebijik kereta. Tapi aku mampu memberi komen / feedback / input / idea kepada tokey kilang kereta dan menjadikan kereta tersebut lebih baik, berbanding dengan tokey kilang yang tak mo terima feedback pengguna. So, don't stop sharing!

Sekian. Thanks for visiting and reading. XOXO.

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!