This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'json' | |
h = {} | |
ARGV.each do |a| | |
position = ObjectSpace._id2ref(h.object_id) | |
keys,value = a.split('=') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set(:user, Capistrano::CLI.ui.ask("Username ") {|q| q.default = Etc.getlogin }) | |
set(:password, Capistrano::CLI.password_prompt("Password ")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source each directory's .dirrc for project-specific environment variables | |
function cd () { | |
builtin cd "$@" | |
if [[ $PWD == $HOME* ]]; then | |
DIRPATH=( $(pwd) ) | |
i=$((${#DIRPATH[@]} - 1)) | |
while [ -O ${DIRPATH[$i]} ]; do | |
DIRPATH=("${DIRPATH[$i]}/.." "${DIRPATH[@]}") | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am heph on github. | |
* I am heph (https://keybase.io/heph) on keybase. | |
* I have a public key ASCr40PeHVymBfKyLcK5V_7j42sjUGTFIe8pAMYhaMkSYAo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
require 'base64' | |
require 'json' | |
Ohai.plugin(:Consul) do | |
provides 'consul' | |
## | |
# Insert a value into a hash with a '/' delimited path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost _default_:80> | |
DocumentRoot /opt/deck/html | |
ProxyPass "/gate" "http://localhost:8084" retry=0 | |
ProxyPassReverse "/gate" "http://localhost:8084" | |
ProxyPass "/rosco" "http://localhost:8087" retry=0 | |
ProxyPassReverse "/rosco" "http://localhost:8087" | |
<Directory "/opt/deck/html/"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you just change the port or add more ports here, you will likely also | |
# have to change the VirtualHost statement in | |
# /etc/apache2/sites-enabled/000-default.conf | |
Listen 80 | |
<IfModule ssl_module> | |
Listen 443 | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
deck: | |
host: spinnaker.mydomain.com | |
baseUrl: ${services.default.protocol}://${services.deck.host} | |
gateUrl: ${services.deck.baseUrl}/gate | |
bakeryUrl: ${services.deck.baseUrl}/rosco |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in $(find ./tasks -type f -name '*.sh' | sort -n); do | |
current_functions="$(declare -F)" | |
echo "Sourcing task file: ${file}" | |
# shellcheck source=/dev/null | |
source "$file" | |
new_functions="$(diff <(echo "$current_functions") <($(declare -F))) | awk '$NF ~ /.*::main/ {print $NF}')" || true | |
for main in "$new_functions"; do | |
log debug "Executing function ${main} from ${file}:" | |
$main | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
HEADER='# All lines below managed by chef_hostfile.sh' | |
backup_hostsfile() { | |
sudo cp /etc/hosts{,.$(date +%s)} | |
} |
OlderNewer