Just another quick post :
- Ubah setting $config['uri_protocol'] ke REQUEST_URI
- Edit file nginx.conf untuk virtual host yg pakai CI. Rewrite rule :
if (!-e $request_filename) {
rewrite ^(.*) /index.php?$1 last;
}
- Restart nginx
Just another quick post :
- Ubah setting $config['uri_protocol'] ke REQUEST_URI
- Edit file nginx.conf untuk virtual host yg pakai CI. Rewrite rule :
if (!-e $request_filename) {
rewrite ^(.*) /index.php?$1 last;
}
- Restart nginx
Cara nyari file yang kena injeksi iframe :
grep ... * | grep iframe
Cara hapusnya :
find . -name '*.*' | xargs perl -pi -e 's/^.*\<iframe src.*chura\.pl.*$/ /g'
Dari contoh diatas, iframe src yang ketemu mengarah ke chura.pl . Makanya pada perintah kedua, input chura.pl dimasukkan supaya kode iframe langsung dihapus dan ngga berpengaruh ke iframe lainnya di file yang sama (kalau memang ada).
Here’s small script to find any core dump files generated in /home directory :
#!/bin/bash for((i=0;i> searchcoredump.txt
Use searchcoredump.txt to analyze every core dump file you’ve found. Or you can delete it one by one.
[root@pengki ~]# for hapus in `cat /root/searchcoredump.txt`; do rm -rf $hapus; done
Finding core dump files will take a loooong time if your home directory is big (in size, and node). You can use screen command to let the machine works for you so you can do another thing (or have a nice sleep
).
for namahost in `cat domain.txt`
do
ping $namahost -c 1
done
Ini kasus ketika saya terlalu malas untuk mengeksekusi perintah ping berkali-kali ke banyak host. Jadi sekalian iseng nulis bash script-nya. Daftar nama host (eh boleh IP juga kok) disimpan di satu file (domain.txt).
Tinggal dieksekusi..
./pinger > hasilping.txt
Lalu hasilnya dibaca.
)
more hasilping.txt
It’s a WordPress plugins that will send a blog post’s link to plurk. It has a very minimal function. You can find the result here.
query("insert into ".$wpdb->options." (option_name,option_value,autoload) values ('plurkuser','','no')") or die(mysql_error());
$wpdb->query("insert into ".$wpdb->options." (option_name,option_value,autoload) values ('plurkpass','','no')") or die(mysql_error());
$wpdb->query("insert into ".$wpdb->options." (option_name,option_value,autoload) values ('plurkuid','','no')") or die(mysql_error());
}
function wp2plurk_uninstall(){
global $wpdb;
$wpdb->query("delete from ".$wpdb->options." where option_name='plurkuser'") or die(mysql_error());
$wpdb->query("delete from ".$wpdb->options." where option_name='plurkpass'") or die(mysql_error());
$wpdb->query("delete from ".$wpdb->options." where option_name='plurkuid'") or die(mysql_error());
}
register_activation_hook(__FILE__,'wp2plurk_install');
register_deactivation_hook(__FILE__,'wp2plurk_uninstall');
function wp2plurk_admin(){
add_menu_page('WP2Plurk Config','WP2Plurk Config', 10, __FILE__,'wp2plurk_c');
}
function wp2plurk_c(){
global $wpdb;
if(isset($_POST['submit'])){
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_URL, 'http://www.plurk.com/Users/login');
curl_setopt($curl, CURLOPT_POSTFIELDS, 'nick_name='.$_POST['plurkuser'].'&password='.$_POST['plurkpass'].'');
$ch = curl_exec($curl);
if(eregi("incorrect_login",$ch)){
echo 'Username atau password belum benar';
} else {
$plurkpass = base64_encode($_POST['plurkpass']);
$wpdb->query("update ".$wpdb->options." set option_value='".$_POST['plurkuser']."' where option_name='plurkuser'");
$wpdb->query("update ".$wpdb->options." set option_value='".$plurkpass."' where option_name='plurkpass'");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.plurk.com/'.$_POST['plurkuser']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$exec = curl_exec($ch);
if(@mkdir(('cookie'), 0777) == false){
echo '<strong>Ubah permission folder plugins ke 777</strong> <br />';
}
preg_match('/var GLOBAL = \{.*"uid": ([\d]+),.*\}/imU', $exec, $matches);
$wpdb->query("update ".$wpdb->options." set option_value='".$matches[1]."' where option_name='plurkuid'");
echo 'Data tersimpan!';
}
} else {
?>
:
Username : <br />
Password : <br />
<input type="submit" name="submit" value="">
guid." (".$postdetails->post_title.")");
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie/cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie/cookie.txt');
curl_setopt($ch, CURLOPT_URL, 'http://www.plurk.com/Users/login');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'nick_name='.get_option('plurkuser').'&password='.$plurkpass.'');
curl_exec($ch);
curl_setopt($ch, CURLOPT_URL, 'http://www.plurk.com/TimeLine/addPlurk');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'qualifier=%3A&content='.$plurkcontent.'&lang=en&no_comments=0&uid='.urlencode(get_option('plurkuid')));
curl_setopt($ch, CURLOPT_HEADER, true);
$exec = curl_exec($ch);
#var_dump($exec);
#echo urlencode(get_option('plurkuid'));
curl_close($ch);
}
#publish_post
add_action('publish_post', 'wp2plurk');
?>