Solusi Backup Linux [2] September 7, 2009
Posted by setijoagus in Linux.Tags: Backup, rdiff-backup
add a comment
B. Mengenal rdiff-backup
A remote incremental backup of all your files could be as easy as “rdiff-backup / host.net::/target-dir”
‘rdiff-backup backs up one directory to another, possibly over a network. The target directory ends up a copy of the source directory, but extra reverse diffs are stored in a special subdirectory of that target directory, so you can still recover files lost some time ago. The idea is to combine the best features of a mirror and an incremental backup. rdiff-backup also preserves subdirectories, hard links, dev files, permissions, uid/gid ownership, modification times, extended attributes, acls, and resource forks. Also, rdiff-backup can operate in a bandwidth efficient manner over a pipe, like rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up to a remote location, and only the differences will be transmitted. Finally, rdiff-backup is easy to use and settings have sensical defaults.’
mulai menggunakan
1. download [saya menggunakan centos 4.7]
ftp://fr.rpmfind.net/linux/dag/redhat/el4/en/i386/dag/RPMS/rdiff-backup-1.2.8-1.el4.rf.i386.rpm
2. install
[root@linux ~]# rpm -ivh rdiff-backup-1.2.8-1.el4.rf.i386.rpm
warning: rdiff-backup-1.2.8-1.el4.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing… ########################################### [100%]
1:rdiff-backup ########################################### [100%]
3. perintah – perintah rdiff-backup
==========================================================
3a. untuk backup : /usr/bin/rdiff-backup [yang_dibackup] [lokasi_backup]
==========================================================
[root@linux s11]# ls -la /s11/foto_logistik/*.txt
-rw-r–r– 1 root foto_logistik 11 Sep 2 13:43 /s11/foto_logistik/test.txt
[root@linux s11]# /usr/bin/rdiff-backup /s11/ /backup/s11
==========================================================
3b. untuk list backup : /usr/bin/rdiff-backup -l [lokasi_backup]
==========================================================
[root@linux /]# /usr/bin/rdiff-backup -l /backup/s11/
Found 4 increments:
increments.2009-09-02T13:14:11+07:00.dir Wed Sep 2 13:14:11 2009
increments.2009-09-02T13:28:06+07:00.dir Wed Sep 2 13:28:06 2009
increments.2009-09-02T13:44:04+07:00.dir Wed Sep 2 13:44:04 2009
increments.2009-09-02T13:51:29+07:00.dir Wed Sep 2 13:51:29 2009
Current mirror: Wed Sep 2 14:30:02 2009
==========================================================
3c. untuk restore : /usr/bin/rdiff-backup -r now [lokasi_backup] [lokasi_restore]
==========================================================
[root@linux s11]# /usr/bin/rdiff-backup -r now /backup/s11/foto_logistik/test.txt /s11/foto_logistik/test.txt
[root@linux s11]# /usr/bin/rdiff-backup -r now /backup/s11/foto_logistik/test.txt /s11/foto_logistik/test2.txt
[root@linux s11]# ls -la /s11/foto_logistik/*.txt
-rw-r–r– 1 root foto_logistik 11 Sep 2 13:43 /s11/foto_logistik/test2.txt
-rw-r–r– 1 root foto_logistik 11 Sep 2 13:43 /s11/foto_logistik/test.txt
==========================================================
3d. untuk restore : /usr/bin/rdiff-backup -r [jam tertentu] [lokasi_backup] [lokasi_restore]
==========================================================
[root@linux /]# rdiff-backup -r 2009-09-02T13:44:04+07:00 /backup/s11/foto_logistik/test.txt /s11/foto_logistik/test3.txt
[root@linux /]# rdiff-backup -r 2009-09-02T13:51:29+07:00 /backup/s11/foto_logistik/test.txt /s11/foto_logistik/test4.txt
[root@linux /]# rdiff-backup -r now /backup/s11/foto_logistik/test.txt /s11/foto_logistik/test5.txt
==========================================================
3e. hapus archive
==========================================================
[root@linux s11]# /usr/bin/rdiff-backup –remove-older-than 3D /backup/s11
Solusi Backup Linux [1] September 7, 2009
Posted by setijoagus in Linux.Tags: Backup, rdiff-backup, tar
add a comment
A. Awal Mula
Dulu saya melakukan backup di linux menggunakan tar, dimana saya buatkan script seperti berikut :
=============================================================
script backup tar
=============================================================
# .bash_profile
cd /backup
b_name=`date +%w`
if [ "$b_name" = 1 -o "$b_name" = 4 ]
then
tar cvzf /backup/ac/01snkm_acumum.tgz /s03/ac/umum -X no_file > logac_umum.txt
elif [ "$b_name" = 2 -o "$b_name" = 5 ]
then
tar cvzf /backup/ac/02sljm_acumum.tgz /s03/ac/umum -X no_file > logac_umum.txt
elif [ "$b_name" = 3 -o "$b_name" = 6 ]
then
tar cvzf /backup/ac/03rbst_acumum.tgz /s03/ac/umum -X no_file > logac_umum.txt
elif [ "$b_name" = 0 ]
then
tar cvzf /backup/ac/04mg_acumum.tgz /s03/ac/umum -X no_file > logac_umum.txt
fi
artinya dalam 1 minggu saya memiliki file :
/backup/ac/01snkm_acumum.tgz
/backup/ac/02sljm_acumum.tgz
/backup/ac/03rbst_acumum.tgz
/backup/ac/04mg_acumum.tgz
1. Cara ini sudah lama saya gunakan dan saya nyaman, untuk restore dengan menggunakan ‘mc’, saya bisa pilih file yang hanya akan direstore.
2. Sejalan dengan waktu hasil ‘tar’ menjadi semakin besar cara restore dengan menggunakan ‘mc’, menjadi tidak bisa, terpaksa dech ……..
3. Menggunakan cara ‘tar xvf’, kemudian baru direstore file yang rusak/diinginkan/hilang
4. waktu terus berlalu, file hasil ‘tar’ semakin membesar, pada saat ,menjalankan ‘tar xvf’, timbul error
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
5. Tapi hal ini masih dapat diatasi dengan menggunakan ‘gzip -d’ baru kemudian ‘tar -xvf’ “thank’s to Jesus”
6. 3 bulan terakhir ada Komplain, pada saat schedulle backup berjalan [8 malam s/d 5 pagi], akses jadi lambat, bahkan backup masih berjalan sampai dengan jam 8 pagi baru selesai [serasa nggak ada jalan keluar]
Advance Replication Server Down ? Agustus 27, 2009
Posted by setijoagus in Linux, REPLICATION, oracle.Tags: server down
add a comment
Apa yang terjadi jika Advance Replikasi, yang menghubungkan kantor pusat [sid = orcl1] dengan kantor cabang [sid = orcl2] salah satu servernya Down ? berikut demonya.
a. dimana server kantor cabang [sid = orcl2] down

