Life Journal

Selamat makan!

Posted by: Moses Kurniawan on: February 10, 2010

Sent from my HTC Touch Pro

Posted via email from “Made in Twenty”

Open MySQL port in Linux (3306)

Posted by: Moses Kurniawan on: February 8, 2010

Simply execute this firewall rule :
iptables -A INPUT -p tcp -m tcp –dport 3306 -j ACCEPT

For automatic startup, I recommends you to put in /etc/rc.local to each time the server is booting so the MySQL port always opened. Dont forget to check the privileges of the mysql users to allow connect from any host.

Posted via email from “Made in Twenty”

What is my blood type? A.

The comic above shows approximately 75% correct about myself.

Posted via email from “Made in Twenty”

Difference between Apple iPad, Amazon Kindle and a Rock !!!

Posted by: Moses Kurniawan on: January 29, 2010

I've been screwed when I want to install Linux Mint 8 on my laptop, because in the beginning it cannot read data DVD.

Ok, its too long to describe the chronology, lets go to the solution.

First, uninstall the DVD-ROM drive from Device Manager.
Second, start the command prompt, make sure you run it as Administrator.
Third, go to SystemDrive:\Windows\System32\Drivers\
Fourth, delete file PxHelp20.sys
Five, restart your computer or "scan for hardware changes" at Device Manager.

And voila, my DVD ROM can read data CDs again.

Maybe you wondering what is PxHelp20.sys? Yes it is a driver from Sonic Solutions. I dont know when I was install them but I was remember when I changing my DVD region. Maybe this is the problem. But, never think about that again, the most essential is my DVD ROM is working again.

Posted via email from “Made in Twenty”

Apply these linux firewall script. This is not so optimal I think, I've been messed up with this thing too.

iptables -I POSTROUTING -t nat -p tcp –dport 135:139 -o eth0 -j DROP
iptables -I POSTROUTING -t nat -p udp –dport 135:139 -o eth0 -j DROP
iptables -I POSTROUTING -t nat -p tcp –dport 445 -o eth0 -j DROP
iptables -I POSTROUTING -t nat -p udp –dport 445 -o eth0 -j DROP
iptables -I POSTROUTING -t nat -p tcp –dport 593 -o eth0 -j DROP
iptables -I POSTROUTING -t nat -p udp –dport 593 -o eth0 -j DROP

iptables -I POSTROUTING -t nat -p tcp –dport 135:139 -o eth1 -j DROP
iptables -I POSTROUTING -t nat -p udp –dport 135:139 -o eth1 -j DROP
iptables -I POSTROUTING -t nat -p tcp –dport 445 -o eth1 -j DROP
iptables -I POSTROUTING -t nat -p udp –dport 445 -o eth1 -j DROP
iptables -I POSTROUTING -t nat -p tcp –dport 593 -o eth1 -j DROP
iptables -I POSTROUTING -t nat -p udp –dport 593 -o eth1 -j DROP

If you have a better linux firewall script to prevent internet slowdown because of virus, just share it here, thanks!

Posted via email from “Made in Twenty”

Photoshop CS4 tips : Crop with fixed size.

Posted by: Moses Kurniawan on: January 23, 2010

Well, I am being asked by my friend how to crop an image from 640×480 to 320×240 with fixed size, mean, after you click Crop tool, you will get the crop tool already set the crop area to 320×240 pixel so you just choosing which area will be cropped.

As I am remember, Crop tool has an option on the toolbar above, tell them to my friend but she said nothing there. After I re-check, yeah, the menu is not there! The menu I mean is "Normal" and "Fixed". I thought this menu is available at older versions of photoshop (7, CS, etc) because I was using them. Okay, lets go to do the crop.

Apparently the Fixed Crop is moved to Marquee. Here is how :

  1. Select Marquee tool.
  2. On the toolbar above, select "Fixed Size" on the Style drop-down menu.
  3. Input your desired size.
  4. Then with marquee tool, click on the image. It should make a selection right now.
  5. Click menu Image > Crop.
  6. You're done !

Simple, right?

Posted via email from “Made in Twenty”

After messed up with "The following signatures couldn't be verified because the public key is not available", Google bring me here:

http://www.linux.com/community/blogs/Debian-Upgrading-to-Lenny-ERROR-no-public-key-available-for-the-following….html

Ok, lets to the point.

I am using Debian and I want to add software repository for my Debian box. Then I am edit the sources.list and adding mirror from Indika (Indonesia) :

deb http://debian.indika.net.id/debian lenny main non-free contrib
deb http://debian.indika.net.id/debian-security lenny/updates main non-free contrib

(its actually 4 lines but I am using only 2 above lines because the 2 others are not working, dunno why, lazy enough for troubleshooting).

Saving the sources.list, then I am run apt-get update. Then I got the following errors on the end of line :

W: GPG error: http://repo.ugm.ac.id lenny Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9AA38DCD55BE302B NO_PUBKEY 4D270D06F42584E6
W: GPG error: http://repo.ugm.ac.id lenny/updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9AA38DCD55BE302B
W: GPG error: http://repo.ugm.ac.id stable-proposed-updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9AA38DCD55BE302B

LETS GO TO THE SOLUTION !

Copy or write down the numbers and letters (9AA38DCD55BE302B at my case, from the above error).

