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/env python | |
from __future__ import print_function | |
from __future__ import unicode_literals | |
from prompt_toolkit import prompt | |
from prompt_toolkit.validation import Validator, ValidationError | |
from socket import getfqdn | |
import hvac | |
import sys | |
import os |
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
# /etc/ipsec.d/eastwest.conf - left-hand configuration (endpoint to 10.0.0.0/16) | |
conn eastwest | |
# we use %defaultroute below so we don't need to specify the instance's internal IP address, | |
# which may change if the instance is stopped/started | |
left=%defaultroute | |
# This host's Elastic IP address (what we advertise ourselves to "right" as) | |
leftid=52.27.234.11 | |
leftsubnet=10.0.0.0/16 | |
leftrsasigkey=... | |
# gateway address for 10.1.0.0/16 ("right's" Elastic IP address) |
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
package main | |
import "os" | |
import "log" | |
import "fmt" | |
import "syscall" | |
func main() { | |
fi, err := os.Stat("testfile1") | |
if err != nil { |
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/env python | |
# vim: syn=python:ts=4:sw=4:et:ai | |
# Usage: consul_tag_helper | |
# | |
# This program is in the Public Domain. | |
# | |
# Place your consul configuration files in /etc/consul.boilerplate.d, instead | |
# of /etc/consul.d. Boilerplate JSON configuration files can contain an extra | |
# key under 'service' called 'tag_program'. 'tag_program' is a path to an |
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
Bundler could not find compatible versions for gem "chef-zero": | |
In Gemfile: | |
chefspec (~> 3.2.0) ruby depends on | |
chef-zero (>= 1.6.2, ~> 1.6) ruby | |
chef-zero (2.0.2) | |
Bundler could not find compatible versions for gem "json": | |
In Gemfile: | |
chefspec (~> 3.2.0) ruby depends on |
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
class NodeUpdateFromFile < ::Chef::Knife | |
deps do | |
require "chef/node" | |
require "chef/json_compat" | |
require "chef/knife/core/object_loader" | |
end | |
banner "knife node update from file FILE (options)" | |
def loader |
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
__SSH=$(type -path ssh 2>/dev/null); | |
function ssh() | |
{ | |
# This function overrides ssh to rsync all files listed in $HOME/.briefcase to | |
# the remote server before logging in. It tries very hard to skip this if | |
# you're logging in as another user, but it cannot detect whether you have an | |
# alternate "User" defined in $HOME/.ssh/config or its /etc equivalent. | |
# USE WITH CAUTION! | |
local skip_sync; |
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/env ruby | |
# Ruby script to generate SSHA (Good for LDAP) | |
require 'sha1' | |
require 'base64' | |
hash = "{SSHA}"+Base64.encode64(Digest::SHA1.digest(ENV['PASS']+ENV['SALT'])+ENV['SALT']).chomp! | |
puts 'userPassword: '+hash+"\n" |