Orang IT Indonesia » php http://www.orangit.com A Blog Written By Ahlul Faradish Resha, S.Si Mon, 06 Feb 2012 17:30:23 +0000 en hourly 1 http://wordpress.org/?v=3.3.1 Secure user config files at your share host server http://www.orangit.com/2010/06/17/secure-user-config-files-share-host-server.html http://www.orangit.com/2010/06/17/secure-user-config-files-share-host-server.html#comments Thu, 17 Jun 2010 16:26:20 +0000 Ahlul http://ahlul.web.id/?p=780 Continue reading ]]> When you open your server as share host server (e.g webhost server)  you have to make your server more secure than single account on single server.

As we know, today many hosting company using suPHP for their webserver. It more secure than other module. But suPHP has a weakness.. in standard configuration it make open_basedir not work properly, so a user can read file from other users.

And this condition used by hacker to read user file at same server when they hosted.

How to protect your users on suPHP environment?

It easy :) you have to chmod or ask your user to chmod their config files. Because sometime user use user & password of their cPanel in config file, or they store mysql information in config file.

On default, system set permission of file to 0644 and folder to 0755. So to get more secure, set your config file to 0600 :) That mean it just can read or execute by the owner.

For mass chmod, use this script:
http://ahlul.web.id/2010/06/17/php-mass-chmod-config-files.html

]]>
http://www.orangit.com/2010/06/17/secure-user-config-files-share-host-server.html/feed 0
PHP: Mass chmod config files http://www.orangit.com/2010/06/17/php-mass-chmod-config-files.html http://www.orangit.com/2010/06/17/php-mass-chmod-config-files.html#comments Thu, 17 Jun 2010 16:25:16 +0000 Ahlul http://ahlul.web.id/?p=781 Use this script to secure your config file, this script will chmod your config files at your webserver to 0600:

[sourcecode lang="php"] set_time_limit(0);
@$passwd=fopen('/etc/passwd','r');
if (!$passwd) {
echo "[-] Error : Tidak bisa membaca /etc/passwd\n";
exit;
}
$path_to_public = array();
$users = array();
$pathtoconf = array();
$i=0;

while(!feof($passwd)) {
$str=fgets($passwd);
if ($i>35) {
$pos=strpos($str,”:”);
$username=substr($str,0,$pos);
$dirz=”/home/$username/public_html/”;
if (($username!=”")) {
if (is_readable($dirz)) {
array_push($users,$username);
array_push($path_to_public,$dirz);
}
}
}
$i++;
}
echo “[+] Ditemukan “.sizeof($users).” userid di /etc/passwd\n”;
echo “[+] Ditemukan “.sizeof($path_to_public).” folder public_html yang bisa dibaca\n”;
echo “[~] Ok mari kita chmod/secure file-file config ;) …\n\n”;

foreach ($users as $user) {
$path=”/home/$user/public_html/”;
echo (“Memindai $path: \n”);
read_dir($path,$user);
}

echo “\n[+] Done\n”;

function read_dir($path,$username) {
if ($handle = opendir($path)) {
while (false !== ($file = readdir($handle))) {
$fpath=”$path$file”;
if (($file!=’.') and ($file!=’..’)) {
if (is_readable($fpath)) {
$dr=”$fpath/”;
if (is_dir($dr)) {
read_dir($dr,$username);
} else {
if (($file==’config.php’) or ($file==’config.inc.php’) or ($file==’db.inc.php’) or ($file==’connect.php’) or ($file==’wp-config.php’) or ($file==’var.php’) or ($file==’configure.php’) or ($file==’db.php’) or ($file==’configuration.php’) or ($file==’db_connect.php’)) {
chmod($fpath,0600);
echo “[+] $fpath…berhasil di secure kan\n”;
}
}
}
}
}
}
}

?>
[/sourcecode]

Save the code, and run it on your webserver. I suggest you to run it at root path /

[sourcecode lang="bash"]php -q secure.php[/sourcecode]

]]>
http://www.orangit.com/2010/06/17/php-mass-chmod-config-files.html/feed 3
The Simplest Custom Yahoo Online Status Ever http://www.orangit.com/2010/05/13/the-simplest-custom-yahoo-online-status-ever.html http://www.orangit.com/2010/05/13/the-simplest-custom-yahoo-online-status-ever.html#comments Thu, 13 May 2010 02:53:24 +0000 Ahlul http://ahlul.web.id/blog/?p=732 Continue reading ]]> Ok, this tutorial was wrote in Indonesian :) but i think you can use google to translate it.

