Category Archives: Other

UPDATE IP DYNDNS USING CURL PHP


[root@DUREN3REPO ~]# vim no-ip.sh

#!/bin/bash
/usr/bin/links http://www.checkip.org/ | grep “Your IP Address:”|awk -F’:’ ‘{print $2}’ > /tmp/ip.txt
ip_address=`cat /tmp/ip.txt`
CDIR=`pwd`
/usr/bin/php ${CDIR}/update-ip.php $ip_address

[root@DUREN3REPO ~]# vim update-ip.php
<?php
$myip=trim($argv[1]);
$username = “gozigomilis@gmail.com”;
$password = “mypassword”;
//https://www.noip.com/members/dns/host.php?host_id=30961953
//https://www.noip.com/members/dns/
$url      = “https://dynupdate.no-ip.com/nic/update?hostname=mydomain.no-ip.info&myip=${myip}”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERPWD, “$username:$password”);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
print $output;
?>
Advertisements

PROXMOX , ACCESS VM FROM IP PUBLIC USING IPTABLE (NAT)


BEFORE

root@proxmox1:/etc/network# cat interfaces

# network interface settings
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address  192.168.137.104
netmask  255.255.255.0

iface eth1 inet manual

auto eth2
iface eth2 inet static
address  192.168.0.251
netmask  255.255.255.0

auto vmbr0
iface vmbr0 inet static
address  192.168.0.250
netmask  255.255.255.0
gateway  192.168.0.254
bridge_ports eth1
bridge_stp off

        bridge_fd 0
AFTER
root@proxmox1:/etc/network# cat interfaces

# network interface settings
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.137.104
netmask 255.255.255.0

iface eth1 inet manual

auto eth2
iface eth2 inet static
address 192.168.0.251
netmask 255.255.255.0

auto vmbr0
iface vmbr0 inet static
address 192.168.0.250
netmask 255.255.255.0
gateway 192.168.0.254
bridge_ports eth1
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/conf/eth1/proxy_arp  (Perhatikan baris ini yah!!)

auto vmbr1
iface vmbr1 inet static
address 192.168.37.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s ‘192.168.37.0/24’ -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s ‘192.168.37.0/24’ -o vmbr0 -j MASQUERADE

Restart Network

root@proxmox1:/etc/network# /etc/init.d/networking restart

Run on HOST

iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 2222 -j DNAT –to 192.168.37.2:22

iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 8888 -j DNAT –to 192.168.37.2:80

 

VM :
ifconfig eth0 192.168.37.2 netmask 255.255.255.0

route add default gw 192.168.37.1

Thanks

 

 

 

CENTOS 6.3 + rtorrent: symbol lookup error: rtorrent: undefined symbol: _ZN7torrent10ThreadBase8m_globalE


[root@localhost percona]# rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

[root@localhost percona]# yum install rtorrent

[root@localhost percona]# rpm -aq | grep rtorrent
rtorrent-0.8.9-2.el6.rf.x86_64

[root@localhost percona]# ls *.rpm

libsigc++20-2.2.4.2-1.el6.x86_64.rpm

libtorrent-0.13.2-1.el6.rf.x86_64.rpm

rtorrent-0.8.9-2.el6.rf.x86_64.rpm

DOWNGRADE librottent

[root@localhost percona]#yum downgrade libtorrent

 

 

 

Oracle Client on Centos [ORA-24408: could not generate unique server group name]


Cara instalasi oracle client di centos 5.4,5.4 versi 32 bit

Jika menggunakan versi php 5.1 maka install oracle client versi 10

Jika oracle client di install versi 11 versi php 5.1 maka akan muncul error

“ORA-24408: could not generate unique server group name”

solusinya harus di downgrade ke versi oracle client : 10

oracle-instantclient-devel-10.2.0.3-1.i386.rpm
oracle-instantclient-sqlplus-10.2.0.3-1.i386.rpm
oracle-instantclient-jdbc-10.2.0.3-1.i386.rpm
oracle-instantclient-basic-10.2.0.3-1.i386.rpm

rpm -ivh oracle-instantclient-*

Cara instalasi oracle client di centos 6.2 versi 64 bit (centos)  versi php >= 5.2.10

install oracle client on centos 5.5 or RHEL 6
oracle-instantclient-basic-10.2.0.3-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.3-1.x86_64.rpm
oracle-instantclient-jdbc-10.2.0.3-1.x86_64.rpm
oracle-instantclient-odbc-10.2.0.3-1.x86_64.rpm
oracle-instantclient-sqlplus-10.2.0.3-1.x86_64.rpm

rpm -ivh oracle-*.rpm

[root@dctmp etc]# vim /etc/ld.so.conf.d/oracle_client.conf

/usr/lib/oracle/version-oracle-client/arsitektur/lib/

Contoh untuk 32 bit

Tambahkan di file oracle_client.conf
/usr/lib/oracle/10.2.0.3/client/lib/

