Skip to content

Instantly share code, notes, and snippets.

@sebsto
sebsto / gist:20e550876db521710186
Created February 12, 2015 16:38
Block users access to AWS EC2 meta data
sudo iptables -A OUTPUT -m owner ! --uid-owner root -d 169.254.169.254 -j DROP
@catermelon
catermelon / gist:f3b1d2e9e4d094d118fa
Last active August 29, 2015 14:12
Things to do in SF

Weather

So the SF pasttime isn't baseball or anything like that, it's laughing at tourists who wear shorts. All the visions of warm, beachy California are lies spread by the Los Angeles tv industry. SF can be cold and windy even in summer (actually especially in summer, the land warms up and causes the fog to roll in) and the fog is beautiful but it's FRICKIN COLD. I always bring a jacket to SF no matter what time of year it is. It can be 30 deg C maybe 20 miles away and 10 degrees C in SF. No joke.

Food

SF has awesome food, with a lot of Asian and Mexican influence. Here's a great list from all price ranges: http://www.sfgate.com/food/top100/2014/

Pay particular attention to Mexican/Central and South American food, since I know the UK has great Asian food but not Mexican. The burrito is a Californian staple. Try the al pastor and the carnitas.

@0xabad1dea
0xabad1dea / singularthey.md
Last active June 18, 2022 18:01
Singular They in Technical English

Guidelines for Singular They in Technical English

by 0xabad1dea, December 2014

This document is an RFC of sorts for increasing the adoption rate of Singular They in technical English. This is not an ultimatum; this is not shaming anyone who has done otherwise; and this is definitely not applicable to any other language.

What is Singular They?

#!/bin/sh
bin_path=/opt/ruby-210/embedded/bin
update-alternatives --install /usr/bin/ruby ruby $bin_path/ruby 10 \
--slave /usr/bin/irb irb $bin_path/irb \
--slave /usr/bin/erb erb $bin_path/erb \
--slave /usr/bin/rdoc rdoc $bin_path/rdoc \
--slave /usr/bin/ri ri $bin_path/ri \
--slave /usr/bin/testrb testrb $bin_path/testrb \
@rgbkrk
rgbkrk / hubdecrypt.sh
Last active April 6, 2022 02:55
Encrypt a (short) file using someone's public key from github
#!/usr/bin/env bash
# HubCrypt
# ========
#
# Decrypt a file encrypted using hubencrypt (ok, it's just openssl + rsautl +
# your SSH keys). It needs the private key that matches your last public key
# listed at github.com/<user>.keys
#
@fnichol
fnichol / README.md
Last active April 27, 2023 15:24
Auto-enable Local HTTP Caching in Test Kitchen

Auto-enable Local HTTP Caching in Test Kitchen

Note: total experiment and hack, looks nasty, could be awesome:

Setup

  • Drop the kitchen.local.yml into $HOME/.kitchen/config.yml
  • Install polipo (with Mac: brew install polipo, with Ubuntu: apt-get install polipo)
  • Drop polipo-start and polipo-console somewhere useful (perhaps $HOME/bin?)
@ssimeonov
ssimeonov / chef_resource_rake.rb
Created June 18, 2013 22:40
Chef LWRP subclassing example: rake resource subclasses rvm_shell.
class Chef
class ResourceFactory
class Rake
def self.create(*args, &block)
register
Chef::Resource::Rake.new(*args, &block)
end
def self.register
@klass ||= begin
maintainer "YOUR_COMPANY_NAME"
maintainer_email "YOUR_EMAIL"
license "All rights reserved"
description "Installs/Configures pants"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version Time.at(`git --git-dir=#{File.join(File.dirname(__FILE__),'.git')} log --max-count=1 --pretty=format:%ct`.to_i).strftime("1.0.%Y%m%d%H%M")
@jbgo
jbgo / debug_system_stack_error.md
Created January 9, 2013 15:08
debug SystemStackError in ruby 1.9

This is how I debug SystemStackError when there is no stack trace.

My first attempt was:

begin
  a_method_that_causes_infinite_recursion_in_a_not_obvious_way
rescue SystemStackError
  puts caller
end
@kennethlove
kennethlove / Description.md
Created October 12, 2012 23:47
GSWD Chef needs
  • Install build-essentials, git-core, vim, mercurial
  • Install postgresql-server
  • Edit /etc/postgresql/9.1/main/postegresql.conf
    • Change listen_address to = '*'
  • Edit /etc/postgresql/9.1/main/pg_hba.conf
    • Add new line host all all 10.0.0.0/16 md5
  • Add new postgresql superuser named "vagrant" with password "vagrant"
    • sudo su postgres
    • createuser -s -W vagrant
  • Add postgresql to defaults so it runs at boot