Friday, April 27, 2012

Export Data From MySQL Database to CSV Files

First  of all, thanks to the developer of MySQL who created mysqldump tools. By using this tool, you may be able to export data from MySQL databases to CSV files and deliminated text files. Here is the syntax:

 mysqldump -u[username] -p[password] -t -T/path/to/directory [database] --fields-terminated-by=,  

A destination path in the command above should be writeable for user mysql. You can use "--fields-terminated-by=" to change deliminated flag like comma, tab, etc. Consider that you have a database with its table like this:

 mysql> use trial;  
 Reading table information for completion of table and column names  
 You can turn off this feature to get a quicker startup with -A  
 Database changed  
 mysql> select * from moneter;  
 +----+--------+---------+  
 | id | mphone | dshell |  
 +----+--------+---------+  
 | 1 | BBBOH | P808091 |  
 | 2 | BBBIJ | P909091 |  
 | 3 | AABCO | P606052 |  
 | 4 | ABBCO | P608752 |  
 | 5 | AGHCO | P788752 |  
 | 6 | GGOUG | P102220 |  
 | 7 | GGOJG | P102343 |  
 +----+--------+---------+  
 7 rows in set (0.00 sec)  

Tuesday, April 24, 2012

Memblokir Iklan dengan Adblock Plus di Google Chrome

Tanpa banyak basa-basi, langsung saja install extension Adblock Plus untuk Google Chrome via Chrome Webstore. Extension ini berguna untuk memblokir iklan-iklan yang muncul di halaman website (biasanya di website-website berita, seperti detik.com, kompas.com, dll). 
Adblock Plus di Webstore
Berikut contoh halaman web beriklan yang dibuka menggunakan browser Chrome sebelum dan sesudah menginstall extension Adblock Plus

Wednesday, April 18, 2012

BGP Attribute: Weight, Local Preference and Metric

Atribut BGP, seperti weight, local preference dan metric akan sangat berguna ketika router Anda memiliki multiple exit/outgoing atau melakukan manipulasi outbond routing. Atribut ini akan membantu Anda dalam menentukan best path sesuai keinginan Anda.

Weight

Router dengan weight tertinggi akan dipilih sebagai best path. Nilai weight antara 0 sampai 65535. Weight hanya berlaku di lokal router saja.
Format perintah:
 neighbor {ip address | peer-group} weight {value}  

Berikut contoh konfigurasi bgp weight:
 inter-core(config)# router bgp 500   
 inter-core(config-router)# neighbor 1.2.4.5 remote-as 100   
 inter-core(config-router)# neighbor 1.2.4.5 weight 200   

Wednesday, April 04, 2012

Tuesday, April 03, 2012

Tips & Tricks: Create Directory Without Name In Unix

Oneday, someone just hack my server, and then he downloads some C codes(exploit) from internet, compile it and run it. Oh my gosh! my server become freeze & the load is very high. It took all the resources on my server. By using command "ps axuf", i can see where this exploit running from. But, it's strange to see the path of this exploit.

 root@dns:# pwd  
 / /ex/exploit  
 root@dns:# cd /  
 root@dns:# ls  
    boot etc  initrd.img   lib     media opt  root selinux sys usr vmlinuz   webmin-setup.out  
 bin dev  home initrd.img.old lost+found mnt  proc sbin srv   tmp var vmlinuz.old xen