[root@dctmp etc]# vim /root/.bash_profile
LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib/
export LD_LIBRARY_PATH

save wq!

tar -zxvf oci8-1.4.5.tgz
cd oci8-1.4.5
phpize oci8-1.4.5
./configure && make && make install

echo extension=oci8.so > /etc/php.d/oci8.ini
echo “<?php phpinfo(); ?>” > /var/www/html/phpinfo.php

or

php -m  | grep oci8

/etc/init.d/httpd restart

Thanks

Download package di http://www.oracle.com/technetwork/topics/linuxsoft-082809.html

 

Script testing connection to oracle dababase using php script:

<?php
$tns2 = “(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.215)(PORT = 1521))) (CONNECT_DATA = (SID = crm)))”;
if($c = @oci_connect(“username”,”passowrd”,$tns2)){
echo “Successfully connected to Oracle.”;
oci_close($c);
} else {
$err = oci_error();
$error = $err[‘message’].”\n\n”;
print $error;
}
?>

 

Troubleshoot SSH yang lambat antar host


Beberapa yang lalu teman saya ingin menjalankan backup data voice recording antar host menggunakan rsyn yang di integrasikan dengan openssh.  Size file recording yang akan di pindahkan 50 GB, ketika mengenerate ssh-keygent dan ingin memindahkan public_key (id_rsa.pub) ke server backup backup dengan menggunakan ssh-copy-id tetapi respose dari sisi server backup sangat lambat.

Berikut adalah tampilannya

[root@server212 .ssh]# ls -l
total 16
-rw——- 1 root root 1191 Oct  1 07:03 authorized_keys
-rw——- 1 root root 1671 Sep 21 02:31 id_rsa
-rw-r–r– 1 root root  396 Sep 21 02:31 id_rsa.pub
-rw-r–r– 1 root root 1588 Sep 23 08:19 known_hosts

[root@server212 .ssh]# ssh-copy-id -i id_rsa.pub root@203.86.xx.xx -v
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic

Cara untuk mengatasi case ini adalah dengan meng-edit /etc/ssh/sshd_config di sisi server backup (remote)

[root@server213 .ssh]# vim sshd_config

Sebelum

# GSSAPI options
GSSAPIAuthentication yes
#GSSAPIAuthentication no
GSSAPICleanupCredentials yes

Sesudah

# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication no
GSSAPICleanupCredentials no
#GSSAPICleanupCredentials yes

Restart service sshd

[root@server213 ssh]# /etc/init.d/sshd restart

Coba ssh ke remote server dan gunakan option -v (verbose) harusnya lebih cepat:)
Semoga bermanfaat


What’s the difference 32 bit VS 64 bit System on Linux


Berikut adalah perbedaan sistem 32 bit dan 64

NO

32 Bit

64 Bit

1 Hanya mampu menjalankan system 32 bit. Dapat menjalankan system dan aplikasi 32 bit maupun 64 bit. 
2 Secara default hanya mampu menangani memori maksimum 4 GB, agar dapat mendeteksi memori > 4 GB maka harus di install kernel khusus (KERNEL PAE) tetapi kemampuannya tidak seperti mesin 64 bit. Mampu menangani memory > 4 GB. 
3 Pada proses perhitungan/kalkulasi yang komplek bekerja lebih lambat dibanding 64 bit. Mesin 64 bit memiliki kemampuan jauh lebih cepat untuk melakukan perhitungan /kalkulasi yang kompleks. 
4 Harga lebih murah. Harga lebih mahal. 

sssss

Bagaimana mengetahui bahwa sistem kita mendukung sistem 32 or 64 bit:

[root@gmosking ~]# cat /proc/cpuinfo | grep –color vmx

atau

[root@gmosking ~]# cat /proc/cpuinfo | grep –color svm
[root@gmosking ~]# cat /proc/cpuinfo | grep –color pae

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 xsave lahf_lm tpr_shadow vnmi flexpriority

Apabila ada flags pae , vmx or svm berarti sudah mendukung arsitektur 64 bit.

Bagaimana mengetahui apakah os yang sedang kita gunakan 32 bit atau 64 bit?

[root@gmosking ~]# uname –a
Linux gmosking 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 i686 i686 i386 GNU/Linux

(i386,i586,i686 berarti menggunakan  arsitektur 32 bit)

Linux gmosking 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 x86_64 GNU/Linux

(x86_64 => menggunakan arsitektur 64 bit)

Demikian tutorial singkat ini, apabila ada yang salah silahkan di comment, apabila ada yang kurang silahkan di tambah.

Terimakasih

shisdew

Listens until think alike

moses.spaceku@yahoo.com / voip ipbx

Hosted PBX, IP-PBX SOHO/ CALL CENTER, VOICE GATEWAY, VOICE CARD, COST EFECTIVE SOLUTIONS (LCR), GSM/CDMA GATEWAY

%d bloggers like this: