-
Install
colordiff
using Homebrew:brew install colordiff
-
Add function to your
~/.bash_profile
:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
api_key="" # API key from Grafana Cloud | |
metrics_user="" # Graphite username from Grafana Cloud console | |
metrics_endpoint="" # Graphite endpoint from Grafana Cloud console | |
now=$(date +%s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spfincludelookup() { for entry in $(dig +short TXT "$@" |grep --color=never spf); do [ "${entry:0:7}" == "include" -o "${entry:0:6}" == "exists" ] && echo $entry && spfincludelookup ${entry:8}; done; } | |
spfincludelookup "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Filter input to remove content matching regexp, then output to stdout. | |
# | |
# Example: | |
# cat data.sql | python3 re-filter.py "CREATE TRIGGER.*?;" | |
# | |
import re | |
import sys | |
matcher = re.compile(sys.argv[1], re.MULTILINE | re.DOTALL | re.IGNORECASE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILE=$1 | |
NUM=$2 | |
[ "$3" == "-v" ] && VERBOSE=1 | |
usage() { | |
echo "Usage: $0 <file of URLs> <number of requests to do per URL> [-v]" >&2 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RunParallel is a drop-in replacement for testify/suite.Run that runs | |
// all tests in parallel. | |
// | |
// It uses reflection to create a new instance of the suite for each | |
// test | |
func RunParallel(t *testing.T, userSuite suite.TestingSuite) { | |
if _, ok := userSuite.(suite.SetupAllSuite); ok { | |
t.Log("Warning: SetupSuite exists but not being run in parallel mode.") | |
} | |
if _, ok := userSuite.(suite.TearDownAllSuite); ok { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# pgpool-II replication manager | |
# | |
# Interfaces with pgpool's pcp command-line tools to provide access to common functions for managing | |
# load-balancing and failover. | |
# | |
# dsimmons@squiz.co.uk | |
# 2011-08-28 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Foundation import CFPreferencesSetValue | |
from Foundation import CFNotificationCenterPostNotification | |
from Foundation import CFNotificationCenterGetDistributedCenter | |
from Foundation import kCFPreferencesAnyApplication | |
from Foundation import kCFPreferencesCurrentUser | |
from Foundation import kCFPreferencesCurrentHost | |
# Remove offending preference | |
CFPreferencesSetValue('AppleInterfaceStyle', None, kCFPreferencesAnyApplication, | |
kCFPreferencesCurrentUser, kCFPreferencesCurrentHost) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Print a reminder if a fetch has not been done in n hours. | |
# | |
# There are multiple ways you could invoke this; for example, to have it run | |
# whenever you change directory you could do: | |
# | |
# cd() { command cd "$@"; ~/bin/git-fetch-reminder.sh 2>/dev/null; } | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*~ | |
*.pyc | |
.vagrant | |
venv |