Skip to content

Instantly share code, notes, and snippets.

@timbirk
timbirk / private_repos.rb
Last active April 20, 2018 11:46
Lists forks of all private repos in your org. Relies on .netrc setup.
#!/usr/bin/env ruby
require 'octokit'
if ARGV[0]
@client = Octokit::Client.new(:netrc => true, :per_page => 100,
:auto_traversal => true, :auto_paginate => true)
@client.login
@timbirk
timbirk / lp2r10k.rb
Last active August 14, 2018 14:55
A ruby script to generate a complete R10k ready Puppetfile from a librarian puppet style file.
#!/usr/bin/env ruby
require 'librarian/puppet'
lockfile = Librarian::Puppet::Lockfile.new(
Librarian::Puppet::Environment.new, 'Puppetfile.lock'
)
puppet_modules = {}
@goldmann
goldmann / .zshrc
Last active June 24, 2019 06:18
Docker aliases / helper function
alias dip="docker inspect -f '{{ .NetworkSettings.IPAddress }}'"
dssh() {
PID=$(docker inspect --format {{.State.Pid}} $1)
sudo /usr/bin/nsenter --target $PID --mount --uts --ipc --net --pid env -i - $(sudo cat /proc/$PID/environ | xargs -0) bash
}
drmiall() {
docker rmi `docker images -q -f dangling=true`
}