Skip to content

Instantly share code, notes, and snippets.

View jlrigau's full-sized avatar

Jean-Louis Rigau jlrigau

  • Nørrecraft
  • Paris
View GitHub Profile

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@jlrigau
jlrigau / ssh-port-mapping
Created January 7, 2016 16:03
How to map a port on localhost through ssh?
ssh -Nf user@hostanme -L 8080:localhost:8080
@jlrigau
jlrigau / install-gnu-sed-on-mac-osx.sh
Created September 29, 2015 18:12
How to install Gnu sed on Mac OS X
brew install --with-default-names gnu-sed
@jlrigau
jlrigau / restart-mesos-slave.sh
Created September 3, 2015 14:29
How to restart a mesos slave instance getting stuck?
sudo rm -f /tmp/mesos/meta/slaves/latest
sudo systemctl restart mesos-slave.service
@jlrigau
jlrigau / restart-service.sh
Last active August 29, 2015 14:27
How to update service configuration and restart a service on Marathon?
MARATHON_BASE_URL=http://[REPLACE_IT]:8080
VERSION=$(curl -X PUT -H "Content-Type: application/json" $MARATHON_BASE_URL/v2/apps/dashboard?force=true -d@dashboard.json | jq '.version' | tr -d '"')
if [ $(curl -sL -w "%{http_code}" $MARATHON_BASE_URL/v2/apps/dashboard/versions/$VERSION -o /dev/null) != 200 ]; then
curl -X POST $MARATHON_BASE_URL/v2/apps/dashboard/restart?force=true
fi
@jlrigau
jlrigau / rsync-through-ssh-tunneling.sh
Last active August 29, 2015 14:21
How to synchronise directory through ssh tunneling
rsync -avz --delete -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ProxyCommand="ssh -W %h:%p USER@PROXY -p 2222"' --progress /data USER@DESTINATION:/backup
@jlrigau
jlrigau / disk-usage
Created May 19, 2015 09:42
How to check disk usage in current directory
du -sh ./*
@jlrigau
jlrigau / remove-ds-store-files
Created April 1, 2015 12:08
How to remove .DS_Store files on Mac OS X
sudo find / -name ".DS_Store" -depth -exec rm {} \;
@jlrigau
jlrigau / remove-docker-none-images
Last active August 29, 2015 14:16
How to remove Docker <non> images
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
@jlrigau
jlrigau / configure-jenkins-slave-with-jnlp
Created February 13, 2015 11:03
How to configure a new Jenkins slave with JNLP
curl -s -o slave.jar http://${JENKINS_HOST}:${JENKINS_PORT}/jnlpJars/slave.jar && \
java -jar slave.jar -jnlpUrl http://${JENKINS_HOST}:${JENKINS_PORT}/computer/test/slave-agent.jnlp