Config secure /tmp and /var/tmp

On July 16th, 2011 by oninth | 1 Comment | Posted in linux

ทำตามด้านล่าง จร้า

rm -rf /tmp
mkdir /tmp
mount -t tmpfs -o rw,noexec,nosuid tmpfs /tmp
chmod 1777 /tmp
echo "tmpfs   /tmp    tmpfs   rw,noexec,nosuid        0       0" >> /etc/fstab
rm -rf /var/tmp
ln -s /tmp /var/tmp

Remove Apache on CentOS

On July 15th, 2011 by oninth | No Comments | Posted in linux, ห้องทดลอง

Check httpd list in system services

chkconfig --list

Turn off httpd service

chkconfig --levels 235 httpd off

Search httpd

 rpm -qa httpd

Remove httpd

rpm -e --noscripts httpd

แค่นี้เองจร้า

อัตราแลกแปลี่ยน Paypal [Currency Exchange on PayPal]

On July 15th, 2011 by oninth | No Comments | Posted in General

Step
1.Log in to your account.
2.Click the My Account tab.
3.Click Profile at the top of the page.
4.Click Currency Balances under the Financial Information column.
5.Enter the requested information and click Calculate.

Thx.

แต่เวอร์ชันใหม่มันแปลก นะ ^ ^

Reset Kloxo Admin Password

On July 13th, 2011 by oninth | No Comments | Posted in General, linux

เนื่องจากเกิดอาการขี้ลืมขึ้นมาเลยเอามาแนะนำให้ครับ

cd /usr/local/lxlabs/kloxo/httpdocs
 
lphp.exe ../bin/common/resetpassword.php master admin

ตามด้านบนแล้ว รหัสของท่านจะเป็น admin เหมือนเริ่มต้นงับ

Check Valid Format Of IP Address Using PHP

On July 2nd, 2011 by oninth | No Comments | Posted in General, PHP

วิธีที่ 1

function validIP($ip)
{
   if (preg_match('/^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$/', $ip))
   {
      return true;
   }
   else
   {
      return false;
    }
}

วิธีที่ 2

function checkIP($ip)
{
   $cIP = ip2long($ip);
   $fIP = long2ip($cIP);
return $fIP;
}
If Return 0.0.0.0 << Invalid IP

Protected: [DirectAdmin] Edit Email When Create New User ^ ^

On June 28th, 2011 by oninth | Enter your password to view comments. | Posted in DirectAdmin, linux

This post is password protected. To view it please enter your password below:

touch: cannot touch `/var/lock/subsys/sshd’: No such file or directory

On June 28th, 2011 by oninth | No Comments | Posted in linux

If you restart service SSHd and get this error:

#service sshd restart
#touch: cannot touch `/var/lock/subsys/sshd': No such file or directory

You can following this solution :-

1) Check if the directory /var/lock/ exists or may be /var/lock/subsys
If it is not exist then create it

2) Make permission 755 for /var/lock/subsys and restated sshd services

This Command Line

 mkdir /var/lock/subsys
 chmod 755 /var/lock/subsys
 /etc/rc.d/init.d/sshd start
 /etc/init.d/sshd restart

Error :- Cp:cannot create regular file `/var/empty/sshd/etc’

On June 28th, 2011 by oninth | No Comments | Posted in linux

If you connect to your server using SSH and get this error:

cp: cannot create regular file `/var/empty/sshd/etc’: No such file or directory

You can following this solution :-

1) Check if the directory /var/empty exists or may be /var/empty/sshd
If it is not exist then create it

2) Make permission 755 for /var/empty and restated sshd services

This Command Line

 mkdir /var/empty
 chmod 755 /var/empty
 /etc/rc.d/init.d/sshd start
 /etc/init.d/sshd restart

Enable SSL Directadmin

On April 24th, 2011 by oninth | No Comments | Posted in linux, ห้องทดลอง

Create OWN SSL

/usr/bin/openssl req -x509 -newkey rsa:1024 -keyout /usr/local/directadmin/conf/cakey.pem -out /usr/local/directadmin/conf/cacert.pem -days 9000 -nodes

Then

chown diradmin:diradmin /usr/local/directadmin/conf/cakey.pem
chmod 400 /usr/local/directadmin/conf/cakey.pem

ref.help.directadmin.com/item.php?id=15

Disable Ping on Linux ปิดการ Ping บน Linux

On April 24th, 2011 by oninth | No Comments | Posted in General, linux, PHP, ห้องทดลอง

เพื่อป้องกันการ DOS (Denial of Service Attacks) ระดับ 1

ในที่นี้จะใช้ iptables

ปิดการปิง

iptables -I INPUT -p icmp -j DROP

เปิดการปิง

iptables -I INPUT -p icmp -j ACCEPT
Older Posts »