Skip to content

Instantly share code, notes, and snippets.

View gilesdring's full-sized avatar
🏠
Working from home

Giles Dring gilesdring

🏠
Working from home
View GitHub Profile
@gilesdring
gilesdring / augeas_commands.md
Last active September 27, 2017 22:12
Augeas commands

Load and manipulate an arbitrary file

augtool --root --noautoload --transform "Xml.lns incl /file.xml"

@gilesdring
gilesdring / megamd5.sh
Created November 23, 2016 13:34
Creates an MD5 for all the files in a directory. Useful for checking a whole set of files have been transferred correctly.
find . -type f | xargs openssl md5 | cut -f2 -d' ' | sort | openssl md5
@gilesdring
gilesdring / Hebalyzer.md
Last active November 11, 2016 11:43
Hebalyzer

Hebalyzer

@gilesdring
gilesdring / autochangelog.sh
Last active October 14, 2016 13:04
Automatically prepending to CHANGELOG.md
#!/usr/bin/env bash
# Deal with case that we're on the initial commit
[[ $(git rev-parse HEAD) == $(git rev-list --max-parents=0 HEAD) ]] || PARENT="HEAD^.."
cat <(git log ${PARENT}HEAD --format=format:'# %s - %h - %ai%n%n%b%n') CHANGELOG.md > CHANGELOG.tmp
mv CHANGELOG.tmp CHANGELOG.md
@gilesdring
gilesdring / saml_dump.py
Created October 7, 2016 18:50
Simple python listener to dump a SAML Response
#!/usr/bin/env python3
'''
Dummy SAML listener to dump the SAMLResponse key from the request body
Start with `python3 saml_dump.py`
'''
import base64
import urllib.parse
from http.server import HTTPServer, BaseHTTPRequestHandler
@gilesdring
gilesdring / cheatsheet.md
Last active April 20, 2016 11:16
Because I always need to look stuff up

RPM Cheat

List scripts in an RPM

rpm -qp <path to rpm> --scripts

Mac OS X networking

List resolvers in use

Verifying that +gilesdring is my blockchain ID. https://onename.com/gilesdring

Creating a blank array

The following incantation creates an array of length 10.

Array.apply(null, {length: 10})

@gilesdring
gilesdring / hbhackathon.md
Created September 30, 2015 13:27
Helpful info for the hackathon at Hebden Bridge Town Hall

Can't access ssh over The Town Hall network

This affects git@github.com clones, which caused me an issue with bower. The fix in this case is to cause git to use https:// rather than git:// by running this command in the working directory:

git config url."https://".insteadOf git://

To revert the setting run:

@gilesdring
gilesdring / IMAP_test.md
Last active September 28, 2015 12:15
Testing IMAP connections