Skip to content

Instantly share code, notes, and snippets.

View breiter's full-sized avatar
🖖

Brian Reiter breiter

🖖
View GitHub Profile
@breiter
breiter / brew
Created March 15, 2016 14:08
brew wrapper to set HOMEBREW_CASK_OPTS
#!/bin/sh
# work around brew "feature" where it ignores HOMEBREW_CASK_OPTS when
# run with sudo.
HOMEBREW_CASK_OPTS="--appdir=/Applications" /opt/homebrew/bin/brew $@
@breiter
breiter / brew-cask-upgrade
Last active March 15, 2016 14:09
Script to update installed Homebrew casks that are not tracked by brew udpate
#!/bin/sh
# brew upgrade often fails to update brew casks
# this script upgrades any brew casks where the cached version is older than the current version or cache has been deleted
# some casks, like Skype, have no versioning at all. This script always forces unversioned "latest" casks to re-install
# from the latest download.
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'

Keybase proof

I hereby claim:

  • I am breiter on github.
  • I am breiter (https://keybase.io/breiter) on keybase.
  • I have a public key whose fingerprint is D820 1C5E E4B4 A5D8 3C5A D14E 1F9F 620B 1AE3 0378

To claim this, I am signing this object:

@breiter
breiter / configure-pat.sh
Created August 25, 2014 10:16
Linux NAT instance script for EC2 invoked from rc.local.
#!/bin/bash
# Configure the instance to run as a Port Address Translator (PAT) to provide
# Internet connectivity to private instances.
function log { logger -t "vpc" -- $1; }
function die {
[ -n "$1" ] && log "$1"
log "Configuration of PAT failed!"
exit 1
@breiter
breiter / otp
Last active November 29, 2018 20:29
Script to drive oathtool to create TOTP one-time passwords for amazon, github, google, evernote, msft, etc.
#!/bin/sh
scriptname=`basename $0`
if [ -z $1 ]; then
echo "Generate OATH TOTP Password"
echo ""
echo "Usage:"
echo " $scriptname google"
echo ""
echo "Configuration: $HOME/.otpkeys"
@breiter
breiter / mon-put-metrics-mem.ps1
Last active July 9, 2019 09:50
Script to monitor EC2 windows memory stats in CloudWatch
<#
Copyright 2012-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
@breiter
breiter / .bash_profile
Last active December 10, 2019 10:32
OS X Bash profile
# MacPorts Installer addition on 2012-07-11_at_19:18:58: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
# pip modules install path
export PATH=$PATH:/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/
# node modules install path
export PATH=$PATH:~/node_modules/.bin
@breiter
breiter / clamav.conf
Last active June 6, 2020 19:08
launchd plists for ClamAV daemon control on OS X
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/opt/local/var/log/clamav/*.log 644 3 1000 * J
@breiter
breiter / install-dotnet-core-scripts.sh
Created June 17, 2020 11:39
Install scripts to manage dotnet core SDKs
#!/bin/sh
curl -sSL https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh \
| sudo tee /usr/local/bin/dotnet-uninstall-pkgs > /dev/null
sudo chmod +x /usr/local/bin/dotnet-uninstall-pkgs
curl -sSL https://dot.net/v1/dotnet-install.sh \
| sudo tee /usr/local/bin/dotnet-install > /dev/null
chmod +x /usr/local/bin/dotnet-install
curl -sSL https://gist.github.com/breiter/aef0c0acbeb24cabe0fa16c7ecfdb88c/raw/b4e9de4b20141b0a05aadd03d5842752104b1475/dotnet-upgrade-sdks.sh \
| sudo tee /usr/local/bin/dotnet-upgrade-sdks > /dev/null
@breiter
breiter / dotnet-upgrade-sdks.sh
Last active June 17, 2020 11:56
Script to maintain dontet core SDK with the current latest LTS versions
#!/bin/sh
# Get the MSFT uninstall script from GitHub:
#
# curl -sSL https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh | sudo tee /usr/local/bin/dotnet-uninstall-pkgs > /dev/null
# sudo chmod +x /usr/local/bin/dotnet-uninstall-pkgs
#
uninstall_cmd=dotnet-uninstall-pkgs
# MSFT install script documented on docs.microsoft.com