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
@jlrigau
jlrigau / docker-private-registry
Last active August 29, 2015 14:14
How to push image to Docker private registry
stop a service.
sudo use docker stop
restart use with --insecure-registry arguments:
/usr/bin/docker -d --insecure-registry localhost:5000
or correct /etc/default/docker record and supplement a following line:
DOCKER_OPTS="--insecure-registry localhost:5000"
@jlrigau
jlrigau / restart-jenkins
Last active August 29, 2015 14:15
How to restart Jenkins
To restart Jenkins manually, you can use either of the following commands:
(jenkins_url)/safeRestart - Allows all running builds to complete.
(jenkins_url)/restart - Forces a restart without waiting for builds to complete.
@jlrigau
jlrigau / check-mesos-jenkins-scheduler
Created February 11, 2015 14:50
How to check Mesos Jenkins Scheduler
import org.jenkinsci.plugins.mesos.*;
import org.apache.mesos.*;
JenkinsScheduler scheduler = (JenkinsScheduler) Mesos.getInstance()
.getScheduler();
scheduler.isRunning();
@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
@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 / 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 / disk-usage
Created May 19, 2015 09:42
How to check disk usage in current directory
du -sh ./*
@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 / 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 / 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