Skip to content

Instantly share code, notes, and snippets.

Yak shaving

Carlos Sanchez carlossg

Yak shaving
Block or report user

Report or block carlossg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
carlossg / jruby-json.rb
Last active Aug 29, 2015
JRuby json conversion
View jruby-json.rb
# test conversion of Java objects to json in JRuby
# jrjackson is the only gem doing it right, the others quote the result
# the trick for the other ones is to convert maps and lists to ruby hashes and arrays before
array =
list =
map =
nested = { :list => list }
require 'jrjackson'
# kill it all!!!
#docker ps | awk '{print $1}' | grep -v CONTAINER | xargs docker kill
docker rm $(docker ps -a -q)
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
View kubernetes-suspend
$ ./cluster/ list pods
ID Image(s) Host Labels Status
---------- ---------- ---------- ---------- ----------
jenkins csanchez/jenkins-swarm:1.565.3 name=jenkins Running
2efdcb34-5096-11e4-8260-0800279696e1 csanchez/jenkins-swarm-slave:1.20 name=jenkins-slave,replicationController=jenkins-slave Running
$ vagrant suspend
==> master: Saving VM state and suspending execution...
==> minion-1: Saving VM state and suspending execution...
==> minion-2: Saving VM state and suspending execution...
View list pods
$ ./cluster/ list pods
Name Image(s) Host Labels Status
---------- ---------- ---------- ---------- ----------
View gist:2d5cb66f1048d41063e7
Jan 28, 2015 11:35:29 AM hudson.model.DownloadService$Downloadable doPostBack
SEVERE: <div class=error><img src='/jenkins/static/69e42646/images/none.gif' height=16 width=1>Signature verification failed in downloadable &#039;; <a href='#' class='showDetails'>(show details)</a><pre style='display:none'> timestamp check failed
at org.jvnet.hudson.crypto.CertificateUtil.validatePath(
at jenkins.util.JSONSignatureValidator.verifySignat
View gist:23fa67f3749593878594
### Keybase proof
I hereby claim:
* I am carlossg on github.
* I am carlos ( on keybase.
* I have a public key whose fingerprint is 03C6 E9F3 C99E 43AC D46F 4202 4EBC 0C9F 0208 FC11
To claim this, I am signing this object:
carlossg / 1.7.0 rc2
Last active Aug 29, 2015
Docker shared mount
View 1.7.0 rc2
$ sudo umount /mnt/xvdb
$ cat /proc/self/mountinfo | grep mnt
67 22 202:1 /mnt /mnt rw,relatime shared:1 - ext4 /dev/disk/by-uuid/e1d70192-1bb0-461d-b89f-b054e45bfa00 rw,discard,data=ordered
$ docker --version
Docker version 1.7.0-rc2, build 7ddecf7
$ docker run -d --name test -v /mnt/xvdb:/mnt busybox tail -f /dev/null
$ ls -laF /mnt/xvdb
total 8
drwxr-xr-x 2 root root 4096 Jun 17 20:05 ./
carlossg / dhcp-monitor
Created Jul 10, 2015
DHCP monitor and reload
View dhcp-monitor
while true
for myHost in $HOSTS; do
if ! ping -c $COUNT $myHost > /dev/null; then
echo "Host : $myHost is down (ping failed) at $(date)"
carlossg /
Created Sep 17, 2015
Mesos SSL problems


In /etc/default/mesos

export SSL_ENABLED=true
export SSL_REQUIRE_CERT=true
export SSL_CERT_FILE=/etc/mesos/
export SSL_KEY_FILE=/etc/mesos/
View gist:1250837
class test1(
$servicex = "sonar",
$logfoldera = "${homex}/logs",
$logfoldere = "${homey}/logs",
$logfolderh = "${homez}/logs",
$logfolder = "${homex}/logs",
$homex = "/var/${servicex}",
$homey = "/var/${servicex}",
$homez = "/var/${servicex}") {
You can’t perform that action at this time.