Dec 29 2009

“source code”

reading chedet’s blog (here) and come accross this in point no. 9

“source code”

hahaha.. US didn’t release their F/A-18 under gpl.. no source code, no open source. haha.. US didn’t support open source.

GG

Dec 28 2009

rasa

rasa yang tak best untuk bertandangan buat masa sekarang. boleh untuk tidak ke?

kerja! kerja! kerja!

Dec 24 2009

Backup and Drop

Learn the drop first. But do this only after the backup =)

1- get into you mysql

mysql -u root -p

smash the enter key on your keyboard (if any) and you will prompted for a password. enter your password as long as it is, don’t cheat.

2. drop the database.

drop database <database_name_here>;

Done. take note that you will never found the database in thrash.

Next is the backup.

1- from terminal,

mysqldump -u root -p –database database_name_here > backup.sql

2- you will be prompted for a password.

3- a new file created, with name backup.sql

evertyhing is much easier with (eg: phpmyadmin), am i right?

Dec 20 2009

gambor

Post gambar sendiri punya dalam blog sendiri. Bukan selalu pun. =)

#1 – KFC Malaysia World Band Competition 2009.

KFC MWBC 2009 adalah pertandingan pancaragam anjuran KFC. Pada awalnya, aku ingat ini adalah sebahagian dari acara dalam Kuala Lumpur World Marching Band Compeitition (KLWMBC) 2009, yang berlangsung malam sebelumnya. Tetapi hakikatnya tidak. MWBC dan KLWMBC adalah dua yang berbeza. Bertempat di Jalan Ampang, berhadapan bangunan lembaga getah. Hujan turun sebaik sahaja pertandingan dimulakan dan reda setelah lebih kurang 30minit. Gambar yang sempat dirakam:

DSC_0009

DSC_0070

DSC_0076

DSC_0096

DSC_0100

DSC_0115

DSC_0178

DSC_0215

DSC_0243

DSC_0317

DSC_0325

DSC_0339

DSC_0354

#2 – Majlis Berkhatan

Majlis berkhatan bertempat di Dewan JKKK Kampung Baru, Batu Caves, Selangor. Bermula dengan berarak naik lori. Seterusnya mandi air pili bomba dan potonggggg. Semoga mereka yang dipotong cepat sembuh. Majlis berkhatan ini dianjurkan oleh PAS. Terima kasih kepada messo, sam, haiqal & nik.

DSC_0006

DSC_0010

DSC_0019

DSC_0030

DSC_0061

DSC_0071

DSC_0102

DSC_0107

DSC_0115

DSC_0161

DSC_0167

DSC_0174

DSC_0180

DSC_0210

DSC_0230

DSC_0299

DSC_0309

DSC_0333

gambar-gambar lain: syamsulbahri | heikkal | samsulsaid

#3 – Showdown of Champions 2009

Berlangsung di Stadium Melawati, Shah Alam. Terima kasih kepada messo. Tak pernah-pernah aku tengok perlawanan tenis neh.

DSC_0390

DSC_0365

DSC_0448

DSC_0353

DSC_0433

DSC_0459

paling akhir, “startrail”. Sebenarnya nak tangkap gambar “meteor shower” minggu lepas, tapi tak ada yang berjaya “ditangkap”. Tak pasti kenapa “trail” tu warna lain-lain.

startrail

Terima kasih.

Dec 18 2009

it should be started by now.
well, i choose not to as i have no idea about the stop yet, so do between those two.

Dec 16 2009

During the weekend #1

Sunday, 13th Dec 2009. Majlis Berkhatan at Surau Ubudiah. It’s quite hard to get there as first-timer. I shoot few photos and would like to share some of them.

click the thumbnail for a little bit bigger photo =)

Dec 14 2009

1Malaysia going international

1Malaysia Lotus

KUALA LUMPUR 14 Dis. – Pelumba kelahiran Itali, Jarno Trulli diumumkan sebagai pemandu pertama Formula Satu 1Malaysia-Lotus (1MF1T-Lotus) manakala pemandu kelahiran Finland, Heikki Kovalainen pula dipilih sebagai pemandu kedua.

Sementara itu, Fairuz Fauzy pula diumumkan sebagai pemandu ketiga.

Pengumuman tersebut dibuat oleh Menteri Belia dan Sukan, Datuk Ahmad Shabery Cheek di bangunan Parlimen di sini hari ini. – Utusan

sumber: http://utusan.c…g=bt_11.htm

rakyat didahulukan, PENCAPAIAN diutamakan. betul la tu…

Dec 10 2009

MySQL backup using PHP

salam and good (late) evening.

thinking of having a database backup for this blog, i plan to run a cron job on this hosting. i have several choice, to run sh, cgi, perl or php. i choose to try php.

