🤷♂️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
This is a prepare-commit-msg hook for use with git-flow and Trello | |
Copy this file to $GITREPOSITORY/.git/hooks/prepare-commit-msg | |
It will prepend [<card id>] to your commit message, and append a | |
link to the Trello card at the end of the commit message | |
Assumes you name your feature branches card-id/name. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def click_link(browser, linktext): | |
# We try five times in the case of stale element exceptions | |
for i in range(5): | |
try: | |
browser.find_link_by_text(linktext).first.click() | |
except StaleElementReferenceException: | |
pass | |
else: | |
return | |
# Try one last time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install | |
text | |
key --skip | |
keyboard us | |
lang en_US.UTF-8 | |
skipx | |
network --device eth0 --bootproto dhcp | |
rootpw %ROOTPW% | |
firewall --disabled | |
authconfig --enableshadow --enablemd5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Generate a password hash, suitable for /etc/shadow | |
Inspired by this code from OpenStack: | |
https://github.com/openstack/nova/blob/stable/grizzly/nova/virt/disk/api.py#L549 | |
Usage: | |
mkpasswd <passwd> [--algo=<hash>] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14:29:22.906758 54:78:1a:86:50:c9 (oui Unknown) > Broadcast, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.40.0.5 (Broadcast) tell 10.40.0.1, length 46 | |
0x0000: ffff ffff ffff 5478 1a86 50c9 8100 0000 ......Tx..P..... | |
0x0010: 0806 0001 0800 0604 0001 5478 1a86 50c9 ..........Tx..P. | |
0x0020: 0a28 0001 ffff ffff ffff 0a28 0005 0000 .(.........(.... | |
0x0030: 0000 0000 0000 0000 0000 0000 dac7 07ed ................ | |
14:29:23.318464 54:78:1a:86:50:cb (oui Unknown) > 0e:fc:00:ff:ff:fe (oui Unknown), ethertype 802.1Q (0x8100), length 180: vlan 0, p 0, ethertype 0x8906, | |
0x0000: 0efc 00ff fffe 5478 1a86 50cb 8100 0000 ......Tx..P..... | |
0x0010: 8906 0000 0000 0000 0000 0000 0000 002e ................ | |
0x0020: 22ff fffe 0000 0000 0129 0000 0000 0000 "........)...... | |
0x0030: 1030 ffff 0000 0000 0400 0000 2020 000a .0.............. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by iptables-save v1.4.12 on Tue Apr 2 17:30:26 2013 | |
*mangle | |
:PREROUTING ACCEPT [112473:568900113] | |
:INPUT ACCEPT [111832:568845149] | |
:FORWARD ACCEPT [641:54964] | |
:OUTPUT ACCEPT [97053:983035383] | |
:POSTROUTING ACCEPT [97694:983090347] | |
-A POSTROUTING -o virbr0 -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill | |
-A POSTROUTING -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill | |
COMMIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use LVM for partitioning | |
d-i partman-auto/method string lvm | |
# If one of the disks that are going to be automatically partitioned | |
# contains an old LVM configuration, the user will normally receive a | |
# warning. Preseed this away | |
d-i partman-lvm/device_remove_lvm boolean true | |
# And the same goes for the confirmation to write the lvm partitions. | |
d-i partman-lvm/confirm boolean true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.sessions.middleware import SessionMiddleware | |
def add_session_to_request(request): | |
"""Annotate a request object with a session""" | |
middleware = SessionMiddleware() | |
middleware.process_request(request) | |
request.session.save() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" Convert json to YAML | |
Usage: json2yaml.py [infile] | |
""" | |
import args | |
import json | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"pk": 1, | |
"model": "blog.blogpost", | |
"fields": { | |
"status": 2, | |
"expiry_date": null, | |
"allow_comments": true, | |
"description": "This is an example of a blog post.", | |
"title": "example blog post", |