Thursday, January 24, 2008
Adding new Library PATH
error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory
then i just add the library of postgres to /etc/ld.so.conf
include ld.so.conf.d/*.conf
/u01/postgres/postgresql/8.2.0/lib
Then I run :
/sbin/ldconfig
Thats it.
Friday, January 11, 2008
Install Java di ubuntu
Download java di, java.sun.com dalam bentuk bin.
http://java.sun.com/javase/downloads/index_jdk5.jsp
root>apt-get install fakeroot
root>apt-get install java-pakage
Kemudian "di sulap" jadi .deb dengan perintah (tidak boleh root):
userbiasa> fakeroot make-jpkg jre-1_5_0_12-linux-i586.bin
setelah semua proses selesai dengan menerima aggrementnya. maka akan di buat pakage debian. sun-j2re1.5_1.5.0+update12_i386.deb
userbiasa>su -l #untuk login ke root(install paketnya)
root>dpkg -i sun-j2re1.5_1.5.0+update12_i386.deb
root>java -version
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)
Selesai.
Tuesday, January 8, 2008
Recover Data From a dead hard drive using ddrescue
Recover Data From a dead hard drive using ddrescue
dd_rescue Advantages
Imagine, one of your partitions is crashed, and as there are some hard errors, you don’t want to write to this hard disk any more. Just getting all the data off it and retiring it seems to be suitable. However, you can’t access the files, as the file system is damaged.
Now, you want to copy the whole partition into a file. You burn it on CD-Rom, just to never lose it again. You can setup a loop device, and repair (fsck) it and hopefully are able to mount it.
Copying this partition with normal Un*x tools like cat or dd will fail, as those tools abort on error. dd_rescue instead will try to read and if it fails, it will go on with the next sectors. The output file naturally will have holes in it, of course. You can write a log file, to see, where all these errors are located.
The data rate drops very low, when errors are encountered. If you interrupt the process of copying, you don’t lose anything. You can just continue at any position later. The output file will just be filled in further and not truncated as with other Un*x tools.
If you have one spot of bad sectors within the partition, it might be a good idea, to approach this spot from both sides. Reverse direction copy is your friend.
The two block sizes are a performance optimization. Large block sizes result in superior performance, but in case of errors, you want to try to salvage every single sector. So hardbs is best be set to the hardware sector size (most often 512 bytes) and softbs to a large value, such as the default 16k.
Install dd_rescue in Debian
Install ddrescue using the following command
#apt-get install ddrescue
Install ddrescue in Ubuntu
sudo apt-get install ddrescue
This will complete the installation
ddrescue Syntax
dd_rescue [options] infile outfile
Now we will see how to use ddrescue under damaged disk
If you have a damaged hard disk /dev/sda1 and you have an empty space hard disk /dev/sda2 Now if you want to copy data from /dev/sda1 to /dev/sda2 use the following commnd
# dd_rescue /dev/sda1 /dev/sda2/backup.img
If you are using ubuntu linux use the following command
sudo dd_rescue /dev/sda1 /dev/sda2/backup.img
This copies an image of /dev/sda1 to sda2
Now you need to check the backup image consistency this will check for is there any problems with this image.
#fsck -y /dev/sda2/backup.img
If you are using ubuntu linux use the following command
sudo fsck -y /dev/sda2/backup.img
After finishing this checking you need to mount your disk image in to your other hard disk
#mount /dev/sda2/backup.img /mnt/recoverydata
If you are using ubuntu linux use the following command
sudo mount /dev/sda2/backup.img /mnt/recoverydata
This will mount all the data from the backup.img under /mnt/recoverydata now you can try to access the data it should work without any problem.
Restore image
If you want to restore this image use the following command
#dd_rescue /dev/sda2/backup.img /dev/sda1
If you are using ubuntu linux use the following command
sudo dd_rescue /dev/sda2/backup.img /dev/sda1
Copy Disk Image to remote machine using SSH
If you want to copy your disk image to remote machine over ssh you need to use the following command
#dd_rescue /dev/sda1 - | ssh username@machineip ‘cat /datarecovery/backup.img’
If you are using ubuntu linux use the following command
sudo dd_rescue /dev/sda1 - | ssh username@machineip ‘cat /datarecovery/backup.img’
This will be prompetd for password of the username you have menctioned in the above command after entering the password dd_rescue strats copying obviously it will take some time to copy over the network.
Possible Error
If you see the following error at the time of copying you can ignore this error
dd_rescue: (warning): output file is not seekable!
dd_rescue: (warning): Illegal seek
If you want to take this image in compressed format you can use the following command format
#tar zcvf - /dev/sda1 | ssh username@machineip ‘cat@@>/tmp /datarecovery/backup.tar.gz’
If you are using ubuntu linux use the following command
sudo tar zcvf - /dev/sda1 | ssh username@machineip ‘cat@@>/tmp /datarecovery/backup.tar.gz’
If you want to know more available options check dd_rescue man page
Monday, December 31, 2007
Wednesday, December 19, 2007
Error di FDS server 1.0.4
[18/Dec/2007:09:59:15 +0700] - SSL alert: Security Initialization:Saya create cert lagi masih tidak bisa.
NSS
initialization failed (Netscape Portable Runtime error -8174 -
security library: bad database.): path: /home/FDS/alias/, certdb
prefix: slapd-prc-, keydb prefix: slapd-prc-.
[18/Dec/2007:09:59:15 +0700] - ERROR: NSS Initialization Failed.
certutil -N -d . -P slapd-prc- -f /tmp/pwd.txt
Setelah itu saya tanya di milis FDS.
ls -al /home/FDS/alias
grep localuser /home/FDS/slapd-prc/config/dse.ldif
kunci jawabannya di atas. Setalah di ketahui ownernya.
Ternyata saya membuat kesalahan dengan merubah user dari nobody ke root.
Friday, November 23, 2007
Using umask
The umask command can be used to determine the default file creation mode on your system. It is the octal complement of the desired file mode. If files are created without any regard to their permissions settings, a user could inadvertently give read or write permission to someone that should not have this permission.
The umask for the creation of new executable files is calculated as follows:
777 Default Permissions
-022 Subtract umask value, for example
-----
755 Allowed Permissions
So in this example we chose 022 as our umask. This shows us that new executables that are created are given mode 755, which means that the owner can read, write, and execute the binary, while members of the group to which the binary belongs, and all others, can only read and execute it.
The umask for the creation of new text files is calculated as follows:
666 Default Permissions
-022 Subtract umask mask, for example
-----
644 Allowed Permissions
This example shows us that given the default umask of 666, and subtracting our sample umask value of 022, new text files are created with mode 644, which states that the owner can read and write the file, while members of the group to which the file belongs, and everyone else can only read the new file. Typically umask settings include 022, 027, and 077, which is the most restrictive. Normally the umask is set in /etc/profile, so it applies to all users on the system. The file creation mask must be set while keeping in mind the purpose of the account. Permissions that are too restrictive may cause users to start sharing accounts or passwords, or otherwise compromise security. For example, you may have a line that looks like this:
# Set the user's default umask
umask 033
Be sure to make root's umask to at least 022, which will disable write and execute permission for other users, unless explicitly changed using chmod(1).
If you are using Red Hat Linux, and adhered to their user and group ID creation scheme (User Private Groups), it is only necessary to use 002 for a umask with normal users. This is due to the fact that the default configuration is one user per group.
In addition to setting the user's default umask, you should be sure you are aware of the umask value that is set in startup scripts as well. Any files that are created during the boot process may be created with the default umask of 666 if it is not explictly specified.
Additionally, any servers that are started at boot time, such as inetd(8), may inherit the umask at boot time, which in turn will be passed down to the services, and servers, that it controls.
The umask value that the FTP server, spawned by inetd(8) uses, for example, can be easily overlooked, allowing the potential for too lenient permissions on files.
In this specific example, the FTP server has command-line options for controlling umask values. Many do not, however. For this reason, you might consider creating a file that gets run at system boot time, before any others, that simply explictly sets the umask to a known value.
Monday, June 25, 2007
Tanpa Pancasila, Indonesia Sudah Alami "Balkanisasi"
"Indonesia masih satu pasca 1997. Ini sesuatu hal yang membahagiakan. Padahal, analisis dunia waktu itu, akan terjadi 'Balkaisasi'. Kita diuntungkan oleh adanya nilai-nilai kebangsaan yang ada di dalam ideologi Pancasila 1 Juni 1945 galian Bung Karno," ungkap pengamat politik LIPI, Prof Dr Ikra Nusa Bhakti, di Jakarta, Rabu (6/6) malam, dalam diskusi memperingati Hari Lahir Bung Karno dan perayaan 62 tahun Hari Lahir Pancasila 1 Juni 1945.
Dia berbicara itu ketika tampil bersama Dr J Kristiadi (CSIS), Direktur Eksekutif Sugeng Sarjadi Syndicate (SSS), Dr Sukardi Rinakit dan Ketua Dewan Pertimbangan Organisasi (DPO) Presidium Persatuan Alumni (PPA) Gerakan Mahasiswa Nasional Indonesia (GMNI), Dr Ir Siswono Yudohusodo selaku pembawa "keynote speaker".
"Saya tetap meyakini, kekuatan Pancasila sebagai ideologi nasional Indonesia itu, karena penggalinya mampu menggabungkan nilai-nilai luhur bangsa ini, juga nilai-nilai universal lainnya, menjadi sebuah kekuatan dahsyat yang membuat bangsa ini tetap kokoh, kendati diterpa badai-badai dahsyat," kata Ikra Nusa Bhakti.
NKRI, menurutnya, didirikan dan dibangun oleh banyak kekuatan, yang terpola dalam kubu "ko" dan "non ko-operasi".
"Itu juga yang terjadi dari waktu ke waktu, hingga kejadian insiden interpelasi DPR RI versus Presiden Susilo Bambang Yudhoyono kemarin. Kemampuan Bung Karno untuk mensinergikan kekuatan "ko" dan "non ko" itulah sebenarnya yang harus bisa dimainkan saat ini. "Beranteman" melulu tak akan membuat kita maju," tandasnya.
Di bagian lain, Ikra Nusa Bhakti menyorot kritis tentang pola penyeragaman ide dan gagasan serta implementasi, sebagaimana pernah jadi jargon di era Orde Baru, yang membunuh kreativitas serta jati diri bangsa besar ini.
"Saya tetap percaya kepada ajaran Bung Karno, bahwa kemajemukan itu memperindah taman sari Indonesia," tegas Ikra Nusa Bhakti. (*)
Wednesday, June 13, 2007
Kena tilang polisi
Saya mengendarai motor.
Saat melintasi jalan Mayjen Sungkono,surabaya, tiba-tiba dua orang polisi menyetop saya.
Dalam hati saya bertanya ... saya salah apa?
Oh.. ternyata lampu saya tidak nyala, padahal saya tidak pernah mematikan lampu motor walaupun pada siang hari(anjuran nya seperti itu).
Ternyata kemungkinan goncangan sehingga switchnya tersenggol.
Setelah di minta surat-surat, SIM dan STNK, pak polisi seperti biasa menunjukan pasal pelanggarannya. Melanggar pasar 73(1) PP43(maaf klo salah tulisannya gak jelas).
Kira2 bunyinya ".. Tidak menyalakan lampu utama dan lampu belakang pada malam hari .."
Yah, saya akuin memang pada saat di tangkap kondisi lampu memang mati.
Saya berusaha membela diri, pak, coba itu lampu di pegang, masih panas, dan hi/low beam semuanya nyala. Artinya memang bukan kesengajaan, bisa jadi karena goncangan.
Tapi pak polisinya tetep kekeh, tetap gak bisa mas. kata dia.
Baik deh, saya memang salah pak. Kalau gitu saya mau pakai uang titipan, setahu saya undang-undangnya membolehkan. jadi tidak harus datang sidang. dan kita dapatkan yang lembar biru.
Polisi hanya bilang wah gak bisa mas,sambil lenggang kangkung.
Ya sudah.
Saya kantongi surat tilang yang lembar merah, tanggal 25 Juni 2007 sidang.
Sebenarnya dalam hati ada keinginan "damai",Tapi hati kecil ini rasanya menolak. Walaupun dongkol juga. Dalam hati kecil, ah bapak juga pasti pernah tuh menerima uang "damai" tapi biarlah urusan dia dengan Tuhannya, toh juga pelanggarannya tidak berat, yah dengan pembelaan diri seperti tabung lampu sebenarnya masih panas, semua lampu nyala, spion saya pasang kanan kiri, yah walaupun tidak 100% taat peraturan lalulintas, namun saya rasanya risih kalau misal lampu merah harus melanggar, walaupun di samping kiri kanan sepi, misal pada malam hari.
Bahkan pernah saya di tabrak dari belakang gara-gara saya berhenti tepat pada saat lampu berganti merah. Malah saya yang di klakson-klakson, di pelototin. Untung saja kecepatan yang menabrak saya tidak terlalu kencang. Dengan tanpa bersalah, dia malah melanggar lampu merah, jalan terus. Kadang di mana keadilan di negara ini. Sedih rasanya.
Saat saya ke singapore, warganya bisa dikatakan tertib dalam berlalulintas, toleransi malah lebih tinggi dari pada di negeri ini. Mereka sangat menghormati pejalan kali. Justru penyeberang jalan di utamakan.
Bahkan ada yang bilang "Di sebagian negara masyarakatnya bahkan lebih PANCASILA-is dari pada masyarakat yang Indonesia"
Adding new Hardisk On linux
#hdparm /dev/sda
#mke2fs -j /dev/sda1
edit the fstab in etc
add the following line to fstab
/dev/sda1 /DATA ext3 rw,acl 0 0
note: i need the ACL so i add the function in this directory
make directory
#mkdir /DATA
then mount the DATA directory
#mount /DATA
[root@brain ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 9.5G 2.6G 6.5G 29% /
tmpfs 371M 0 371M 0% /dev/shm
/dev/hda2 9.5G 537M 8.5G 6% /home
/dev/hda5 16G 172M 15G 2% /rhome
/dev/sda1 147G 2.4G 137G 2% /DATA
[root@brain ~]#
note :
#e2label /dev/hdd /newlabel
#mount -o remount,rw /
Friday, April 13, 2007
Multiple Link Internet
Server saya pakai Linux kernel 2.6.18.
Saya pakai 3 NIC.
1 NIC untuk jaringan local, 2 NIC untuk ke modem ADSL.
Dengan mengkonfigurasikan ip route, dan iptablesnya.
ip route add default equalize scope global nexthop via 192.168.100.13 dev eth2 weight 1 nexthop via 192.168.100.14 dev eth1 weight 1