Berikut ini saya mo memberitahukan bagaimana membuat custom status yahoo Anda sesederhana mungkin.

Dengan skrip ini berarti anda bisa menggunakan image atau gambar sendiri untuk menampilkan status yahoo messenger anda.

Ok berikut caranya:
- buatlah file dengan nama: customym.php
- Isikan kode berikut:

[sourcecode lang="php"]
//Gunakan variable berikut ini untuk menampilkan gambar custom anda
$image_on = 'http://serviceforweb.com/customym/online.jpg';
$image_off = 'http://serviceforweb.com/customym/offline.jpg';
//Nah ini untuk ID Yahoo anda
$yahoo_id = 'ceo.ahlul';
//Ok, lets go....
$status = intval(file_get_contents('http://opi.yahoo.com/online?u='.$yahoo_id.'&m=t&t=1'));
if($status) {
$loc = $image_on;
} else {
$loc = $image_off;
}
header('Location:'.$loc);
?>
[/sourcecode]

- Simpanlah customym.php

Cara pemakaian:
[sourcecode lang="html"]Status Yahoo[/sourcecode]

Ok, that it ;) Simple bukan.

Silahkan share klo menurut anda posting ini bermanfaat.

]]>
http://www.orangit.com/2010/05/13/the-simplest-custom-yahoo-online-status-ever.html/feed 12
[User Request] Fungsi PHP untuk detect browser (tujuan: filtering) http://www.orangit.com/2009/08/19/user-request-fungsi-php-untuk-detect-browser-tujuan-filtering.html http://www.orangit.com/2009/08/19/user-request-fungsi-php-untuk-detect-browser-tujuan-filtering.html#comments Tue, 18 Aug 2009 18:11:29 +0000 Ahlul http://ahlul.web.id/blog/?p=633 Continue reading ]]> [postnotice]

Skrip ini saya gunakan juga di situs saya http://paneldotid.com

Memang keterbatasan beberapa Browser membuat situs kadang tidak tampil sempurna, oleh karena itu ada baiknya kita melakukan filtering agar situs kita dapat dibuka pada browser yang benar.

function browser_info($agent=null) {
$browser = array (
"MSIE", // parent
"OPERA",
"MOZILLA", // parent
"NETSCAPE",
"FIREFOX",
"SAFARI"
);
$info[browser] = "OTHER";
foreach ($browser as $parent) {
$s = strpos(strtoupper($_SERVER['HTTP_USER_AGENT']), $parent);
$f = $s + strlen($parent);
$version = substr($_SERVER['HTTP_USER_AGENT'], $f, 5);
$version = preg_replace('/[^0-9,.]/','',$version);
if (strpos(strtoupper($_SERVER['HTTP_USER_AGENT']), $parent)) {
$info[browser] = $parent;
$info[version] = $version;
}
}
return $info;
}

contoh pemakaian:


$b_info = browser_info();
if($b_info[browser] == "MSIE") {
echo "Maaf situs ini tidak support IE, silahkan download firefox";
}

Semoga bermanfaat

$browser = array (
“MSIE”, // parent
“OPERA”,
“MOZILLA”, // parent
“NETSCAPE”,
“FIREFOX”,
“SAFARI”
);
$info[browser] = “OTHER”;
foreach ($browser as $parent) {
$s = strpos(strtoupper($_SERVER['HTTP_USER_AGENT']), $parent);
$f = $s + strlen($parent);
$version = substr($_SERVER['HTTP_USER_AGENT'], $f, 5);
$version = preg_replace(‘/[^0-9,.]/’,”,$version);

if (strpos(strtoupper($_SERVER['HTTP_USER_AGENT']), $parent)) {
$info[browser] = $parent;
$info[version] = $version;
}
}

]]>
http://www.orangit.com/2009/08/19/user-request-fungsi-php-untuk-detect-browser-tujuan-filtering.html/feed 5
Memakai Windows Font Sampai Menjalankan Program Windows di Ubuntu (linux) http://www.orangit.com/2009/06/02/memakai-windows-font-sampai-menjalankan-program-windows-di-ubuntu-linux.html http://www.orangit.com/2009/06/02/memakai-windows-font-sampai-menjalankan-program-windows-di-ubuntu-linux.html#comments Tue, 02 Jun 2009 09:42:09 +0000 Ahlul http://ahlul.web.id/blog/?p=580 Continue reading ]]> [postnotice]

