Skip to content

Instantly share code, notes, and snippets.

@alext
alext / christmas-tree.yml
Last active December 12, 2017 13:20
Concourse pipeline that displays a Christmas tree.
resources:
- name: 'x'
type: time
source:
interval: 20s
check_every: 20s
- name: 'y'
type: time
source:
interval: 2000h
#!/bin/bash
# vpnc-script wrapper for use with openconnect that Prevents routing DNS over the VPN.
#
# Example usage:
# openconnect https://vpn.example.com/profile --script '/path/to/vpnc-script-no-dns'
unset INTERNAL_IP4_DNS
unset CISCO_DEF_DOMAIN
@alext
alext / vpnc-script-aws
Last active July 12, 2018 12:54
vpnc script to route all AWS IP ranges over VPN.
#!/bin/bash
# vpnc-script wrapper for use with openconnect that routes all AWS IP ranges over the VPN.
# Pass any additional IP ranges to be routed as args to the script.
#
# Requirements: bash, curl and jq.
#
# Example usage:
# openconnect https://vpn.example.com/profile --script '/path/to/vpnc-script-aws'
#
2017/02/06 11:46:07 [INFO] Terraform version: 0.8.5 b4d477660b5abd20f2a70175460c9603797fada0
2017/02/06 11:46:07 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply", "."}
2017/02/06 11:46:07 [DEBUG] Detected home directory from env var: /Users/alextomlins
2017/02/06 11:46:07 [DEBUG] Discovered plugin: pingdom = /usr/local/bin/terraform-provider-pingdom
2017/02/06 11:46:07 [DEBUG] Detected home directory from env var: /Users/alextomlins
2017/02/06 11:46:07 [DEBUG] Attempting to open CLI config file: /Users/alextomlins/.terraformrc
2017/02/06 11:46:07 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/02/06 11:46:07 [DEBUG] Detected home directory from env var: /Users/alextomlins
2017/02/06 11:46:07 [DEBUG] Checking resource noop: aws_iam_server_certificate.cert
2017/02/06 11:46:07 [DEBUG] No diff, not a noop
2017/01/23 11:25:50 [INFO] Terraform version: 0.8.4 a791ff09b29d063dd4b6da0cac04ad3b83c836f5
2017/01/23 11:25:50 [INFO] CLI args: []string{"/Users/alextomlins/tmp/tf_0.8.4/terraform", "apply"}
2017/01/23 11:25:50 [DEBUG] Detected home directory from env var: /Users/alextomlins
2017/01/23 11:25:50 [DEBUG] Detected home directory from env var: /Users/alextomlins
2017/01/23 11:25:50 [DEBUG] Attempting to open CLI config file: /Users/alextomlins/.terraformrc
2017/01/23 11:25:50 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/01/23 11:25:50 [DEBUG] Detected home directory from env var: /Users/alextomlins
2017/01/23 11:25:50 [DEBUG] No diff, not a noop
2017/01/23 11:25:50 [TRACE] Graph after step *terraform.PruneNoopTransformer:
@alext
alext / aws_vpn_routes.rb
Created January 9, 2017 10:36
Add AWS IP ranges to vpn config file.
#!/usr/bin/env ruby
# This script outputs a series of lines that can be added to the [ipv4] section
# of a NetworkManager VPN config file (typically found in
# /etc/NetworkManager/system-connections/)
#
# ./aws_vpn_routes.rb | sudo tee -a /etc/NetworkManager/system-connections/<connection_name>
require 'net/http'
require 'json'
@alext
alext / adjust_exif_date.rb
Created April 12, 2016 21:49
Script to adjust the EXIF date of an image file by a given offset in days.
#!/usr/bin/env ruby
require 'open3'
require 'time'
EXIF_DATE_FORMAT='%Y:%m:%d %H:%M:%S'
offset = ARGV[0].to_i
file_name = ARGV[1]
#!/usr/bin/env ruby
require 'rubygems'
require 'rexml/document'
require 'mysql2'
require 'date'
HOME_CONFIG = "#{ENV['HOME']}/.mythtv/config.xml"
ETC_CONFIG = "/etc/mythtv/config.xml"
if File.exist?(HOME_CONFIG)
#!/usr/bin/perl -w
if( scalar @ARGV < 1) {
die "Usage $0 config_file\n";
}
my $channels_map_file = "$ENV{'HOME'}/.xmltv/supplement/tv_grab_uk_atlas/tv_grab_uk_atlas.map.channels.conf";
my %channels = ();
unless(open CHANNELS, "< $channels_map_file") {
print STDERR "Failed to open channels map - $channels_map_file : $!\n";
body {
background: #fff;
color: #000;
}
#pulls {
text-shadow: unset;
color: #000;
}