Skip to content

Instantly share code, notes, and snippets.

View hugsbrugs's full-sized avatar

Hugo Maugey hugsbrugs

View GitHub Profile
@hugsbrugs
hugsbrugs / ui-bootstrap-tableft-0.12.1.js
Created May 6, 2015 08:39
Angular-ui bootstrap tabs letf
angular.module('ui.bootstrap.tabsleft', ["template/tabs/tabset-left.html","template/tabs/tab-left.html"])
.controller('TabsetLeftController', ['$scope', function TabsetLeftCtrl($scope) {
var ctrl = this,
tabs = ctrl.tabs = $scope.tabs = [];
ctrl.select = function(selectedTab) {
angular.forEach(tabs, function(tab) {
if (tab.active && tab !== selectedTab) {
tab.active = false;
# 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 / bower-memo.sh
Last active May 17, 2016 11:47
Bower Memo
bower cache clean
bower update
# Publish a package
bower init
bower register <package-name> git://github.com/<git-user>/<git-repo>.git
@hugsbrugs
hugsbrugs / git-commands-memo.sh
Last active May 17, 2016 11:37
Git Commands Memo
# Create repo on your server
cd /var/www/website
git init
git config user.email your@name.com
git config user.name Your Name
git remote add origin git@github.com:GitUser/repo.git
# GIT HOW TO UNWATCH SOME FILES (logs, config ...)
# http://stackoverflow.com/questions/9794931/keep-file-in-a-git-repo-but-dont-track-changes
# First change the file you do not want to be tracked and use the following command:
@hugsbrugs
hugsbrugs / nodejs.sh
Last active May 17, 2016 10:21
Nodejs Memo
# List installed packages for current user
npm list
# List globally installed packages
npm list -g
# List details about a package
npm list PACKAGE_NAME
# Show outdated packages
npm outdated -g
https://www.npmjs.com/package/npm-check
https://www.npmjs.com/package/npm-check-updates
@hugsbrugs
hugsbrugs / linux-supervisord.sh
Last active May 10, 2016 08:06
Supervisor how to
# Install
sudo pip install supervisor
# Copy / Edit /etc/supervisord.conf
# http://www.onurguzel.com/supervisord-restarting-and-reloading/
# STOP
supervisorctl -c /etc/supervisord.conf stop thruway // all
# RESTART
supervisorctl -c /etc/supervisord.conf restart all
@hugsbrugs
hugsbrugs / commands.sh
Last active May 5, 2016 14:59
Common linux commands
# Empty a file / Vider un fichier
cat /dev/null > myfile.txt
# Recherche texte dans les fichiers d'un répertoire :
find /arborescence -type f -exec grep -H 'chaine' {} \;
# Recherche du nom d'un fichier :
find /home/hugo/ -name *.mo
# Rechercher les fichiers de plus de 100Mo
@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
RewriteCond %{HTTP_HOST} ^
RewriteRule (.*) http://www./$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www./ [R=301,L]
/var/www/maugey.fr/code
http://shop.alterlinks.com/htpasswd/passwd.php
// Placer le .htaccess dans le répertoire à protéger :
#AuthUserFile /var/www/wine-trip.yo/app/.htpasswd
AuthUserFile /homez.534/maugey/www
AuthGroupFile /dev/null
@hugsbrugs
hugsbrugs / linux-crontab.sh
Last active April 26, 2016 17:37
Cron how to
# 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