Skip to content

Instantly share code, notes, and snippets.

@ejfinneran
ejfinneran / not_working.sh
Created December 28, 2015 23:00
RubyGems mirror issue
$ wget https://rubygems.org/latest_specs.4.8.gz
--2015-12-28 22:57:44-- https://rubygems.org/latest_specs.4.8.gz
Resolving rubygems.org (rubygems.org)... 54.186.104.15
Connecting to rubygems.org (rubygems.org)|54.186.104.15|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://rubygems.global.ssl.fastly.net/latest_specs.4.8.gz [following]
--2015-12-28 22:57:47-- https://rubygems.global.ssl.fastly.net/latest_specs.4.8.gz
Resolving rubygems.global.ssl.fastly.net (rubygems.global.ssl.fastly.net)... 23.235.47.249, 199.27.79.249
Connecting to rubygems.global.ssl.fastly.net (rubygems.global.ssl.fastly.net)|23.235.47.249|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
@ejfinneran
ejfinneran / go-installer.sh
Created September 1, 2015 03:08
Golang Installer
#/bin/sh
platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
platform='linux'
elif [[ "$unamestr" == 'Darwin' ]]; then
platform='darwin'
fi
Verifying that +ejfinneran is my openname (Bitcoin username). https://onename.com/ejfinneran
@ejfinneran
ejfinneran / gpg_secret_keys.sh
Created March 6, 2015 19:46
Exercise your passphrase memory
pkill -SIGHUP gpg-agent; gpg --list-secret-keys | grep sec | awk '{ print $2 }' | awk 'BEGIN { FS = "/" } ; { print $2 }' | sed '/^$/d' | xargs -t -L 1 -J % gpg -o /dev/null -s -u % /dev/null
@ejfinneran
ejfinneran / example.rb
Created January 13, 2015 17:40
Getting AWS Account ID via Fog
require 'fog'
iam = Fog::AWS::IAM.new({
aws_access_key_id: "REDACTED",
aws_secret_access_key: "REDACTED",
})
response = iam.get_user("foo")
puts response.body["User"]["Arn"]
@ejfinneran
ejfinneran / setup.sh
Last active August 29, 2015 14:04 — forked from calavera/setup.sh
#! /bin/sh
# Enable FileVault
if [[ `fdesetup status` != "FileVault is On." ]]; then
sudo fdesetup enable
fi
xcode-select --install
echo "###############################################################"
@ejfinneran
ejfinneran / app.rb
Created July 11, 2014 22:33
Authenticating Resque Web via GitHub OAuth
module Cloudability
class Resque < Resque::Server
enable :sessions
set :github_options, {
:scopes => "user",
:secret => ENV['GITHUB_CLIENT_SECRET'],
:client_id => ENV['GITHUB_CLIENT_ID'],
}
gem 'minitest'
@ejfinneran
ejfinneran / gist:7207061
Created October 29, 2013 00:07
Mercurial vs Git
git clone git@github.com:jnwhiteh/golang.git
9.89s user 2.87s system 25% cpu 49.470 total
hg clone https://code.google.com/p/go
22.66s user 3.29s system 16% cpu 2:38.95 total
@ejfinneran
ejfinneran / mysql_wat.sql
Created February 5, 2013 21:39
MySQL WAT
mysql> create database unique_test;
Query OK, 1 row affected (0.00 sec)
mysql> use unique_test;
Database changed
mysql> create table table_with_unique_index (name TEXT, foo INT, bar INT);
Query OK, 0 rows affected (0.02 sec)