Skip to content

Instantly share code, notes, and snippets.

View NicolasRitouet's full-sized avatar

Nicolas Ritouet NicolasRitouet

View GitHub Profile
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashpath
. ~/.bashrc
sudo apt-get install build-essential g++ curl
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
@NicolasRitouet
NicolasRitouet / git_branch_from_tag.sh
Last active December 25, 2015 14:29
Make a branch from a tag
tag_to_branch=2.0.4.1
new_branch=2.0.4
git checkout origin master
git fetch origin
git branch $new_branch tags/$tag_to_branch #or git checkout -b $new_branch $tag_to_branch
git checkout $new_branch
git push origin $new_branch
@NicolasRitouet
NicolasRitouet / .gitignore
Created October 17, 2013 15:13
Gitignore for intellij, eclipse and maven
# Eclipse
.classpath
.project
.settings/
# Intellij
.idea/
*.iml
*.iws
@NicolasRitouet
NicolasRitouet / git-multipull.sh
Created November 29, 2013 09:17
Git multiple pull
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
find "$DIR" -type d -name .git \
| xargs -n 1 dirname \
@NicolasRitouet
NicolasRitouet / dup.sh
Created December 4, 2013 16:17
Check duplicates Usage: ./dup.sh my_artifact.war ./dup.sh my_artifact.jar
jar tf $1 |sort| uniq -c|sort -n
@NicolasRitouet
NicolasRitouet / logs
Created March 28, 2014 13:28
JHipster hot reloading NPE infinite loop
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/java -javaagent:spring_loaded/springloaded-jhipster.jar -noverify -Dspringloaded=plugins=io.github.jhipster.loaded.instrument.JHipsterLoadtimeInstrumentationPlugin -Didea.launcher.port=7543 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 13.app/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/Jav
@NicolasRitouet
NicolasRitouet / encrypt-jboss-password.sh
Created June 23, 2014 15:29
Encrypt datasource password for Jboss eap 6.2
#!/bin/bash
## Build ClassPath for command
MYPATH=`pwd`
CP=
CP=${CP}:$MYPATH/../modules/system/layers/base/org/picketbox/main/picketbox-4.0.19.SP2-redhat-1.jar
CP=${CP}:$MYPATH/../modules/system/layers/base/org/jboss/logging/main/jboss-logging-3.1.2.GA-redhat-1.jar
echo "$CP"
java -classpath ${CP} org.picketbox.datasource.security.SecureIdentityLoginModule $1
module.exports = function(sequelize, DataTypes) {
var Page = sequelize.define('Page', {
title: DataTypes.STRING,
content: DataTypes.STRING
});
return Page
}
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@NicolasRitouet
NicolasRitouet / Docker cheat-sheet
Last active August 29, 2015 14:07
Cheat-sheet for Docker
stop all containers:
sudo docker stop $(sudo docker ps -a -q)
Remove all containers:
sudo docker rm $(sudo docker ps -a -q)
Get id of last container:
sudo docker ps -l -q
Stop last container: