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
# ADD this to Rakefile and run it by issuing rake roles.to_json | |
ROLE_DIR = File.expand_path(File.join(TOPDIR, "roles")) | |
namespace :roles do | |
desc "Convert ruby roles from ruby to json, creating/overwriting json files." | |
task :to_json do | |
Dir.glob(File.join(ROLE_DIR, '*.rb')) do |rb_file| | |
role = Chef::Role.new | |
role.from_file(rb_file) | |
json_file = rb_file.sub(/\.rb$/,'.json') |
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
apt-get install -y build-essential | |
apt-get build-dep -y postgresql | |
wget http://ftp.postgresql.org/pub/source/v9.2.1/postgresql-9.2.1.tar.gz | |
tar -zxvf postgresql-9.2.1.tar.gz | |
cd postgresql-9.2.1 | |
export MAJOR_VER=9.2 | |
./configure \ | |
--prefix=/opt/chef/embedded \ | |
--mandir=/opt/chef/embedded/share/postgresql/${MAJOR_VER}/man \ | |
--docdir=/opt/chef/embedded/share/doc/postgresql-doc-${MAJOR_VER} \ |
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 | |
Dir.chdir File.join(__FILE__, "../..") | |
unless ENV['EDITOR'] | |
puts "No EDITOR found. Try:" | |
puts "export EDITOR=vim" | |
exit 1 | |
end | |
unless ARGV.count == 2 |
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
# On a Mac, use this script to generate secure deployment key | |
# To generate secure SSH deploy key for a github repo to be used from Travis | |
base64 --break=0 ~/.ssh/id_rsa_deploy > ~/.ssh/id_rsa_deploy_base64 | |
ENCRYPTION_FILTER="echo \$(echo \"- secure: \")\$(travis encrypt \"\$FILE='\`cat $FILE\`'\" -r floydpink/harimenon.com)" | |
# If you don't have homebrew please install it from http://brew.sh/ | |
brew install coreutils | |
gsplit --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_deploy_base64 id_rsa_ | |
# To reconstitute the private SSH key from within the Travis-CI build (typically from 'before_script') |
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
--- | |
driver_plugin: vagrant | |
driver_config: | |
require_chef_omnibus: true | |
platforms: | |
- name: ubuntu-12.04-solo | |
driver_config: | |
box: opscode-ubuntu-12.04 | |
provisioner: chef_solo |
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 | |
require 'json' | |
require 'slop' | |
require 'chef/encrypted_data_bag_item' | |
def usage | |
"Load JSON from STDIN and then convert JSON to encrypt data bag. | |
Usage: #{File.basename(__FILE__)} -s [secret_file]" | |
end |
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 | |
source /etc/environment | |
name=$(cat /etc/machine-id) | |
if [ ! -f /opt/consul ]; then | |
mkdir /opt | |
mkdir /var/lib/consul | |
curl http://storage.googleapis.com/ifup-org-tilde/consul-0.2.0-linux-x86-64.lzma | lzcat > /opt/consul | |
chmod +x /opt/consul |
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 | |
source /etc/environment | |
name=$(cat /etc/machine-id) | |
if [ ! -f /opt/consul ]; then | |
mkdir /opt | |
mkdir /var/lib/consul | |
wget https://dl.bintray.com/mitchellh/consul/0.3.1_linux_amd64.zip | |
unzip 0.3.1_linux_amd64.zip |
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
// A small SSH daemon providing bash sessions | |
// | |
// Server: | |
// cd my/new/dir/ | |
// #generate server keypair | |
// ssh-keygen -t rsa | |
// go get -v . | |
// go run sshd.go | |
// | |
// Client: |
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
console.log('Loading function'); | |
const https = require('https'); | |
const url = require('url'); | |
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration | |
const slack_url = 'https://hooks.slack.com/services/...'; | |
const slack_req_opts = url.parse(slack_url); | |
slack_req_opts.method = 'POST'; | |
slack_req_opts.headers = {'Content-Type': 'application/json'}; |
OlderNewer