Skip to content

Instantly share code, notes, and snippets.

@andersonvom
andersonvom / xcquiet.sh
Last active Apr 1, 2021
xcquiet hides a lot of the verbosity of xcodebuild without accidentally hiding useful, unexpected log entries.
View xcquiet.sh
#!/bin/bash
# Do you find `xcodebuild` too verbose but don't want `xcpretty`
# to swallow ALL the output, including sometimes useful output,
# all so that you can have more sane logs for your iOS builds?
# You also think using `-quiet` hides way too much info as well?
#
# This little snippet hides a lot of the verbosity of xcodebuild
# without accidentally hiding unexpected log lines.
#
# Usage: xcodebuild ... | xcquiet.sh
@andersonvom
andersonvom / clone_org
Last active Jan 25, 2017
This script clones all public repos from a given github organization in parallel
View clone_org
#!/bin/bash
if [ "$1" == "" ]; then
app=$(basename ${0})
echo "Usage: $app <organization_name> [<curl opts>]"
echo " e.g. $app twitter # clone all public repos from <twitter>"
echo " e.g. $app syncthing -u andersonvom # clone all public and private repos from <syncthing> that <andersonvom> has access to"
exit 1
fi
@andersonvom
andersonvom / boxstarter-windev.ps1
Last active Nov 29, 2016
BoxStarter .NET development box
View boxstarter-windev.ps1
# Enable Developer Mode & Install Bash
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
# Microsoft-Windows-Subsystem-Linux doesn't seem to be working =(
# Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux" -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName "TelnetClient" -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -All -NoRestart
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Set-TaskbarOptions -Size Small -Combine Full
View keybase.md

Keybase proof

I hereby claim:

  • I am andersonvom on github.
  • I am andersonvom (https://keybase.io/andersonvom) on keybase.
  • I have a public key ASAqerC--v3FKqCzQSi19OMHm2Ova29u04A9ClEfLf6bjgo

To claim this, I am signing this object:

@andersonvom
andersonvom / set.vs.inclusion.test.py
Created Nov 25, 2015
This is why you should use sets and not roll out your own implementation of set operations in python (or any language)
View set.vs.inclusion.test.py
import random
import time
stop = 100000
difference_count = 10000
all_keys = range(stop)
random.shuffle(all_keys)
diff_keys = [random.randint(0, stop) for i in range(difference_count)]
s = time.time()
@andersonvom
andersonvom / slack-ignore-attachments.js
Created Nov 19, 2015
Ignore slack image attachments
View slack-ignore-attachments.js
// ==UserScript==
// @name Hide Slack.com image attachments
// @namespace https://gist.github.com/andersonvom/f99e5cc08b6f4e221471
// @version 0.0.1
// @description Ignore slack.com image attachments, but still leaves the original link
// @author andersonvom
// @match https://*.slack.com/*
// @grant none
// ==/UserScript==
View greview
#!/bin/bash
# This script will submit all pending commits to gerrit and will automatically
# add reviewers to the associated change. Reviewers can be added by simply
# listing them after greview. You can either enter their full email addresses
# or just partially enter a unique combination of letters that will be
# fuzy-matched to either the email or the name of the commiters.
#
# Usage: greview <reviewer-1> <reviewer-2> ...
@andersonvom
andersonvom / .gitignore
Last active Nov 4, 2015
Connect to two OpenVPNs in sequence where the first one uses token auth
View .gitignore
creds.yml
*.ovpn
*.crt
@andersonvom
andersonvom / bootstrap-puppetmaster.sh
Created Jul 23, 2015
Bootstrap script to set up puppetmaster according to openstack-infra/system-config
View bootstrap-puppetmaster.sh
#!/bin/bash
apt-get update
apt-get upgrade -y
apt-get install git -y
git clone https://git.openstack.org/openstack-infra/system-config /opt/system-config/production
/opt/system-config/production/install_puppet.sh
apt-get install puppetmaster-passenger hiera hiera-puppet -y
export REAL_HOSTNAME=puppetmaster.openstack.org
@andersonvom
andersonvom / executive_orders.sh
Last active Aug 29, 2015
Gather number of executive orders by president, by year
View executive_orders.sh
#!/bin/bash
temp_dir=$(mktemp -d /tmp/orders.XXXX)
pushd $temp_dir
for year in $(seq 1994 2014) 2001-clinton 2001-wbush 2009-wbush 2009-obama
do
echo Downloading $year
wget -q "http://www.archives.gov/federal-register/executive-orders/$year.html"
done