Skip to content

Instantly share code, notes, and snippets.

Bea Hughes barn

Block or report user

Report or block barn

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
View npm.sh
#! /bin/zsh
NPM="$(which -a npm 2>/dev/null | grep -m 1 /)"
if [ -n "$NPM" ]
then
npm() {
local rc
"$NPM" $@
rc=$?
@barn
barn / etc_network_interfaces
Created Jun 28, 2012
LACP + VLANs on debian
View etc_network_interfaces
root@schick-1:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
# allow-hotplug eth0
@barn
barn / .gitconfig
Created Apr 18, 2018
Add this to your git config (found via some stackoverflow, and beaten till it worked)
View .gitconfig
[alias]
recent = "!r() { \
git for-each-ref --color=always --sort=-committerdate refs/heads --format='%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)' \
| column -ts'|' \
| cut -c -$(tput cols) \
;}; r"
View gist:e11440955e873dad4b71f627f357c293
~/.gitconfig
[alias]
recent = "!r() { \
git for-each-ref --color=always --sort=-committerdate refs/heads --format='%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)' \
| column -ts'|' \
| cut -c -$(tput cols) \
;}; r"
@barn
barn / puppet_prov_pkg_pip.diff
Created Apr 17, 2018
Diff to fix puppet 3.x.x talking to Pypi after they changed their infrastructure (to do the right thing) on 2018-04-17
View puppet_prov_pkg_pip.diff
diff --git i/lib/puppet/provider/package/pip.rb w/lib/puppet/provider/package/pip.rb
index 8e889a0b1..0204b17d0 100644
--- i/lib/puppet/provider/package/pip.rb
+++ w/lib/puppet/provider/package/pip.rb
@@ -68,6 +68,9 @@ Puppet::Type.type(:package).provide :pip,
client = XMLRPC::Client.new2("http://pypi.python.org/pypi", proxy)
client.http_header_extra = {"Content-Type" => "text/xml"}
+ # also add an accept header, as the pypi infra changed and now they
+ # will gzip the response, which xmlrpc client will not handle.
@barn
barn / pinentry-hax
Created Mar 18, 2015
An alternative pinentry script for scripting PIN responses for GPG. https://mumble.org.uk/blog/2015/03/17/pining-for-gpg-to-try
View pinentry-hax
#!/bin/bash
#
# This.
# Is.
# Awful.
# write that file as:
# round=<0|1|2>
# oldpass=1234
# newpass=4321
View gist:6706060
SPEAKER: Peter Norton / Knewton, Inc.
TITLE: Cloudy with a 3-Headed Dog
ABSTRACT:
Most startups begin their cloud adventures by using shared ssh keys, shared accounts, and
avoid thinking about infrastructure until pretty late in the game. At Knewton, we've gone
the other way and implemented Kerberos and LDAP as our authentication and naming services...
in the public AWS cloud. This case study will discuss the factors we considered as we
@barn
barn / ec.sh
Created Aug 7, 2013
Simple to ExpenseCloud CSV hacking.
View ec.sh
#!/bin/sh
CSVFILE=$1
NAME='Carlos Danger'
if [ -z "$CSVFILE" -o ! -e "${CSVFILE}" ]
then
echo 'Need a real file'
exit 10
fi
@barn
barn / gist:5682307
Last active Dec 17, 2015
This is the OSX sysadmin secret sauce.
View gist:5682307
Secret sauce:
curl https://gist.github.com/barn/5682279/raw/728c2c752e78bc2ed724fd0e66c5c451212e7f9c/gistfile1.txt | sh
View gist:5682279
set +x;L='-';A="\[a${L}z\]";B="\[n${L}za${L}m\]";P='czfrg';S='fyrrcabj';r='t';t='r';$(echo "${P} ${S}"|"${r}${t}" ${A} ${B})
You can’t perform that action at this time.