This Gist has moved to a full git repo:
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
| #!/usr/bin/env ruby | |
| require 'socket' | |
| require 'openssl' | |
| def check_ssl_cert(host, port, ca_file) | |
| sock = TCPSocket.new(host, port) | |
| ctx = OpenSSL::SSL::SSLContext.new | |
| ctx.set_params(:verify_mode => OpenSSL::SSL::VERIFY_PEER, | |
| :ca_file => ca_file) |
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 | |
| set -e | |
| false() { | |
| echo 'this is false' | |
| command false | |
| } | |
| echo 'starting' |
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/sh | |
| # 1.0 | |
| set -eu | |
| HOSTS=/etc/hosts | |
| usage() { | |
| cat <<EOM | |
| usage: $(basename "$0") OPTION... | |
| Modify /etc/hosts by adding or removing comments from lines by IP address. |
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
| description "autossh tunnel to HOST" | |
| author "Andy Brody" | |
| start on (local-filesystems and net-device-up IFACE=eth0) | |
| stop on runlevel [016] | |
| respawn | |
| respawn limit unlimited | |
| setuid tunnel |
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
| #!/usr/bin/env ruby | |
| require 'openssl' | |
| require 'socket' | |
| METHODS = OpenSSL::SSL::SSLContext::METHODS.select {|m| (m.to_s =~ /_(client|server)$/).nil?} | |
| PORT = 443 | |
| HOST = ARGV[0] || 'qa.stripe.com' | |
| IN_BUFFER = [] | |
| OUT_BUFFER = [] |
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
| #!/usr/bin/env python | |
| import imaplib | |
| import os | |
| import logging | |
| import optparse | |
| # LABEL = 'support' | |
| # QUERY = 'before:2015-06-01 -label:to-delete' | |
| # DEST = 'to-delete' | |
| LABEL = 'to-delete' |
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
| #!/usr/bin/env bash | |
| # | |
| # Syncs Ruby binstubs for ruby-communal-gems. | |
| # Run this everytime you install a new Ruby, or when you install a new gem | |
| # with a bin/ command. (ie, when you typically do rbenv rehash) | |
| # | |
| # See: https://github.com/tpope/rbenv-communal-gems/issues/5 | |
| # | |
| set -eu |
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 | |
| set -eu | |
| if [ $# -ne 3 ]; then | |
| cat >&2 <<EOM | |
| usage: $(basename "$0") YEAR MONTH {high|low|concat-only} | |
| EOM | |
| exit 1 | |
| fi |
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
| #!/usr/bin/env ruby | |
| alias π puts | |
| class Aπ₯ | |
| @@π΄ = { | |
| π: 'Hello, world!', | |
| π: 'HALP', | |
| π₯: 'computer.', | |
| } |