Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View hugsbrugs's full-sized avatar

Hugo Maugey hugsbrugs

View GitHub Profile
# 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
# 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 April 22, 2016 07:50
PHP reminder and how too
# 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 April 12, 2016 13:40
Compare Mysql database
# 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 12:53
Apache LetsEncrypt how to
# 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
@hugsbrugs
hugsbrugs / linux-network-memo.sh
Last active April 25, 2016 20:39
Linux network memo
# 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
@hugsbrugs
hugsbrugs / scrapy-memo.sh
Created March 8, 2016 18:46
Scrapy Memo
scrapyd start <crawler>
@hugsbrugs
hugsbrugs / jail.local
Last active March 8, 2016 17:31
Memo Linux fail2ban
[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 February 28, 2016 14:53
Display Logs in Browser with tailon
# 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
@hugsbrugs
hugsbrugs / python-memo.sh
Created February 27, 2016 13:35
Python Memo
# PIP
# install package
pip install package
# install from git repository
pip install git+git://github.com/gvalkov/tailon.git