Delivery version: 0.4.109 or higher
Inspec version: 0.16.0 or higher
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
This file contains hidden or 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 "timeout" | |
class AutoScalingGroup | |
attr_accessor :name | |
def initialize(attrs = {}) | |
attrs.each do |key,value| | |
if self.respond_to?("#{key}=") | |
self.send("#{key}=", value) | |
end |
This file contains hidden or 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
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. |
This file contains hidden or 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
# | |
# 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 |
This file contains hidden or 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 -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 |
This file contains hidden or 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
// 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) |
This file contains hidden or 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
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) { |
This file contains hidden or 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
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" | |
} |
This file contains hidden or 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
--- 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 |