Skip to content

Instantly share code, notes, and snippets.

View nlacourte's full-sized avatar

Nicolas LACOURTE nlacourte

  • dotinfra
  • Paris
View GitHub Profile
@nlacourte
nlacourte / keybase.md
Created November 14, 2017 23:41
keybase.md

Keybase proof

I hereby claim:

  • I am nlacourte on github.
  • I am nlacourte (https://keybase.io/nlacourte) on keybase.
  • I have a public key ASAPj5zu4f5RMt7128XS9g3cKLgk12XNlbnaGBivhxmdWgo

To claim this, I am signing this object:

@nlacourte
nlacourte / ipsec.conf
Created April 29, 2015 08:52
StrongSwan ipsec updown script for mangle TCPMSS
#Ipsec.conf example
conn vrackxxxxx_psk
ikelifetime=60m
keylife=20m
rekeymargin=3m
keyingtries=1
authby=secret
keyexchange=ikev2
mobike=no
auto=add
@nlacourte
nlacourte / gist:39ade6050ca1e0d38a36
Created April 2, 2015 20:22
Purge Old kernel but not current on Debian-like (Ubuntu)
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
@nlacourte
nlacourte / jsonPP.sh
Created June 12, 2014 09:20
light json pretty print in ruby
ruby -rjson -e 'puts JSON.pretty_generate(JSON.load($<))' fileName
#!/bin/bash
#
# fake init script for automate testing
#
#
. /etc/init.d/functions
case "$1" in
start)
@nlacourte
nlacourte / update-git
Created April 4, 2014 17:26
Lazy git workdir update
#!/bin/bash -eu
find . -type d -name .git -execdir git fetch --quiet --prune \; , -type d -name .git -execdir git fetch --tags --quiet --prune \; , -type d -name .git -execdir bash -c "test -n \"\$(git for-each-ref --format='%(upstream:short)' \$(git symbolic-ref -q HEAD))\" && git pull --rebase --quiet " \;
@nlacourte
nlacourte / clean-ssh
Last active August 29, 2015 13:58
SSH config params with master connection
#!/bin/bash -eu
find /tmp/ -maxdepth 1 -name 'ssh-*.sock' -exec ssh -S '{}' localhost -O exit \;
@nlacourte
nlacourte / .gitconfig
Last active August 29, 2015 13:58
Yet another gIt config with alias
[user]
name =
email =
[color]
branch = auto
diff = auto
status = auto
interactive = auto
[alias]