Clear big logs
tail -1000 logname > logoname.bkp
>logname
tail -1000 logname.bkp > logoname
rm -rf logname.bkp
SFTP login
sftp -oport=<port number> IP
Clam scan
clamscan -r --log=/root/scanJul20.txt / | grep detect
Iframe checkup
http://www.unmaskparasites.com/
Package administration commands
http://www.debianhelp.co.uk/pkgadm.htm
Backup Configuration Tutorials
http://www.debianhelp.co.uk/backuptools1.htm
Scripts to install codecs
http://scriptmantra.info
To disable ping
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
To enable ping
echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all
Block an ip range using iptables
iptables -I INPUT -m iprange –src-range 192.168.1.10-192.168.1.13 -j DROP
Google chat integration in to site
A Google Talk chatback badge will let visitors to your web page chat with you. They’ll be able to chat with you whenever you’re signed in to Google
This one is more light weight. Not so stylish as meebo, but it loades faster. Also you just need to open gmail to start chating with your visitors.
To get one visit.
http://www.google.com/talk/service/badge/New
Prevent SYN attack
1. Enable SYN cookies mechanism in the server by the executing command:
# echo 1 > /proc/sys/net/ipv4/tcp_syncookies
2. Increase the backlog queue to 2048 by the command:
# sysctl -w net.ipv4.tcp_max_syn_backlog=”2048″
Script used to find vulnerable PHP files -- From Linux stuffs
#!/bin/bash
shellpattern=’r0nin|m0rtix|upl0ad|r57|c99|shellbot|phpshell|void\.ru|phpremoteview|directmail|bash_history|vulnscan|spymeta|raslan58′
for user in `/bin/ls /var/cpanel/users`
do
find /home/$user/public_html \( -name ‘*.php’ -o -name ‘*.cgi’ -o -name ‘*.inc’ \) -exec \
egrep -il “$shellpattern” {} \;
done
ComCode to create a big file
dd if=/dev/zero of=tmpMnt bs=1024 count=100000