Skip to content

Instantly share code, notes, and snippets.

Garrett Wilkin garrettwilkin

Block or report user

Report or block garrettwilkin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
antirez / lmdb.tcl
Created Apr 28, 2017
LMDB -- First version of Redis written in Tcl
View lmdb.tcl
# Copyriht (C) 2009 Salvatore Sanfilippo <>
# All Rights Reserved
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
mshkrebtan /
Last active Nov 18, 2019
Run Cisco Webex on 64-bit Ubuntu 16.04

Run Cisco Webex on 64-bit Ubuntu 16.04

With Audio and Screen Sharing Enabled

Enable support for 32-bit executables

Add the i386 architecture to the list of dpkg architectures :

sudo dpkg --add-architecture i386
bblincoe /
Last active Jun 5, 2019
Amazon AWS Client Throttle in Python (boto3)
import boto3
import botocore
from random import randint
from time import sleep
def client_throttle(action, **kwargs):
while True:
return action(**kwargs)
except botocore.exceptions.ClientError as e:
jakeemerson / handy_es_queries
Last active Aug 29, 2015
helpful elastic search queries
View handy_es_queries
## get all the pageviews on the boundary-vpc host in the last hour, sort by timestamp
curl -X GET "http://elastic-04:9200/logstash-2015.03.31/_search/?pretty" -d'
"query": {
"filtered": {
"query": {
"match": {"host" : "boundary-vpc"}
"filter": {
jlecour / post_to_slack.rb
Last active Apr 25, 2019
How to post alerts from Monit to Slack
View post_to_slack.rb
# encoding: UTF-8
require 'optparse'
require 'net/http'
require 'json'
def parse_options(argv)
opts = {}
@parser = do |o|
rothgar / main.yml
Last active Nov 14, 2019
Generate /etc/hosts with Ansible
View main.yml
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
julianeon / heroku-listener-emailer.js
Last active Jul 25, 2016
Event state change emailer. It listens for webhook updates and sends email updates (as they come in) to the email address given in your service's name. For now, it looks for one email address in the service line, then sends notifications to that address.
View heroku-listener-emailer.js
//Node.js script to act as a listener for webhooks.
// Copyright (c) 2014, PagerDuty, Inc. <>
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
goldsmith /
Last active Sep 2, 2017
When I upgraded my Mac to OS X Mavericks, a lot of utilities (like Python, virtualenv, Xcode) broke, and it was pretty stressful trying to get it all set back up. Hopefully this guide can spare you some of that pain.Note: I'm by no means a Linux or Mac expert, so please fork and let me know if anything is redundant, incorrect, or missing!
# A guide to prevent pain and suffering while upgrading to OS X Mavericks
# This will vary greatly depending on system set up, so read the instructions carefully
# Back up Virtulenvs
# Very important!
# For each virtualenv you have, run "pip freeze > requirements.txt" while in the activated virtualenv
# in order to prevent loss of dependencies during the upgrade.
jbenet /
Last active Nov 8, 2019
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

addisonj /
Last active Dec 23, 2015 — forked from codepunkt/
Checks all the wsp files in a whisper storage and deletes any corrupt files
for file in $(find $directory -type f -name '*.wsp' -print); do
$(python /usr/local/bin/ $file > /dev/null 2>&1)
echo "checking $file"
[ $retval -ne 0 ] && matches+=($file)
You can’t perform that action at this time.