Sebenarnya saya saat ini lagi di Ubuntu :D dah kangen karena biasanya pas booting saya jalanin windows aja, paling kalau pas masuk Ubuntunya cuma untuk update ubuntunya aja :D

Sebenarnya setiap hari saya ngurusin Linux cuma ya ngeremote server2 aja dan umumnya emang server aja ndak desktop jadi minimal semua aplikasinya biar servernya efisien dan umumnya saya gunakan Centos aja untuk server2 saya.

Nah hari ini dari tadi pagi saya sengaja untuk buka ubuntu karena pada PC satu lagi saya udah idupin YM saya jadi ga terlalu menggangu pembicaraan dengan custumer saya.

Task hari ini rencananya:

  • Update paket ubuntu ke yang terbaru
  • Install apache+mysql+php
    Maksdnya biar nanti saya lebih sering buka ubuntunya.

Agar Apache dan Mysql saya sinkron dengan data di Apache dan Mysql saya di Windows maka tentu harus diubah konfigurasinya yang di linux, ini agar saya tidak perlu copas copis semua data di windows ataupun di linux. Nah untuk itu dari pada saya mengubah konfigurasinya, saya hanya membuatkan symbolic link dari data yang di windows ke folder data mysql ataupun document rootnya si apahce (sesuai di file konfigurasinya).

Berikut info perintah symbolic link yang saya gunakan:

ln -s [folder-asal] [folder-tujuan]

Sip, akhirnya “it’s works”, he2.. next..

Sudah beberapa jam di Ubutnu ini oprek sana oprek sini saya akhirnya agak boringg daan tidak fokus dikarenakan font bawaan ubuntunya tidak se smooth yang di Windows, Ok deh.. dari pada tambah bosen dan ingin balik ke windows saya akhirnya install dan konfigurasikan ubuntunya agar menampilkan tampilan font se smooth di windows, karena install font saja tidak cukup.

Untuk instalasi font berikut konfigurasinya bisa di cek di: http://ahlul.web.id/2009/06/02/membuat-tampilan-font-ubuntu-seperti-windows.html

Sip.. akhirnya setelah re-login lagi :D semua berubah, font sudah seperti font windows.. lebih clear dan lebih smooth, hi2 ga boring lagi deh.. ya mau ga mau text merupakan unsur yang tersering tampil di monitor jadi kalau ga srek ya ga enak :D

Ok karena saya mo edit beebrapa web saya butuh Web Editor, dan saya install Quanta dan BlueFish… Untuk intall bisa dari menu System -> Administrator -> Synaptic Software Manager dan saya cari Quanta dan BlueFish selnjunya saya install.

Sip, setelah ke install saya jalanin deh dan kita lanjutkan design2 :D eh crash si Quanta, mo milih Blue Fish ga enak.. mo benerin quanta ya kelamaan juga :D lagian ga seenak si dreamwaver windows, akhirnya mo balik…

Eits… saya piki2 mending jalanin aja Dreamwavernya di Ubuntu.. sip deh saya install Wine yang bisa mengemulasikan (emulator) aplikasi windows di Linux.

Sama seperti menginstall software lain anda bisa langsung install melalui: System -> Administrator -> Synaptic Software Manager dan mencari key wine di sana.

Nah yap :d sekali lagi sudah terinstall dan saya jalankan itu si Dreamwaver dan akhirnya jalan juga dengan Perfect.

Hi2, bener2 deh dari pagi sampai sore cuma di Ubuntu aja karena ya sudah terakomodasikan semua :p mo tampilan, mo aplikasi sudah lengkap semua. Dan yang terpenting gratis lagi :D

Hi2 besok mo main di linux aja biar sekalian bisa lebih banyak bikin artikel linuxnya :D

Semoga bermanfaat.

Ups iya nih hasil oprek2nya; dari install apache – optimize font – dan jalanin dreamwaver:

screenshot-1

]]>
http://www.orangit.com/2009/06/02/memakai-windows-font-sampai-menjalankan-program-windows-di-ubuntu-linux.html/feed 9
WP-Plugin: WordPress Comment Auto Responder http://www.orangit.com/2009/04/19/wp-plugin-wordpress-comment-auto-responder.html http://www.orangit.com/2009/04/19/wp-plugin-wordpress-comment-auto-responder.html#comments Sun, 19 Apr 2009 04:02:46 +0000 Ahlul http://ahlul.web.id/blog/?p=465 Continue reading ]]> [postnotice]

Make your visitor back to your blog again ;)

Now you can install this plugin directly from your dashboard: Plugins -> Add New, and search for wordpress comment auto responder.

