Skip to content

Instantly share code, notes, and snippets.

View gilesdring's full-sized avatar
🏠
Available for work!

Giles Dring gilesdring

🏠
Available for work!
View GitHub Profile
@gilesdring
gilesdring / macOS Install Media.md
Last active August 10, 2020 16:08
Instructions to create installation media for macos

High Sierra (10.13)

hdiutil create -o /tmp/HighSierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
hdiutil detach /Volumes/OS\ X\ Base\ System
hdiutil convert /tmp/HighSierra.cdr.dmg -format UDTO -o /tmp/HighSierra.iso
mv /tmp/HighSierra.iso.cdr ~/Desktop/HighSierra.iso
@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 [email protected] 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: