Skip to content

Instantly share code, notes, and snippets.

import itertools
import boto
import pymongo
db = pymongo.Connection()['mci']
ec2 = boto.connect_ec2()
chain = itertools.chain.from_iterable
all_instances = list(chain([res.instances for res in ec2.get_all_instances()]))
all_instance_ids = set(instance.id for instance in all_instances)
@nakajima
nakajima / pivotaltracker.com.js
Created July 27, 2011 15:48
dotjs script to add j/k keyboard shortcuts to pivotal tracker
/******************************************************************************
.js/pivotaltracker.com.js
Get dotjs here: http://defunkt.io/dotjs
Extracted from my dotjs files: https://github.com/nakajima/nakajima-dot-js
******************************************************************************/
@jbreams
jbreams / gist:f9f5d6a7aafd26072cd3
Created September 8, 2014 20:03
AWS SSH Key Init Script
#!/bin/bash
#
# Init file for AWS Authorized Keyfile
#
# chkconfig: 2345 11 25
# description: AWS Authorized Keyfile
case $1 in
start)
touch /var/lock/subsys/awssshkey
@ehershey
ehershey / bigredbuttonosx
Last active May 24, 2018 06:05
How to use the Dream Cheeky Big Red Button on a Mac in OS X
# Alternative to homebrew - install Mono directly via http://download.mono-project.com/archive/3.12.1/macos-10-x86/MonoFramework-MDK-3.12.1.macos10.xamarin.x86.pkg
# Install homebrew -
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install mono
brew install mono
# Download windows executable
open https://www.dropbox.com/s/3xmsr8cw02dfkl3/DreamCheekyBTN.zip
# Unzip
unzip DreamCheekyBTN.zip
# Create script
@prenagha
prenagha / bulkUnwatch.sh
Created July 12, 2012 15:33
JIRA Bulk Unwatch
#
# Bulk Unwatch
# JIRA doesn't support unwatch from the bulk change action
# This script fills the gap
# Known to work with JIRA 5 via the REST API
#
# 1. Using JIRA, Issue Navigator, write a query to get all
# the issues you want to unwatch. Something like
# "issue in watchedIssues() AND status != Closed"
# works well as a starting point.
@irvingpop
irvingpop / dna.json.tpl
Last active September 7, 2020 11:49
chef-solo like solution for Terraform
{
"mycookbook": {
"attribute1": "${attribute1}",
"attribute2": "${attribute2}"
},
"run_list": [
"recipe[${recipe}]"
]
}
@wolever
wolever / fix-mouse.lua
Created November 7, 2019 18:17
Hammerspoon config to use mouse button 3 for scrolling, remap button 4 to middle button
-- HANDLE SCROLLING WITH MOUSE BUTTON PRESSED
local scrollMouseButton = 3
local deferred = false
overrideOtherMouseDown = hs.eventtap.new({ hs.eventtap.event.types.otherMouseDown }, function(e)
-- print(hs.eventtap.event.properties['mouseEventButtonNumber'])
local mouseButton = e:getProperty(hs.eventtap.event.properties['mouseEventButtonNumber'])
if mouseButton == scrollMouseButton then
deferred = true
return true
@jnovack
jnovack / README.md
Last active April 3, 2024 03:24
Opening up mosh in firewalld using firewall-cmd

Mosh (mobile shell) is a gift from the Gods(tm). Anyone with spotty internet or wireless connection has suffered the pain of a lost SSH session. Sure, one can fire up screen (or tmux as the kids are using these days), but that's an extra step and you are still using the SSH protocol.

I'm not here to tout the benefits of Mosh, you came here to open it up in your firewall.

  1. Create the following file as /etc/firewalld/services/mosh.xml
  2. firewall-cmd --add-service=mosh --permanent
  3. firewall-cmd --reload

If you tend to have a lot of sessions (not recommended), you can increase the ports, but the default should be fine for most applications.

@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real