Latest version: 3.0

Changelog:
3.0.3 - Add function to support Custom Content and Plugin Dir of WordPress.(http://codex.wordpress.org/Determining_Plugin_and_Content_Directories)
3.0.2 - Add Email Comment Author for usable tag
3.0 - Change replied comment option, Add some new features
2.0 - Remove class mail & class smtp and now using wpmail function so i hope this will solve character error issue
1.6.1 - Little change on functions.php
1.6 - Added custom sender option
1.5 - Added some function to support PHP 4.x
1.4 - Add more or equal operator for date sort of comment
1.3 - Bug fix: Last ID become empty when process last comment
1.2 - Bug fix: script do not update last id if comment email author is empty
1.1 - Change from self table to wordpress option database

Language: EnglishBahasa Indonesia

This plugin will send a automatic mail message when you visitor leave a comment on your wordpress blog.

Other feature of this plugin is when you reply your visitor comment from your dashboard this plugin will make automatic message and will tell to your visitor that their comment has replied.

How To Install

Heuheu, just activate this on your dashboard and it will work for you.

MAKE SURE YOU HAVE THIS DECLARED AT YOUR FOOTER:

<?php wp_footer(); ?>

How To Configure

Go to you Settings section on your dashboar, look for “WP Comment Auto Responder”.

Then click it and you will see a page like this:

comment-auto-responder

What you can do with this plugin options?

  • You can make your own message for auto responder
  • You can use special tags on you message
  • You can make mail signature for your message
  • And More

This is not final, i’ll improve this plugin and make more feature for it.

Support & Donate

If you have bugs or some questions please sent mail to me: ceo.ahlul[at]yahoo.com

I spend my time for this. If you find this plugin is usefull and want make donation for me you can send it to my paypal ;)


Or you can send directly to my paypal account: ahlul_amc@yahoo.co.id

Thanks before for donation.

Where to download

You can download this plugin here: Latest Wp Comment Auto Responder

Bahasa Indonesia

Plugin ini akan mengirim pesan otomatis ke email pengunjung situs anda yang meninggalkan komentar.

Fitur lainnya adalah dengan plugin ini adalah plugin ini juga bisa mengirim email pemberitahuan otomatis kepada pengunjung anda bahwa komentar mereka sudah dibalas.

Bagaimana cara menginstallnya?

Heuheu, hanya aktifkan lewat dashboard dan ini akan bekerja secara otomatis untuk anda.

Bagaimana cara mengkonfigurasinya?

Masuklah ke dashboard wordpress anda dan perhatikan bagian Settings, carilah  “WP Comment Auto Responder”.

Kliklah dan anda akan melihat gambar berikut:

comment-auto-responder

Apa yang bisa anda lakukan dengan opsi plugin ini?

  • Anda bisa menyusun pesan auto responder anda
  • Anda bisa gunakan kata-kata kunci pada pesan anda
  • Anda bisa membubuhkan tanda tangan pada pesan anda
  • Dan banyak lagi

Ini belum final, saya masih akan meningkatkan fitur-fiturnya.

Dukungan & Donasi

Jika anda menemukan kekurangan atau pertanyaan silahkan email saya di: ceo.ahlul[at]yahoo.com

Jika anda menghargai waktu saya dan menemukan plugin ini bermanfaat silahkan donasi lewat paypal saya  ;)


Atau anda yang di Indonesia bisa mengirim lewat rekening yang ada di halaman:
http://ahlul.web.id/donasi-untuk-saya

Terimakasih untuk donasi anda.

Dimana harus di download?

Anda bisa download pada link berikut: Latest Wp Comment Auto Responder

3.0 – Change replied comment option, Add some new features
]]>
http://www.orangit.com/2009/04/19/wp-plugin-wordpress-comment-auto-responder.html/feed 261
[User Request] Form Mail http://www.orangit.com/2009/03/20/user-request-form-mail.html http://www.orangit.com/2009/03/20/user-request-form-mail.html#comments Fri, 20 Mar 2009 16:14:42 +0000 Ahlul http://ahlul.web.id/blog/?p=388 [postnotice]

Nih ada yang request bagaimana bikin form untuk bisa ngirim email dari website.

Ini bisa digunakan untuk berbagai keperluan. Tentunya tinggal dimodif aja.

Berikut skripnya, silahkan di download: form-mail.php

Setelah di download mohon ganti dengan eksensi php.

Semoga membantu.

]]>
http://www.orangit.com/2009/03/20/user-request-form-mail.html/feed 10