This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# www.fduran.com | |
# Block an external attacker's IP address (1.2.3.4) with netfilter (iptables) | |
/sbin/iptables --append INPUT --source 1.2.3.4 -j DROP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# www.fduran.com | |
# mysql status summary | |
mysqladmin -u root -pthepasswd process status | |
# check database mydb | |
/etc/init.d/mysqld stop; cd /var/lib/mysql; myisamchk --silent --force mydb/*.MYI | |
# repair mydb | |
/etc/init.d/mysqld start; mysqlcheck -u root -pthepassed --auto-repair --check --optimize --databases mydb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# www.fduran.com | |
# disk space usage | |
df -h | |
# biggest (10) directories in size (MB) | |
du -mxS / | sort -n | tail -10 | |
# clean package cache | |
apt-get clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# www.fduran.com | |
# apache password protect directory | |
# Apache config | |
<Directory /home/user/public_html> | |
AllowOverride AuthConfig | |
# ... | |
</Directory> | |
Alias /protected "/home/user/public_html/protected" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# www.fduran.com | |
# Heroku notes for python, fixes http://devcenter.heroku.com/articles/python | |
# Ubuntu 11.04 (Natty Narwhal) | |
mkdir heroku | |
cd heroku | |
# Prerequisites | |
curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py | |
cp virtualenv.py /usr/bin/virtualenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# www.fduran.com | |
# Linux shell "here" document | |
$ cat > newfile << EOF | |
> write something | |
> EOF | |
# obv also: | |
$ cat > newfile | |
# and Ctr-D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# www.fduran.com | |
# Linux check DNS cache snooping | |
# check if somedomain (try popular ones like google.com etc) is cached in a dns_server | |
# with nslookup | |
nslookup -norecurse somedomain dns_server | |
# with dig | |
dig @dns_server somedomain A +norecurse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
www.fduran.com | |
Monitoring Plesk with Monit | |
Plesk is not mentioned anywhere in monit's site http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=plesk+site%3Ammonit.com and I couldn't find any article or tutorial about how to monitor Plesk using Monit, so I'm writing one myself in the hopes other people with the same problem find it. | |
Plesk 8.3 on Centos5 | |
etc/init.d/psa status | |
psa dead but subsys locked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
www.fduran.com | |
Remote syslogging in Linux | |
1. On logging server 'logserver': | |
# nano /etc/rsyslog.conf | |
uncomment: | |
# provides UDP syslog reception | |
$ModLoad imudp | |
$UDPServerRun 514 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# www.fduran.com | |
# Linux honeypots | |
# nephentes | |
# (google 'nephentes honepot') | |
apt-get update; apt-get install nepenthes | |
nano /etc/nepenthes/nepenthes.conf | |
/etc/init.d/nepenthes restart | |
#log: less /var/log/nepenthes.log |