Skip to content

Instantly share code, notes, and snippets.

Paul Durivage angstwad

View GitHub Profile
View 1-Force RGB mode for OS X
This Gist contains the script and generated output file for an Acer B276HUL.
To "install" the output file, put it in `/System/Library/Displays/Overrides/DisplayVendorID-472`
The pre-generated file below is known to work with:
* OS X Mavericks
* OS X Yosemite
View index.html
<!DOCTYPE html>
<html ng-app="myApp">
<meta name="description" content="Trigger toasters on events">
<script src=""></script>
<link href="" rel="stylesheet" type="text/css" />
<script src=""></script>
<script src=""></script>
<link href="" rel="stylesheet" />
<script src="" ></script>
sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original
# for Mountain Lion 10.8.3 - 10.8.4
sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
# for Mountain Lion 10.8.1-10.8.2 and Lion 10.7.5
#sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x4D)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
# for Mountain Lion 10.8.0 and Lion 10.7.4 BELOW
#sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x51)|
angstwad / dtl-link.html
Last active Jul 12, 2016
Dare to Listen Embed Link
View dtl-link.html
View keymap.cson
# These keybindings are a combination of IntelliJ's OS X 10.5+ keybindings
# and additive ones from Pivotal's practice. And extended by @andre487
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it here:
# Project navigation
View iTerm 2 Monokai.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<key>Ansi 0 Color</key>
<key>Alpha Component</key>
<key>Blue Component</key>
angstwad /
Last active May 26, 2017
Python Retry Decorator
import time
import functools
def retry(wait, retries=3, reraise=True):
""" Decorator retries a function if an exception is raised during function
invocation, to an arbitrary limit.
:param wait: int, time in seconds to wait to try again
:param retries: int, number of times to retry function. If None, unlimited
angstwad / test_split_jinja_ansible.yml
Created Mar 31, 2014
Splitting in Jinja2/Ansible
View test_split_jinja_ansible.yml
- name: Test split
hosts: localhost
gather_facts: false
- facter_blockdevices: "sda,sdb,sdc,sdd,sde,sdf"
- name: Let's split
debug: var=item
with_items: "facter_blockdevices.split(',')"
angstwad /
Created Mar 25, 2020
Snippets for Blog: Solving a Set Cover Problem in Cloud IAM on GCP
import json
from googleapiclient import discovery
# Fetch most up to date role list and role descriptions from API
iam ='iam', 'v1')
raw_role_data = {}
# Build initial request
angstwad / set_cover_2.json
Created Mar 25, 2020
Snippets for Blog: Solving a Set Cover Problem in Cloud IAM on GCP
View set_cover_2.json
"roles/accessapproval.approver": {
"name": "roles/accessapproval.approver",
"title": "Access Approval Approver",
"description": "Ability to view or act...",
"includedPermissions": [
You can’t perform that action at this time.