Skip to content

Instantly share code, notes, and snippets.

View bpholt's full-sized avatar

Brian P. Holt bpholt

View GitHub Profile
@bpholt
bpholt / npm_proxy.sh
Created March 15, 2012 23:17
NPM Proxy Server Setup
npm config set proxy http://server:port
npm config set registry "http://registry.npmjs.org/"
@bpholt
bpholt / proxy.sh
Created April 27, 2012 16:40
Script to set an HTTP proxy if it is accessible on the network
#!/usr/bin/env bash
PROXY_AUTH=user:password
PROXY_HOST=proxy.example.com
PROXY_PORT=:80
PROXY_EXCLUDE=".example.com,localhost,127.0.0.1/32,10.0.0.0/8"
# First, remove any existing proxy definitions in /etc/yum.conf
if [ -w /etc/yum.conf ]; then
sed -i "/^proxy=.*/d" /etc/yum.conf
@bpholt
bpholt / gist:2514187
Created April 27, 2012 23:12
Puppet links
NCState Linux kickstart -> http://www.linux.ncsu.edu/realm_linux/usersguide-EL4/ch07.php
FermiLab's Anaconda Wiki -> http://fermilinux.fnal.gov/distribution/slf-5/installation/kickstart
Bootstrapping Puppet Agent on CentOS6 -> https://github.com/ahamilton55/Blog-Scripts/blob/master/puppet_agent_install/centos6_setup.sh
Custom Kickstart Process -> http://smorgasbork.com/component/content/article/35-linux/128-building-a-custom-centos-6-kickstart-disc-part-1
VMWare Template MAC Addresses -> https://peterpap.net/index.php/Creating_a_CentOS%5CRed_Hat_VMware_template
creating a minimal centos vm -> http://lsimons.wordpress.com/2011/06/03/creating-a-minimal-centos-vm/
Unit Testing in Puppet -> http://www.jedi.be/blog/2011/12/05/puppet-unit-testing-like-a-pro/
@bpholt
bpholt / Pro.terminal.xml
Last active October 6, 2015 21:28
Pro Terminal Settings with working Home and End Keys
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlueColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPEB4w
IDAuMDAzNjEwNTAyODYzIDAuODQ0NzY5MDIxNwAQAYAC0hAREhNaJGNsYXNzbmFtZVgk
Y2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hpdmVy0RcYVHJv
@bpholt
bpholt / puppet-check.sh
Last active February 14, 2017 21:54
Puppet Module Syntax Check, Lint, Run Tests, and ERB Syntax Check. There is almost certainly a better way to do this.
#!/bin/bash
# Run from the base directory of your Puppet module
echo ===================
echo Parser Validation
echo ===================
find . -name "*.pp" | xargs -n 1 -t puppet parser validate
echo ===================
echo Linting
@bpholt
bpholt / HttpHeaderRegex.js
Last active December 18, 2015 17:19
JavaScript regular expression to find headers in an HTTP response
TestCase('regex to find HTTP headers', {
headerFinderRegex: /^([-!#-'*+.0-9A-Z^-z|~]+:)/gm,
'test only valid headers are highlighted': function () {
var addValue = function(s) { return s + ' value\n';},
addColon = function(s) { return s + ':';},
wrapWithStrong = function(s) { return "<strong>" + s + "</strong>";},
invalidCharacters = (function() {
var invalidCharacters = ["(", ")", "<", ">", "@", ",", ";", ":", "\\", '"', "/", "[", "]", "?", "=", "{", "}", ' ', '\t'];
@bpholt
bpholt / albumParser.js
Created November 7, 2013 01:50
Gallery2 Album to HiDPI <img>s
(function (albumID, $) {
'use strict';
$.extend({
interpolate: function (s, data) {
var variable;
for (variable in data) {
if (data.hasOwnProperty(variable)) {
s = s.replace(new RegExp('{' + variable + '}', 'g'), data[variable]);
}
@bpholt
bpholt / touchGlobalPreferences.sh
Created May 11, 2014 23:54
May fix 3/4 finger multitouch when it stops working
touch ~/Library/Preferences/ByHost/.GlobalPreferences.*.plist
@bpholt
bpholt / keybase.md
Created January 25, 2015 22:29
Keybase.io Verification

Keybase proof

I hereby claim:

  • I am bpholt on github.
  • I am bpholt (https://keybase.io/bpholt) on keybase.
  • I have a public key whose fingerprint is 525E 6B7F 3661 69C0 DA65 06EF 9F39 C3CD 3382 E6FC

To claim this, I am signing this object: