Skip to content

Instantly share code, notes, and snippets.

View schisamo's full-sized avatar

Seth Chisamore schisamo

View GitHub Profile

How do I set up compliance checks for an application or cookbook pipeline in delivery?

Delivery version: 0.4.109 or higher
Inspec version: 0.16.0 or higher

1) Create a compliance pipeline of a profile you are interested in, or use an existing one.

2) Configure the application or cookbook to depend on that profile.

@markan
markan / vpncfix.md
Created August 21, 2015 17:52
shimo/vpnc "ERROR: can't send packet: Can't assign requested address"

The problem

I've frequently been bit by failures restarting my vpn on my Mac. The connection may appear to start up in Shimo (the menu icon will change) but it looks like vpnc can't connect.

Looking at the log, we see the connection gets stuck

ERROR: can't send packet: Can't assign requested address

This has plagued me for a while, and my only fix has been to restart the machine. I hate restarting my machine. So I finally made time to dig in and find a better solution

@woodhull
woodhull / auto_scaling_group.rb
Created July 31, 2015 02:01
random bits of ruby for doing green/blue deploys
require "timeout"
class AutoScalingGroup
attr_accessor :name
def initialize(attrs = {})
attrs.each do |key,value|
if self.respond_to?("#{key}=")
self.send("#{key}=", value)
end
@ifraixedes
ifraixedes / LICENSE
Last active May 6, 2018 06:44
AWS lambda handler which download images from S3, resizes them and upload the new ones to S3; tested with mocha, chai, sinon and proxyquire
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004
(http://www.wtfpl.net/about/)
Copyright (C) 2015 Mario Mendes (@hyprstack)
Copyright (C) 2015 Ivan Fraixedes (https://ivan.fraixed.es)
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
@jkeiser
jkeiser / gist:126e7e1ed0b040ddc892
Created March 16, 2015 20:20
provisioning-machine
#
# First create a provisioners group so the ACLs are all correct
#
chef_group 'provisioners' do
end
# To be able to recreate the provisioners group
chef_acl 'groups' do
rights :create, groups: 'provisioners'
end
# To be able to add others to the provisioners group
@corny
corny / unifi-backup.sh
Last active January 26, 2024 02:07
Improved backup script for Ubiquiti UniFi controller
#!/bin/bash -e
#
# Improved backup script for Ubiquiti UniFi controller
# original source: http://wiki.ubnt.com/UniFi#Automated_Backup
#
# must contain:
# username=<username>
# password=<password>
source ~/.unifi-backup
@adamrneary
adamrneary / kinesis-lambda-handler.js
Created January 8, 2015 16:31
Boilerplate handler function for processing Amazon Kinesis events with Amazon Lambda
// Extract data from the kinesis event
exports.handler = function(event, context) {
// This function abstracts the expected structure of any Kinesis payload,
// which is a base64-encoded string of a JSON object, passing the data to
// a private function.
function handlePayload(record, callback) {
encodedPayload = record.kinesis.data;
rawPayload = new Buffer(encodedPayload, 'base64').toString('utf-8');
handleData(JSON.parse(rawPayload), callback)
@adamrneary
adamrneary / video-events-lamba-function.js
Created December 20, 2014 18:07
A simple function for Amazon Lambda
var Firebase = require('firebase');
var async = require('async');
// Extract data from the kinesis event
exports.handler = function(event, context) {
// This function abstracts the expected structure of any Kinesis payload,
// which is a base64-encoded string of a JSON object, passing the data to
// a private function.
function handlePayload(record, callback) {
save-last-command() {
last_command=$(fc -nl 0)
command_name="$1"
read -r -d '' new_fun <<EOF
${command_name}() {
$last_command
}
EOF
eval "$new_fun"
}
@wk8
wk8 / readline.patch
Last active August 29, 2015 14:00
Minimal patch to get ruby 2.1.1 to compile with readline 6.3.x (?) on Mac OS X. Usage: curl -L https://gist.github.com/wk8/fef2479af6b16a9cac71/raw | ruby-build 2.1.1 --patch or curl -L https://gist.github.com/wk8/fef2479af6b16a9cac71/raw | rbenv install --patch 2.1.1, depending on what you're using.
--- ext/readline/readline.c
+++ ext/readline/readline.c
@@ -1974,7 +1974,7 @@ Init_readline()
rl_attempted_completion_function = readline_attempted_completion_function;
#if defined(HAVE_RL_PRE_INPUT_HOOK)
- rl_pre_input_hook = (Function *)readline_pre_input_hook;
+ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
#endif
#ifdef HAVE_RL_CATCH_SIGNALS