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 | |
# Check which Linux users could log in with password, see "man shadow" for the second field in the /etc/shadow file: | |
# "If the password field contains some string that is not a valid result of crypt(3), for instance ! or *, the user will not be able to use a unix password to log in (but the user may log in the system by other means). | |
# this awk one-liner will find users that have common used * or ! in the password field or field starts with ! (locked account). It's possible that still found user cannot log in due to other non-crypt character in the field | |
awk -F: '$2 != "*" && $2 !~ /^!/ { print $1, " can log in" }' /etc/shadow |
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 | |
# installing mod_security http://www.modsecurity.org (Debian-based distro) | |
# apachectl -M | |
apache2: Could not reliably determine the server's fully qualified domain name, using boxmetric.com for ServerName | |
Loaded Modules: | |
core_module (static) | |
log_config_module (static) | |
logio_module (static) | |
mpm_prefork_module (static) |
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 | |
# hardware stress test | |
# mismatched md5sums shows a faulty disk/RAM | |
# time depends on hardware, ex: 1 sec per 100 count | |
dd if=/dev/zero of=/tmp/test.file bs=1M count=1000 | |
for i in {1..5}; do md5sum /tmp/test.file; done |
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 |
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 | |
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 | |
# 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 | |
# 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 | |
# 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 | |
# apache password protect directory | |
# Apache config | |
<Directory /home/user/public_html> | |
AllowOverride AuthConfig | |
# ... | |
</Directory> | |
Alias /protected "/home/user/public_html/protected" |