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
# Query Google Cache | |
http://webcache.googleusercontent.com/search?q=cache:<your url without "http://"> |
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
# PIP | |
# install package | |
pip install package | |
# install from git repository | |
pip install git+git://github.com/gvalkov/tailon.git |
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
# Install tailon | |
pip install tailon | |
# start tailon | |
tailon -f /var/log/apache2/{access,error}.log | |
tailon -f /var/log/apache2/{access,error}.log -b 127.0.0.1:8080 -d | |
# SECURE INSTALLATION | |
# Create a domain or subdomain like tailon.mydomain.com | |
# Create an apache virtual host |
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
[DEFAULT] | |
ignoreip = 127.0.0.1/8 YOUR_IP | |
banaction = ufw | |
bantime = 1800 | |
destemail = your.name@mail.com | |
sendername = Fail2Ban | |
action = %(action_mwl)s | |
[sshd] | |
enabled = true |
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
scrapyd start <crawler> |
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
# Export first database | |
mysqldump --skip-comments --skip-extended-insert -u root -p database_1>file1.sql | |
# Export second database | |
mysqldump --skip-comments --skip-extended-insert -u root -p database_2>file2.sql | |
# Display differences between files | |
diff file1.sql file2.sql | |
# Ressource | |
http://www.mysqldiff.org/ |
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
# PHP mail change FROM (when auto set as www-data by web server) | |
mail([to], [subject], [message], [headers], "-f hugo@maugey.fr -F Hugo Maugey"); |
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
# Update you packages | |
sudo apt-get update | |
# Install a compiler | |
sudo apt-get install build-essential | |
# Install tcl | |
sudo apt-get install tcl8.5 | |
# Download Redis | |
wget http://download.redis.io/releases/redis-stable.tar.gz | |
# Uncompress archive | |
tar xzf redis-stable.tar.gz |
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
# See all opened ports | |
netstat -ntlp | grep LISTEN | |
# | |
netstat - anp | |
# | |
netstat -tulpen | |
# Show uwf status | |
sudo ufw status verbose | |
# Open a port | |
sudo ufw allow 80/tcp |
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
# List cron tasks for user www-data | |
sudo crontab -u www-data -l | |
# Edit cron tasks for user www-data | |
sudo crontab -u www-data -e | |
# Backup current user crontab | |
crontab -l > cron-backup.txt | |
# Restore current user crontab | |
crontab cron-backup.txt |