Skip to content

Instantly share code, notes, and snippets.

View epayet's full-sized avatar

Emmanuel Payet epayet

View GitHub Profile
@epayet
epayet / gist:8672517
Created January 28, 2014 17:46
Remove a directory from git history and files
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch angular-app/.idea/" --prune-empty -- --all
git push origin master --force
@epayet
epayet / gist:9248170
Last active August 29, 2015 13:56
Permanent umask=000 for specific directory
sudo setfacl -d -Rm o::rwx /media/data/
#don't forget to add acl to fstab
@epayet
epayet / Ecampu instructions
Last active August 29, 2015 13:56
Instructions Ecampue
#Setup
git clone http://github.com/epayet/Ecampue.git
sudo apt-get install python2.7 python-pip
sudo pip install pytz icalendar mechanize
#peut-être beautifulsoup4
#Run :
cd Ecampue
sudo python main.py /var/www
#sudo si besoin d'écriture dans le dossier choisi
_ Interface graphique
_ Pool d'imprimantes
_ Capable de donner son temps d'impression
_ Serveur
_ 3 communications
_ Annuler
_ Ajouter
_ Get infos
_ Communication (TCP/socket)
@epayet
epayet / tunnel ssh git
Created May 20, 2014 11:36
tunnel ssh git
ssh -L 3333:github.com:9418 user@sshServer -N
#forward the local port 3333 to the git protocole
#example: git clone git://localhost:3333/epayet/...
cp configServer.json config.json
rm -rf node_modules
npm install
#npm test
if forever list | grep 'wsmanager' ; then
forever stop wsmanager
fi
forever start --append --uid wsmanager app.js
#forever list | grep 'wsmanager'
function cal() {
var total = 0;
for(var i=1; i<=16; i++) {
total += i*2;
total += 27;
}
return total - 25*16;
}
@epayet
epayet / ReverseProxy
Created October 28, 2014 09:51
ReverseProxy
#Reverse proxy: http://blog.xn--hry-bma.com/article9/configurer-un-reverse-proxy-apache-http-https
#For http
a2enmod proxy
a2enmod proxy_http
echo -e "<VirtualHost *:80> \n ServerName url.com \n ProxyPreserveHost On \n ProxyRequests off \n ProxyPass / http://localhost:8081/ \n ProxyPassReverse / http://localhost:8081/ \n </VirtualHost>" > /etc/apache2/sites-available/test.conf
a2ensite test
a2dissite 000-default
/etc/init.d/apache2 reload
/etc/init.d/apache2 restart
@epayet
epayet / Docker tips
Created November 13, 2014 09:59
Docker tips
# Remove every docker images with no name
for i in `docker images|grep \<none\>|awk '{print $3}'`;do docker rmi $i;done
npm install
export PROJECT_CONFIG='production'
if forever list | grep 'project.js' ; then
forever stop project.js
fi
forever start project.js
forever list | grep 'project.js'