Skip to content

Instantly share code, notes, and snippets.

@jmcdice
jmcdice / gist:fac460015f8b9efea8939fcdff86d523
Last active August 29, 2017 16:21
Using gpg2 and gpg-agent to manage pipeline secrets
# Install gnupg2 and gnupg-agent
$ sudo apt-get install gnupg2 gnupg-agent rng-tools
# Make sure you have gpg2 2.1.11 (gpg2 --version)
# Create entropy for key generation
$ sudo rngd -r /dev/urandom
@jmcdice
jmcdice / gist:cfdc12510fb978240f84f3da5e10ef1c
Last active February 14, 2017 21:32
Parsing json with jq.
$ cat test.json
[
{
"kind": "workspace",
"id": 672699,
"name": "Iteration 0",
"person_id": 2179801,
"project_ids": [
1968761,
1968571,
#!/usr/bin/perl
$regexp = '\d\d:\d\d:\d\d';
while(<>){
if(/($reg)/g) {
print"$1\n"
}
while( m/($reg)/g ){
print"$1\n"
@jmcdice
jmcdice / bosh-ruby.sh
Last active November 4, 2016 19:27
Install Bosh CLI
# Install ruby and the bosh cli
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
@jmcdice
jmcdice / pez-sample-app-push
Last active November 8, 2016 19:01
Push a sample app to Pez, connect an SQL backend and scale it, blue-green deploy.
## Push a sample application to pez
# Login to PeZ and create an account:
https://pez.pezapp.io/
# Grab a working cf binary for your platform (this assumes osx):
$ curl -L "https://cli.run.pivotal.io/stable?release=macosx64-binary&source=github" | tar -zx
$ mv cf /usr/local/bin/