Skip to content

Instantly share code, notes, and snippets.

Ben 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
@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.
View gist:b7e0ce4c3354b65aac0a
installing default objspace libraries
compiling ossl_asn1.c
In file included from ossl_asn1.c:11:
In file included from ./ossl.h:213:
./openssl_missing.h:71:6: error: conflicting types for 'HMAC_CTX_copy'
void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
^
/usr/local/include/openssl/hmac.h:101:5: note: previous declaration is here
int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
^
View gist:57f92f8868d984f03775
[:~]% ls -l sb3*
-rw-r--r--@ 1 bhughes staff 23225244 27 Jul 21:29 sb3.mp3
-rw-r--r-- 1 bhughes staff 22159194 27 Jul 21:29 sb3_gz.mp3.gz
-rw-r--r-- 1 bhughes staff 21887200 27 Jul 21:29 sb3_xz.mp3.xz
@barn
barn / mutt-hash-fingerprints-patch.diff
Created Jul 14, 2015
Patch for mutt 1.5.23 to show more hash fingerprints for unknown certificates.
View mutt-hash-fingerprints-patch.diff
--- a/mutt_ssl.c Sun Jul 05 13:38:39 2015 -0700
+++ b/mutt_ssl.c Tue Jul 14 19:00:46 2015 +0100
@@ -551,7 +551,7 @@
return ret;
}
-static void x509_fingerprint (char *s, int l, X509 * cert)
+static void x509_fingerprint_md5 (char *s, int l, X509 * cert)
{
unsigned char md[EVP_MAX_MD_SIZE];
View skittles.pp
everything{ 'worst':
cant => even,
}
@barn
barn / gist:d79ec61526d32f977501
Created Apr 14, 2015
dumping osx system certs to a PEM file
View gist:d79ec61526d32f977501
ohessten% security find-certificate -a /System/Library/Keychains/SystemRootCertificates.keychainc >osx_system_roots.pem
ohessten% /path/to/homebrew/bin/openssl s_client -CAfile osx_system_roots.pem -verify 5 -connect sketchy.example.org:443
View gist:ff7c9ca7bf7c85de8b8e
[3036:~]% go build pflog.go
[3036:~]% otool -L pflog
pflog:
@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
You can’t perform that action at this time.