some googling bring me to this site: http://davidwalsh.name/backup-mysql-database-php

i mod the script a bit, only a small change.

<?php
backup_tables(‘localhost’,’db_usename’,’db_password’,’db_name’);

/* backup the db OR just a table */
function backup_tables($host,$user,$pass,$name,$tables = ‘*’)
{

$link = mysql_connect($host,$user,$pass);
mysql_select_db($name,$link);

//get all of the tables
if($tables == ‘*’)
{
$tables = array();
$result = mysql_query(‘SHOW TABLES’);
while($row = mysql_fetch_row($result))
{
$tables[] = $row[0];
}
}
else
{
$tables = is_array($tables) ? $tables : explode(‘,’,$tables);
}

//cycle through
foreach($tables as $table)
{
$result = mysql_query(‘SELECT * FROM ‘.$table);
$num_fields = mysql_num_fields($result);

//$return.= ‘DROP TABLE ‘.$table.’;’;Β  ##i don’t want this as i can manually remove existing table during restoring the backup
$row2 = mysql_fetch_row(mysql_query(‘SHOW CREATE TABLE ‘.$table));
$return.= “\n\n”.$row2[1].”;\n\n”;

for ($i = 0; $i < $num_fields; $i++)
{
while($row = mysql_fetch_row($result))
{
$return.= ‘INSERT INTO ‘.$table.’ VALUES(‘;
for($j=0; $j<$num_fields; $j++)
{
$row[$j] = addslashes($row[$j]);
$row[$j] = ereg_replace(“\n”,”\\n”,$row[$j]);
if (isset($row[$j])) { $return.= ‘”‘.$row[$j].'”‘ ; } else { $return.= ‘””‘; }
if ($j<($num_fields-1)) { $return.= ‘,’; }
}
$return.= “);\n”;
}
}
$return.=”\n\n\n”;
}

//save file – i use this name as for me.
$timed = date(DATE_RFC822);
$aa = array(‘ ‘,’:’,’+’,’,’);
$timed = str_replace($aa,’_’,$timed);
$path = ‘/home2/sesteria/public_html/aalim/blog/’;
$filename= $timed . ‘.sql’;
//echo $filename;
//$handle = fopen(‘db-backup-‘.time().’-‘.(md5(implode(‘,’,$tables))).’.sql’,’w+’);

//i want to know
$to = “aalim@aalim.net”;
$subject = “Backup for today done – ” . date(DATE_RFC822);
$body = $filename;
mail($to, $subject, $body);

$handle = fopen($filename,’w+’);
fwrite($handle,$return);
fclose($handle);

mysql_close($link); //i add this
}

?>

To use this, copy into a text editor, and save as backup.php (you can choose your own filename).

Run this script via browser by accessing the page. eg: http://aalim.net/backup.php

A .sql file will be created in the same directory of this script.

The other way to execute is, via shell by using this command:

php /home/aalim/blog/backup.php

A .sql file will be created in the directory where you execute the command. (pwd will tell you where you are)

terima kasih =)

Make sure to CHMOD 777 the directory to allow a new file to be created. (You might not need 777)

Dec 08 2009

long lost “thing”

stumbled upon something that had been missing for quite a long time, at least for me =)

mirc

good memory remains. and the bad too =)

Dec 06 2009

1 Malaysia

1 Malaysia. Sepatutnya pagi tadi bangun awal, pegi dataran. 😐

[youtube]http://www.youtube.com/watch?v=Nv7V4n6pOLE[/youtube]

Dec 03 2009

baharambang dengan pcap

extracting a file from a pcap file.

what i did is, i run my wireshark and download makan.pdf. all the packet captured and stored by the wireshark. i save the captured packet as makan.pcap.

what i want to try to do is, extract makan.pdf from that pcap files.

if you want to try, get the pcap file here.

1- open the file with wireshark.

1

2- find the “suitable” packet. in this case, i choose GET /makan.pdf as that is what i want. it might be differ if you have a bigger size of file. in this case, makan.pdf is small in size. i don’t know, if you know, let me know too πŸ™‚

2right click on that frame, and follow tcp stream.

3- a new windows appeared. i click save as.

3

4- i save as makan_x.pdf

4

5- the saved files seems worked perfectly. can be opened. i get the makan.pdf, i can read the content.

5

i’m done with my try. do share yours πŸ™‚

is this the right way? i would like to know the easier way. can i? what if the file is being send/receive via dcc in IRC orΒ  ftp or netcat?

Dec 02 2009

lupa

membuang masa nak menyelesaikan

… failed to open stream: Permission denied in …

yang mana rupanya hanyalah sebab register_globals yang aku off sebelum ni.

haishhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

noob.