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
View list pods
$ ./cluster/ list pods
Name Image(s) Host Labels Status
---------- ---------- ---------- ---------- ----------
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...
# 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}')
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'
carlossg /
Created Jan 23, 2014
Script to change .deb control file and repackage
# Change .deb control file and repackage
# credits Loevborg
if [[ -z "$1" ]]; then
echo "Syntax: $0 debfile"
exit 1
View ninja-parse-xively.js
Parse.Cloud.define("hello", function(request, response) {
var xivelyKey = 'YOUR XIVELY KEY';
var feedId = 713578059;
var device = request.params.D;
var channels = {
31: 'Temperature',
30: 'Humidity'
var channel = channels[device];
carlossg / onx_wifi_post.js
Last active Dec 25, 2015
on{X} rule for POSTing to a url while connected to a specific wifi access point
View onx_wifi_post.js
// Initializing variables
// url to post to. If using ninjablocks this is a webhook you created in the dashboard
var url = "";
// the wifi SSID
var ssid = "myhomewifi";
// how often to trigger the POST
var seconds = 5*60;
var method = "POST";
carlossg /
Created May 13, 2012
Test the jclouds stub
Iterable<Module> modules = ImmutableSet.<Module> of( new SshjSshClientModule() );
ContextBuilder builder = ContextBuilder.newBuilder( "stub" ).credentials( "x", "y" ).modules( modules );
builder.buildView( ComputeServiceContext.class ).getComputeService(); Guice creation errors:
1) A binding to org.jclouds.predicates.SocketOpen was already configured at org.jclouds.sshj.config.SshjSshClientModule.configure(
at org.jclouds.compute.stub.config.StubComputeServiceDependenciesModule.socketOpen(
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.