Run this command :

gpg –keyserver wwwkeys.eu.pgp.net –recv-keys 9AA38DCD55BE302B

Please change the 9AA38DCD55BE302B based on your error message.

Then you will see the following messages :

gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: requesting key 55BE302B from hkp server wwwkeys.eu.pgp.net
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 55BE302B: public key "Debian Archive Automatic Signing Key (5.0/lenny) <ftpmaster@debian.org>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

You will have a file called pubring.gpg. This is contains the GPG key for the repo.

Then run this command :

apt-key add .gnupg/pubring.gpg

If success, you will just see the message "OK".

Then try apt-get update again.

It must be works.

Posted via email from “Made in Twenty”

A VERY SIMPLE Ubuntu Router tutorial

Posted by: Moses Kurniawan on: January 10, 2010

Mau buat PC router yang dipakai untuk sharing internet di rumah atau di kantor kecil anda? Mudah sekali.
Persyaratan :
Komputer memiliki 2 ethernet, spesifikasi nggak perlu gede-gede amat, Pentium 3 RAM 128 HDD 10GB juga dah cukup.
Hal yang harus dilakukan :
1. Install sistem operasi Ubuntu/Debian atau apapun yang berbasis debian (disini saya menggunakan Ubuntu Karmic Server)
2. Ditengah jalan anda akan ditanya untuk memilih manakah ethernet card yang akan digunakan untuk koneksi ke internet. Disini saya memilih eth0. Untuk mengetahui manakah yang eth0/eth1, bisa dilihat bahwa disampingnya dituliskan merek ethernet card tersebut. Pastikan ketika anda telah memilih primary ethernet, ethernet tersebut adalah ethernet yang terhubung ke internet.
Lanjutkan dan jangan lupa pilih DNS server ketika instalasi.
3. Setelah instalasi selesai, masukkan IP address dengan mengedit file /etc/network/interfaces dengan mengetikkan perintah
sudo nano /etc/network/interfaces

4. Disini saya menggunakan setting bahwa eth0 saya menggunakan DHCP, dan eth1 diberikan IP static, maka tampak settingan saya seperti dibawah ini

auto eth0

iface eth0 inet dhcp

auto eth1

iface eth1 inet static

address 192.168.0.1

netmask 255.255.255.0

5. Simpan file tersebut dengan menekan Ctrl+O di keyboard. Setelah selesai, keluar dari program dengan menekan Ctrl+X di keyboard.
6. Setelah itu restart konfigurasi network anda dengan mengetikkan perintah :

sudo /etc/init.d/network restart

7. Pastikan tidak ada yang FAIL, alias semuanya OK.
8. Untuk mengecek apakah kedua ethernet sudah memiliki IP, ketikkan perintah :

ifconfig

9. Coba liat ke bagian eth0 dan eth1 anda. eth0 biasanya memiliki IP address yang berbeda tergantung ISP anda. Dan untuk eth1 sudah pasti harusnya 192.168.0.1 karena tadi kita memasukkan IP tersebut untuk eth1 di file /etc/network/interfaces. Sekarang kita akan melakukan IP forwarding.
10. Edit file /proc/sys/net/ipv4/ip_forward dengan perintah :

sudo nano /proc/sys/net/ipv4/ip_forward

lalu edit angka 0 didalamnya menjadi 1.
11. Setelah itu save dengan menekan Ctrl+O. Setelah save, exit dengan menekan Ctrl+X.
12. Setelah itu edit file /etc/sysctl.conf dengan mengetikkan perintah:

sudo nano /etc/sysctl.conf

Cari line yang mengandung tulisan :

#net.ipv4.ip_forward = 1

Ubah menjadi

net.ipv4.ip_forward = 1

Itu hanya dihilangkan # nya saja sih.
Apabila line itu tidak ditemukan, tambah saja secara manual.
13. Setelah itu save dan exit (caranya sudah dijelaskan sebelumnya).
14. Setelah itu eksekusi perintah :

sudo iptables -t nat -A POSTROUTING -j MASQUERADE

15. Perintah diatas harus ditulis persis huruf besar dan kecilnya.
16. Karena perintah iptables tadi tidak akan berjalan setelah router direstart, edit file /etc/rc.local :

sudo nano /etc/rc.local

17. Masukkan "iptables -t nat -A POSTROUTING -j MASQUERADE" (tanpa tanda kutip) ke dalam file tersebut, sebelum line "exit 0".
18. Save dan exit.
19. Apabila perlu, restart router anda dengan mengetikkan

sudo reboot

20. Sambil menunggu router anda kembali up, lakukan konfigurasi kepada semua komputer klien sesuai dengan dibawah ini:

IP address : 192.168.0.* (* bisa berapa saja, 2-255, karena 1 sudah terpakai untuk router)

Subnet Mask : 255.255.255.0

DNS : 192.168.0.1

21. Setelah itu lakukan uji coba browsing/ping dari komputer client (pastikan routernya sudah up duluan)

Sekian tutorial yang tujuan sebetulnya singkat tapi nulisnya panjang :D
Mungkin di tutorial berikutnya saya akan menambahkan DHCP server atau mungkin bandwidth management menggunakan HTB. Tapi nanti ya. Hehe.

Moses Kurniawan

Posted via email from “Made in Twenty”