Skip to content

Instantly share code, notes, and snippets.

View joshk's full-sized avatar
🥸

Josh Kalderimis joshk

🥸
  • Valued
  • Wellington, NZ
  • 20:15 (UTC +02:00)
View GitHub Profile
@ryanb
ryanb / favorite_gems.md
Created March 4, 2011 17:31
A list of my favorite gems for various tasks.
Check the application's processor service and the statsd service are both in the same overlay network.
```
docker service inspect processor
```
Then look under the `Networks` section to see all the networks each service is attached to.
If both services are in the same network, check for DNS or network issues.
```
docker exec -it processor bash
apt-get update
@sandfox
sandfox / .travis.yml
Last active December 18, 2015 16:58
Latest / custom nodejs versions for travis.
before_install:
- rm -rf ~/.nvm
- curl https://raw.github.com/creationix/nvm/master/install.sh | sh
- source ~/.nvm/nvm.sh
- nvm install ${TRAVIS_NODE_VERSION}
body {
background-color: white !important; }
#upload_target {
display: none !important; }
div.bottom {
padding: 0px !important;
margin: 0px !important;
background-image: none !important; }
@ebi
ebi / travis.sh
Created January 15, 2013 08:53
Using multiple saucelabs accounts on travis
echo "Connecting to Saucelabs..."
case "$((${TRAVIS_BUILD_NUMBER:(-1):1}/2))" in
"1")
TRAVIS_SAUCE_CREDENTIALS="sauce-subaccount1,access-key"
echo "Using sauce-subaccount1"
;;
"2")
TRAVIS_SAUCE_CREDENTIALS="sauce-subaccount2,access-key"
echo "Using sauce-subaccount2"
;;

This is a distillation of a technique we use internally at Basho to reduce the pain of cloning some of our larger repos. It relies a bit on shell scripts and environment variables, but it can be run more directly, as I show below.

  1. Create a bare git repository in some directory, e.g. /var/lib/gitcache.

    git init --bare /var/lib/gitcache
  2. Add all repositories you want to cache as remotes to the git repository, e.g.

@mislav
mislav / readme.md
Created January 25, 2012 14:42
CLI tool that checks the build status of current branch on Travis CI

Check build status of a project on the command line

Install (copy & paste):

curl -sL raw.github.com/gist/1676577/travis.rb > ~/bin/travis \
  && chmod +x ~/bin/travis

gem install hub | tail -2
ruby -e 'require "json"' 2>/dev/null || gem install json
@nicksieger
nicksieger / akuma.rb
Created October 11, 2011 17:33
Daemonizing JRuby with Akuma
require 'rubygems'
require 'java'
require 'mvn:org.kohsuke:akuma'
d = com.sun.akuma.Daemon.new
if d.daemonized?
puts "Daemonizing with PID #{$$}"
d.init
else
d.daemonize
Vagrant::Config.run do |config|
# config.vm.box = "natty32_base"
config.vm.box = "lucid32"
# config.vm.box_url = "http://dl.dropbox.com/u/7490647/talifun-ubuntu-11.04-server-i386.box"
config.vm.box_url = "http://files.vagrantup.com/lucid32_old.box"
config.vm.forward_port 'ssh', 22, 2220
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks/vagrant_base"
@jamis
jamis / demo.rb
Created August 3, 2011 21:56
Repairing a unicode string that contains invalid characters
# encoding: utf-8
s = "Blah \xe9 blah 헌글"
puts "BEFORE"
puts "encoding: #{s.encoding}"
puts "valid : #{s.valid_encoding?}"
puts "text : #{s}"
s = s.