Articles Comments

{ Berbagi, Menulis, Dan Mengajar } Ilmu… » 7. Operating System

MYSQL + TRIGGER + PHP

Command execution with a MySQL UDF Modern database management systems are powerful applications: they provide several instruments to interact with the underlying operating system. On MySQL it is possible to create a User-Defined Function to execute commands on the underlying operating system. Marco Ivaldi demonstrated that some years ago. His raptor_udf2.c works well, but it has two limitations: It is not MySQL 5.0+ compliant because it does not follow the new guidelines to create a proper UDF. It calls C function system() to execute the command and returns always integer 0. These limitations make the UDF almost useless on recent MySQL server installations if the database administrator wants to get the exit status of the command as UDF output or the command standard output itself. I recently came across an open repository of MySQL User-Defined Functions … Read entire article »

Filed under: 7. Operating System

GOSEPA FIREWALL + CCTV + SMSGATEWAY

firewall.gosepa   #———– Ini Untuk forward ke SERVER XEON dengan IP 192.168.1.10 ——-# #$IPTABLES -t nat -A PREROUTING -p tcp -d $EXTIP –dport 80 -j DNAT –to $ServerProduksi:80 $IPTABLES -t nat -A PREROUTING -p tcp -i $EXTIF –dport 80 -j DNAT –to $ServerProduksi:80 $IPTABLES -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT $IPTABLES -A FORWARD -i $INTIF -o $EXTIF -m state –state NEW,ESTABLISHED,RELATED -j ACCEPT $IPTABLES -A FORWARD -p tcp –destination-port 80 -j ACCEPT $IPTABLES -A OUTPUT -m state –state NEW,RELATED,ESTABLISHED   — #———– Ini Untuk forward ke SERVER XEON dengan IP 192.168.1.10 ——-# #$IPTABLES -t nat -A PREROUTING -p tcp -d $EXTIP –dport 80 -j DNAT –to $ServerProduksi:80 $IPTABLES -t nat -A PREROUTING -p tcp -i $EXTIF –dport 8001 -j DNAT –to $SERVER:80 $IPTABLES -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT $IPTABLES -A FORWARD -i $INTIF -o $EXTIF -m state –state NEW,ESTABLISHED,RELATED -j … Read entire article »

Filed under: 7. Operating System

Remix Enak

http://zonemix.eu/ http://tunein.com/radio/Indonesia-r100356/ … Read entire article »

Filed under: 7. Operating System

Eclipse Editor Referense

Eclipse_referensi … Read entire article »

Filed under: 7. Operating System

Gammu / SMS PTPN-XI / ARIF / APIK

Filed under: 7. Operating System

SERVER CHECK PHP By ARIP

<? /* Fungsi untuk mengecek beberapa kondisi server. Jika ada yang tidak beres, akan mengirim sms ke admin. arif@ptpn-11.com 25/04/2012 */ $host = ‘localhost'; $user = ‘gammu'; $pass = ‘gammu132′; $db_name = ‘gammu'; $link = mysql_connect($host, $user, $pass); mysql_select_db($db_name, $link); $admin = array( “arif” => ‘081332218352’, “nofry” => ‘08563532669’, ); $spaceHD = getSpaceHD(); if ($spaceHD) kirimSMS($spaceHD); function kirimSMS($text){ $valuesnya = ”; global $admin; foreach ($admin as $i => $value) $valuesnya .= “(‘$value’, ‘$text’, ‘Gammu’),”; $values = rtrim($valuesnya, ‘,’); $query = “INSERT INTO outbox(DestinationNumber, TextDecoded, CreatorID) VALUES $values”; $hasil = mysql_query($query); } function getSpaceHD(){ $output = shell_exec(‘df -h’); $result = str_replace(array(“\r\n”, “\r”, “\n”), ” “,$output); $datapisah = explode(” “,$result); $hasil = ”; foreach ($datapisah as $i => $value) { if (substr($value, -1) == ‘%’) { if (substr($value, 0, -1) > 80) { $hasil .= $value.’ ‘; $hasil .= $datapisah[$i+1].’\n'; } } } if ($hasil <> ”) { $ket = “Hard Disk server penuh, harap segera dipindah. \n”.$hasil.'{SMS Server NXI}'; return $ket; } else return false; } function getMemHD(){ $output = shell_exec(‘df -h’); $result = str_replace(array(“\r\n”, “\r”, “\n”), ” “,$output); $datapisah = explode(” “,$result); $hasil = … Read entire article »

Filed under: 7. Operating System

Script Bekap DataBase

root@Main-Ras-Server:~# crontab -l # m h  dom mon dow   command */5 * * * * /usr/sbin/ntpdate id.pool.ntp.org  > /dev/null #*/1 * * * * /etc/init.d/mysql restart 00 00 * * * /bin/sh /home/bekap_data/dbbackup.sh > /dev/null @hourly /usr/bin/php /home/arif/noc.php > /dev/null root@Main-Ras-Server:~# cat  /home/bekap_data/dbbackup.sh #!/bin/bash tgl=`date “+%d%m%Y”`; mkdir /home/bekap_data/db/$tgl sqldir=/home/bekap_data/db/$tgl; dbhost=localhost user=root pass=’rahasiakita’ database=” information_schema forumDB kvaweb mysql pajak ptpn11_map ptpn11wp ptpn11wp_old ptpn2010 revitalisasi2 t89607_eproc t89607_ptpn t89607_sipgut webptpn11 aruskas forumDB hutangpiutang” for db in $database; do v_name=$db”_”$tgl.sql; mysqldump -u$user -h$dbhost -p$pass $db –skip-lock-tables –force > $sqldir/$v_name; done exit 0 — End Script … Read entire article »

Filed under: 7. Operating System

Radio Online Indonesia

http://radioindonesia.info/ … Read entire article »

Filed under: 7. Operating System

Contoh Programming C di LINUX

\\192.168.1.1\dms\Ebook … Read entire article »

Filed under: 7. Operating System

Function set_magic_quotes_runtime() is deprecated (CI)

Tanggal 7 April 2010 tiba-tiba aplikasi salah satu client saya tidak jalan dengan baik di karenakan ada beberapa error. Setelah dianalisa ternyata server hosting telah mengUpgrade PHP ke versi 5.3.2. Eror yang muncul seperti ini : ## A PHP Error was encountered Severity: 8192 Message: Function set_magic_quotes_runtime() is deprecated Filename: codeigniter/CodeIgniter.php Line Number: 60 Error tersebut dikarena fungsi yang di sebut tidak dapat dibaca karena fungsi tersebut tidak lagi digunakan pada PHP versi 5.3.2. Saya juga lupa-lupa ingat Framework Codeigniter yang saya gunakan versi berapa. Solusi : saya langsung upgrade Codeigniter  Versi 1.7.2 Cara Upgrade ke Codeigniter versi 1.7.2 : Download source Codeigniter versi 1.7.2 Extract file Zip Codeigniter (ci) terbaru. Upload folder yang ada didalam system ci terbaru, sbb: * system/codeigniter * system/database * system/helpers * system/language * system/libraries Sebelum di timpa dengan yang baru, lebih baik aplikasi dan datanya di backup terlebih dahulu Setelah upgrade ci dengan versi … Read entire article »

Filed under: 7. Operating System