Skip to content

Instantly share code, notes, and snippets.

Avatar

Hugo Maugey hugsbrugs

View GitHub Profile
View linux-redis.sh
# 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
View linux-prerender.sh
# Clone repo
git clone https://github.com/prerender/prerender.git
cd prerender
npm install
npm install prerender-redis-cache --save
# Modifi .htaccess (Middleware in prerender vocabulary
https://gist.github.com/thoop/8072354
# Open firewall port
@hugsbrugs
hugsbrugs / php.sh
Created Apr 22, 2016
PHP reminder and how too
View php.sh
# 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");
@hugsbrugs
hugsbrugs / mysql-diff.sh
Last active Apr 12, 2016
Compare Mysql database
View mysql-diff.sh
# 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/
@hugsbrugs
hugsbrugs / apache-letsencrypts.sh
Last active May 5, 2016
Apache LetsEncrypt how to
View apache-letsencrypts.sh
# https://letsencrypt.org/getting-started/
# clone and run program
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt/
./letsencrypt-auto --help
./letsencrypt-auto --verbose --debug
./letsencrypt-auto renew --dry-run
./letsencrypt-auto renew
View linux-network-memo.sh
# 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
View scrapy-memo.sh
scrapyd start <crawler>
@hugsbrugs
hugsbrugs / jail.local
Last active Mar 8, 2016
Memo Linux fail2ban
View jail.local
[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
@hugsbrugs
hugsbrugs / tailon.sh
Last active Feb 28, 2016
Display Logs in Browser with tailon
View tailon.sh
# 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
View python-memo.sh
# PIP
# install package
pip install package
# install from git repository
pip install git+git://github.com/gvalkov/tailon.git