Skip to content

Instantly share code, notes, and snippets.

@clhynfield
clhynfield / configure-secrets.sh
Created August 7, 2018 20:22
Create CF user-provided service instances
#!/usr/bin/env bash
set -e
if [ -z "$CF_BIN" ]; then CF_BIN=$(which cf); fi
function construct_params_from_environment() {
local serviceName="$1"
local serviceNameVar=$(echo "$serviceName" | tr a-z A-Z)
@clhynfield
clhynfield / .block
Created July 4, 2018 14:18 — forked from mbostock/.block
HCL Color Picker
license: gpl-3.0
@clhynfield
clhynfield / credhub-copy.sh
Created June 13, 2018 15:47
Copy CredHub objects from one path to another
#!/bin/sh
# Requires CredHub CLI 1.7.5 or newer
credhub export -p /from \
| sed -e ‘/from/to/‘ \
| grep -v password_hash \
| credhub import
@clhynfield
clhynfield / export-credhub.sh
Created April 24, 2018 15:53
Export CredHub
#!/bin/bash
# To import, run "credhub import -f credhub-backup.yml"
source <CREDHUB/CONCOURSE TARGET SCRIPT> 2>&1 > /dev/null
echo "credentials:"
for path in $(credhub find -a | grep path: | awk '{print $3}')
do
@clhynfield
clhynfield / cf-jumpbox-decision.ladr
Created January 31, 2018 19:26
CF Jumpbox Decision
# Jumpbox Solution Alternatives
## Requirements
- Responsible use of resources
- Explicitly manage dependencies and versions (bbl, bosh, az, fly, cf, etc.)
- Support multiple team members and environments
- Easy to maintain
- Easy access
- Secure access
@clhynfield
clhynfield / bumpme
Last active December 18, 2017 19:48
concourse-tutorial/12_publishing_outputs
Mon Dec 18 19:47:06 UTC 2017
❯ apm stars
Packages starred by you (46)
├── ⭐ atom-beautify Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom (3867537 downloads, 4333 stars)
├── ⭐ build Build your current project, directly from Atom (313416 downloads, 325 stars)
├── ⭐ build-gulp Runs gulp targets (13040 downloads, 34 stars)
├── ⭐ color-picker Right click or press CMD-SHIFT-C/CTRL-ALT-C to open it. (1507977 downloads, 2859 stars)
├── ⭐ concourse-vis Preview Concourse pipelines in Atom! (638 downloads, 2 stars)
├── ⭐ editorconfig Helps developers maintain consistent coding styles between different editors (369822 downloads, 1197 stars)
├── ⭐ emmet Emmet – the essential tool for web developers (1496466 downloads, 2438 stars)
├── ⭐ escape-utils Encode/decode URLs, Base64 or escape HTML entites. (6617 downloads, 31 stars)

Naming

Fellowship

  • Frodo
  • Samwise
  • Gandalf
  • Legolas
  • Gimli
  • Aragorn
service='api.sys.us-east.big.co'
username='adam.admin@big.co'
#get the password from the keychain
password=$(security find-generic-password -ga "$username" -w)
#if the security command does not run sucessfully, prompt
if [ $? -gt 0 ]; then
echo "Please enter the password for '$username' on '$service': "
read -p "Password: " -s password
@clhynfield
clhynfield / back-up-remote-dir.md
Last active April 28, 2016 13:00
Back up a remote Linux/Unix directory to a local one

Back up a remote Linux/Unix directory to a local one

rsync --archive --verbose --compress \
  --rsh=ssh \
  remoteuser@remotehost:/remote/dir /local/dir/

If you need to get fancy with the ssh command…