Skip to content

Instantly share code, notes, and snippets.

View Iristyle's full-sized avatar

Ethan J. Brown Iristyle

View GitHub Profile
@big-samantha
big-samantha / Puppet Debugging Kit on Windows.md
Last active January 31, 2017 22:10
Puppet Debugging Kit on Windows

Running the Puppet Debugging Kit on Windows

Up and running with Vagrant, VirtualBox and the Puppet Debugging Kit on Windows.

Why?

Running the Puppet Debugging Kit on Windows is fairly straightforward, in that the setup process is nearly identical to setup on OSX and Linux.

However, the typical "Vagrant on Windows" caveats apply.

I've attempted to cover the entire setup process here, going from a system with no virtualization tools installed, to a working Vagrant + Oscar + Puppet Debugging Kit environment

#! /usr/bin/ruby
# To use this, untar the forge backup tarball from
# http://forge-dl-backup.s3-website-us-west-2.amazonaws.com/ somewhere and
# then run this script, passing the name of the directory where you
# unpacked the tarball.
#
# The script will print the names of the latest version of each tarball;
# you can feed that into something like 'xargs -iF tar xf DIR/F'
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active March 6, 2024 18:14
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active May 3, 2024 15:54
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@bradwilson
bradwilson / _readme.md
Last active July 3, 2019 15:17
bash-git prompt overrides

The OS X version does not require any custom fonts, because it uses the built-in emoji and symbol support in OS X.

The Linux version requires that you install Font Awesome.

@ferventcoder
ferventcoder / RubyStack.ps1
Last active April 5, 2018 17:48
Full Ruby Stack Install using Chocolatey and PowerShell
# https://github.com/chocolatey/choco/wiki/CommandsReference#how-to-pass-options--switches
# Powershell specific argument passing
# You must be on the latest beta of chocolatey for this to work properly (redownload files)
choco upgrade chocolatey -pre
$originalPath = $env:PATH
choco install ruby --version 1.9.3.55100 -my --install-arguments '/verysilent /dir=""c:\tools\ruby193"" /tasks=""assocfiles""' --override-arguments
# DevKit for Ruby 1.x
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active April 27, 2024 01:22
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@ElijahLynn
ElijahLynn / pipe_to_docker_examples
Last active March 13, 2024 03:29
How to pipe to `docker exec` examples
# These examples assume you have a container currently running.
# 1 Pipe from a file
sudo docker exec --interactive CONTAINER_NAME /bin/bash < the_beginning.sh | tee the_beginning_output.txt`
#2a Pipe by piping
echo "echo This is how we pipe to docker exec" | sudo docker exec --interactive CONTAINER_NAME /bin/bash -
@ccampanale
ccampanale / vaultsealmanager.sh
Created December 10, 2015 19:31
Bash shell script to check seal status for local vault server and attempt to unseal using keys secured in vault secret store. Supports HA Vault clusters with TLS with unseal keys stored as secrets in vault (see code). Relies on registered service vault.service.consul, in place DNS configuration, and a single unsealed vault instance in your clust…
#!/bin/bash
export vault=/usr/local/bin/vault
export VAULT_TOKEN=$(cat /root/.vault-token)
vault_cacert='-ca-cert=/path/to/your/ca.pem'
local_vault="-address=https://$(hostname -f):8200"
unsealed_vault="-address=https://$(getent hosts $(dig +short vault.service.consul | tail -n 1) | awk '{ print $2 }'):8200"
leader_vault="-address=https://$($vault status $vault_cacert $unsealed_vault 2> /dev/null | grep Leader | awk '{ print $2 }' | sed 's/^http\(\|s\):\/\///g'):8200"
vault_read="$vault read $vault_cacert $leader_vault"
vault_unseal="$vault unseal $vault_cacert $local_vault"
@Sharpie
Sharpie / NOTES.md
Last active October 3, 2016 23:44
PE Debugging with Pry

This gist contains configuration to make Pry behave a bit better under Puppet Server JRuby.

For debugging, the following might be helpful:

  • Install the pry-nav gem. This is an oldschool "debugger" plugin for Pry and one of the first produced. Newer options like pry-debugger orpry-byebug are much, much better but are tightly integrated with CRuby. The pry-nav plugin provides "next", "step" and "continue" and is as dumb as a bag of hammers, but much better than nothing.

Outstanding issues:

  • Readline completion is busted under Puppet Server for some unknown reason. It works fine when running Pry under a normal JRuby shell. My guess is that some clojure bit is intercepting the tab characters.