b. server kantor pusat [sid = orcl1] up dan sedang melakukan transaksi [insert data]
SQL> conn scott/tiger@orcl1
SQL> insert into dept values (51,’dept’,'dept’,systimestamp);
SQL> insert into dept values (52,’dept’,'dept’,systimestamp);
SQL> insert into dept values (53,’dept’,'dept’,systimestamp);
SQL> insert into dept values (54,’dept’,'dept’,systimestamp);
SQL> insert into dept values (55,’dept’,'dept’,systimestamp);
SQL> commit;

c. beberapa saat kemudian server kantor cabang [sid = orcl2] up kembali

d. jreng – jreng ……

Membuat IVR (interactive voice responses) di Asterisk Agustus 26, 2009
Posted by setijoagus in Linux, voip.Tags: asterisk, audacity, ivr, Linux, sox
add a comment
1. merekam suara IVR dengan menggunakan software pengolah suara, misalnya : audacity
download audacity http://audacity.sourceforge.net/download/
misal suaranya berbunyi :
“selamat datang di layanan voip UBS, tekan nomer extention yang anda inginkan atau
tekan 9002 untuk mengetahui jam saat ini
tekan 9003 untuk mendengarkan lagu yogya
tekan 9004 untuk bantuan operator
tekan 9005 untuk Cabang A
tekan 9006 untuk Cabang B “
2. simpan dalam format .wav (dalam contoh ivr.wav)
3. lakukan konversi suara ke format .gsm (dalam contoh ivr.gsm), dengan menggunakan software sox [saya menggunakan yang versi linux]
a. download software sox
http://sourceforge.net/projects/sox/files/sox/14.3.0/sox-14.3.0.tar.gz/download
b. configure
# cd /usr/local/src/
# tar xvzf sox-14.3.0.tar.gz
# cd sox-14.3.0
# ./configure
c.lakukan konversi
# sox ivr.wav -r 8000 -c1 ivr.gsm resample -ql
d. untuk convert sekumpulan mp3 ke gsm
# vi mp32gsm
for I in $(ls -1 *.mp3)
do
NAME=$I
echo “Converting from mp3.wav”
mpg123 -w “$NAME.wav” “$NAME”
echo “Converting from wav to gsm”
sox -t wav “$NAME.wav” -r 8000 -c1 -t gsm “$NAME.gsm” resample -ql
echo “output filename: $NAME.gsm”
done
# chmod a+x mp32gsm
# ./mp32gsm
4. hasil konversi disimpan ke /var/lib/asterisk/sounds
# cp ivr01.gsm /var/lib/asterisk/sounds/
ASTERISK
5. melakukan konfigurasi extension.conf
# vi /etc/asterisk/extensions.conf
;————————–
; ivr
;————————–
Exten => 001,1,Answer()
Exten => 001,2,Background(ivr)
exten => 001,3,Background(silence/3)
exten => 001,4,Goto(2)
artinya :
baris 1 : jika ada user mendial 001 maka prioritas pertama adalah dijawab
baris 2 : jika tidak dijawab akan ada suara rekaman ‘ivr’ kita yang bunyinya seperti diatas
baris 3 : silence selama 3 dial tone
baris 4 : ulangi ke baris 2
6. reload asterisk
# asterisk -vvvr
linux*CLI> reload
linux*CLI> exit
A. ASTERISK & SPA-400 [Mengenal SPA-400] Agustus 25, 2009
Posted by setijoagus in Linux, voip.Tags: asterisk, Linux, spa400
add a comment
SPA400 memiliki 4 standard analog telephones lines FXO
SPA400 biasanya digunakan bersamaan dengan SPA9000 detail http://www.retrevo.com/s/Linksys-SPA400-review-manual/id/420ci955/t/1-2/




C. ASTERISK & SPA-400 [Setup asterisk] Agustus 25, 2009
Posted by setijoagus in Linux, Network, voip.Tags: asterisk, spa 400
add a comment
5. membuat user di /etc/asterisk/sip.conf
[root@linux ~]# vi /etc/asterisk/sip.conf
[general]
register= spa400@172.20.140.142/spa400
[spa400]
type=friend
user=spa400
host=172.20.140.142
dtmfmode=rfc2833
canreinvite=no
context=from-trunk
insecure=very
6. membuat extentions di /etc/asterisk/extensions.conf
[root@linux ~]# vi /etc/asterisk/extensions.conf
;——————————————————————-
; dari sip ke pstn UBS [spa400]
; contoh 888160, artinya dari sip akan dial ke pabx no telpon 160
;——————————————————————-
exten => _888X.,1,Dial(SIP/${EXTEN:3}@spa400,30,rt)
;——————————————————————-
; dari pstn ke sip [spa400]
; contoh semisal extention pabx / FXO : 160 didial maka,
; artinya dari pstn akan dial ke sip no ext 001
;——————————————————————-
[from-pstn-custom]
exten=>spa400,1,Goto(voipubs,001,1)
B. ASTERISK & SPA-400 [Setup SPA-400] Agustus 25, 2009
Posted by setijoagus in Linux, Network, voip.Tags: asterisk, spa 400
add a comment
1. menentukan IP SPA-400
Pada saat pembelian pertama dari pabrik IP SPA-400, diset DHCP, sehingga untuk melakukan setting lewat browser akan kesulitan [sebab khan nggak tahu IPnya].
Untuk itu perlu tool, salah satunya menggunakan angry IP scanner (http://www.angryziber.com), yang digunakan untuk scan IP SPA-400 dengan port 5060.
2. difinisikan SPA-400 lewat browser
Default username = Admin (capital A)
Default password = blank
3. Setup -> Basic Setup
• pilih Fixed IP address & isi fixed IP address : 172.20.140.142
• DNS server : 172.20.140.33
• Set time zone :
• Click Save Settings
• Restart System
4. Setup->SPA9000 Interface.
• User ID : spa400 [user yang disetup di /etc/asterisk/sip.conf]
• static Address : 172.20.140.33
• Port : 5060
• Port ID 1 : PortID1
• Port ID 2 : PortID2
• Port ID 3 : PortID3
• Port ID 4 : PortID4
• Click Save Settings




VIRTUAL PRIVATE NETWORK dengan Open VPN (server login with password) Agustus 21, 2009
Posted by setijoagus in Linux, Network.Tags: Network, openvpn
add a comment
VPN user & password
25. Agar VPN menanyakan user dan password
a. Tambahkan pada server
[root@router easy-rsa]# vi /etc/openvpn/server.conf
##############################################################
# server openvpn
##############################################################plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so login
client-cert-not-required
username-as-common-name
b. Tambahkan pada client
[root@iscatm2 easy-rsa]# vim /etc/openvpn/client.conf
auth-user-pass
1. VIRTUAL PRIVATE NETWORK dengan Open VPN (pendahuluan)
2. VIRTUAL PRIVATE NETWORK dengan Open VPN (server)
3. VIRTUAL PRIVATE NETWORK dengan Open VPN (client linux)
4. VIRTUAL PRIVATE NETWORK dengan Open VPN (client windows)
5. VIRTUAL PRIVATE NETWORK dengan Open VPN (server login with password)
VIRTUAL PRIVATE NETWORK dengan Open VPN (client windows) Agustus 21, 2009
Posted by setijoagus in Linux, Network.Tags: Linux, Network, vpn. open vpn
add a comment
VPN CLIENT WINDOWS
14. Double Klik openvpn-x.x.x-install.exe.
15. Klik tombol Next >, Klik tombol I Agree.
16. Klik tombol Next >, Klik tombol Install.
17. Setelah beberapa saat, akan muncul, pop-up window peringatan sebagai berikut, Klik tombol Continue Anyway.
18. Klik tombol Next > , Klik tombol Finish.
19. Di tray sudut kanan bawah akan muncul ikon sbb :
20. Untuk konek ke Openvpn server, yang diatur pertama-tama file client.ovpn, yang dapat dicopy dari directory C:\Program Files\OpenVPN\sampel-config\ ke direktori C:\Program Files\OpenVPN\config.
21. Setelah itu klik kanan pada tray ikon OpenVPN GUI, pilih Edit Config.
############################################################################
# client openvpn
#
############################################################################
client
dev tun
proto tcp
remote 202.43.252.1 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert myclient1.crt
key myclient1.key
comp-lzo
verb 3
22. Copykan juga file – file yang dibutuhkan hasil generate dari server openvpn : ca.crt, myclient1.crt, myclient1.key
23. Connect ke internet terlebih dahulu, bisa menggunakan dial up dan broadband
24. Setelah terkoneksi ke internet, klik kanan pada OpenVPN GUI dan Klik Connect.
1. VIRTUAL PRIVATE NETWORK dengan Open VPN (pendahuluan)
2. VIRTUAL PRIVATE NETWORK dengan Open VPN (server)
3. VIRTUAL PRIVATE NETWORK dengan Open VPN (client linux)
4. VIRTUAL PRIVATE NETWORK dengan Open VPN (client windows)
5. VIRTUAL PRIVATE NETWORK dengan Open VPN (server login with password)
VIRTUAL PRIVATE NETWORK dengan Open VPN (client linux) Agustus 21, 2009
Posted by setijoagus in Linux, Network.Tags: Network, openvpn
add a comment
VPN CLIENT LINUX
11. install rpm yang dibutuhkan
http://dag.wieers.com/rpm/packages/lzo2/
[root@router test]# rpm -Uvh lzo2-2.02-3.el4.rf.i386.rpm lzo2-devel-2.02-3.el4.rf.i386.rpm
warning: lzo2-2.02-3.el4.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing… ########################################### [100%]
1:lzo2 ########################################### [ 50%]
2:lzo2-devel ########################################### [100%]
http://dag.wieers.com/rpm/packages/openvpn/
[root@iscatm2 oracle]# rpm -Uvh openvpn-2.0.9-1.el5.rf.i386.rpm
warning: openvpn-2.0.9-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing… ########################################### [100%]
1:openvpn ########################################### [100%]
12. copy file /etc/openvpn/vars dari Server. Copy key client dari Server
[root@iscatm2 keys]# scp -r root@202.43.252.1:/etc/openvpn/easy-rsa/keys/ca.crt /etc/openvpn/easy-rsa/keys
root@202.43.252.1’s password:
ca.crt 100% 1261 1.2KB/s 00:00
[root@iscatm2 keys]# scp -r root@202.43.252.1:/etc/openvpn/easy-rsa/keys/myclient1.* /etc/openvpn/
root@202.43.252.1’s password:
myclient1.crt 100% 3569 3.5KB/s 00:00
myclient1.csr 100% 749 0.7KB/s 00:00
myclient1.key 100% 887 0.9KB/s 00:00
[root@iscatm2 keys]# touch /etc/openvpn/openvpn-status.log
[root@iscatm2 keys]# touch /etc/openvpn/openvpn.log
[root@iscatm2 keys]# chown nobody:nobody /etc/openvpn/openvpn-status.log
[root@iscatm2 keys]# chown nobody:nobody /etc/openvpn/openvpn.log
13. Konfigurasi OpenVPN client
[root@iscatm2 easy-rsa]# vim /etc/openvpn/client.conf
############################################################################
# client openvpn
#
############################################################################
client
dev tun
proto tcp
remote 202.43.252.1 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert myclient1.crt
key myclient1.key
comp-lzo
verb 3
1. VIRTUAL PRIVATE NETWORK dengan Open VPN (pendahuluan)
2. VIRTUAL PRIVATE NETWORK dengan Open VPN (server)
3. VIRTUAL PRIVATE NETWORK dengan Open VPN (client linux)
4. VIRTUAL PRIVATE NETWORK dengan Open VPN (client windows)
5. VIRTUAL PRIVATE NETWORK dengan Open VPN (server login with password)