Skip to content

Instantly share code, notes, and snippets.

@brianlechthaler
brianlechthaler / namegen.sh
Created October 21, 2015 17:01
Name Generator
echo First word, Adjective:
curl -s "http://api.wordnik.com:80/v4/words.json/randomWord?hasDictionaryDef=false&includePartOfSpeech=adjective&minCorpusCount=0&maxCorpusCount=-1&minDictionaryCount=1&maxDictionaryCount=-1&minLength=5&maxLength=-1&api_key=YOUR_API_KEY_HERE"
echo
echo
echo Second word, Noun:
curl "http://api.wordnik.com:80/v4/words.json/randomWord?hasDictionaryDef=false&includePartOfSpeech=noun&minCorpusCount=0&maxCorpusCount=-1&minDictionaryCount=1&maxDictionaryCount=-1&minLength=5&maxLength=-1&api_key=YOUR_API_KEY_HERE"
echo
echo
echo Now, combine these two, and you have your name.
echo For example, if your two words were ‘taught’ and ‘webzines’, your name would be TaughtWebzines.
@skoji
skoji / remove-slack-settings.sh
Created November 2, 2015 03:34
remove Slack settings (OS X)
rm -rf ~/Library/Application\ Support/Slack/
rm -rf ~/Library/Containers/com.tinyspeck.slackmacgap/
rm -rf ~/Library/Preferences/com.tinyspeck.slackmacgap.plist
rm -rf ~/Library/Saved\ Application\ State/com.tinyspeck.slackmacgap.savedState
rm ~/Library/Safari/LocalStorage/*slack*
@dlamotte
dlamotte / pex-build.py
Last active November 30, 2017 10:10
Using pex to build a single python executable (minimal requirements)
#!/usr/bin/env python2.7
from pex.pex_builder import PEXBuilder
from pex.resolvable import resolvables_from_iterable
from pex.resolver import CachingResolver
from pex.resolver_options import ResolverOptionsBuilder
import argparse
import os
import shutil
import sys
@Sinnohd
Sinnohd / keyrotate.py
Created January 5, 2016 10:26
Script to rotate AWS keys and replace them in .boto and .aws/config
#!/usr/bin/python
import boto.iam, boto.exception
import argparse, os
import ConfigParser
parser = argparse.ArgumentParser(description="Rotate Access Keys.")
parser.add_argument(
"-p",
"--profile",
@justinclayton
justinclayton / taint_module.sh
Created January 19, 2016 18:48
Terraform: taint all resources from one module
#!/bin/bash
module=$1
for resource in `terraform show -module-depth=1 | grep module.${module} | tr -d ':' | sed -e 's/module.${module}.//'`; do
terraform taint -module ${module} ${resource}
done
@travisjeffery
travisjeffery / functional-options.md
Last active April 23, 2023 11:13
How to do functional options in Golang

Here's the simplest example showing how to do functional options in Golang.

They're a great way to enable users to set options and ease adding new options later.

package main

import (
	"flag"
	"fmt"
@mcastelino
mcastelino / iptables-cheatsheet.md
Last active January 15, 2026 23:09
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active January 8, 2026 15:29
Hyperlinks in Terminal Emulators
anonymous
anonymous / config
Created August 13, 2017 15:06
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@esamattis
esamattis / systemdunit.py
Last active November 10, 2021 23:04
Install Systemd units using Ansible
"""
Install Systemd units using Ansible
Handles unit restarting and systemd daemon reloading when the unit changes.
Also stops the unit correctly when uninstalled
In your playbook put this file to library/systemdunit.py and make sure the
server has python-sh package installed