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 | |
import calendar | |
import datetime | |
import time | |
import requests | |
from six.moves.urllib import parse as urlparse | |
TEAM = [ |
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
# kudos to dzaku at consolechars.wordpress.com | |
### MOUNT qcow2 image with lvm partitions | |
# ensure nbd can handle that many partitions | |
sudo modprobe nbd max_part=8 | |
# present image as block device through NBD | |
sudo qemu-nbd --connect=/dev/nbd0 <image.qcow2> |
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
for f in *.mp3 | |
do | |
OUTF=`echo "$f" | sed s/\.mp3$/.aac/g` | |
ARTIST=`ID3 "$f" --show-tag=GENRE| sed s/.*=//g` | |
TITLE=`ID3 "$f" --show-tag=GENRE| sed s/.*=//g` | |
ALBUM=`ID3 "$f" --show-tag=GENRE| sed s/.*=//g` | |
GENRE=`ID3 "$f" --show-tag=GENRE | sed s/.*=//g` |
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 | |
import time | |
import os | |
with open('/sys/devices/platform/lis3lv02d/position','r') as f: | |
for i in xrange(100): | |
f.seek(0) | |
data = f.read() | |
x, y, z = map(int, data.strip()[1:-1].split(',')) | |
print "{:d}\t{:d}\t{:d}".format(x, y, z) | |
if y > 200: |
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
import os | |
from novaclient import client | |
private_cidr = '10.0.0.1/24' | |
private_ports = [8020, 8021, 8030, 8031, 8032, 8033, 8040, 8041, 8042, 8088, | |
9000, 10020, 19888, 50010, 50020] | |
public_cidr = '0.0.0.0/0' | |
public_ports = [22, 80, 8080, 11000, 50030, 50060, 50070, 50075, 50090] |
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 bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# Forked by Pavlo Shchelokovskyy (pshchelo) - pshchelo.bitbucket.org | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { |
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
# Assert misuses in tests: | |
# bug/1259023 - assertIs/assertIsNone - MERGED 1/2 | |
ack "assert((Not)*Equal)\(.*(None|True|False).*\)" | |
# bug/1259292 - assertEqual (order of args) - inspect manually | |
ack "assertEqual\((.*)\)" | |
# bug/1259941 - assertIsInstance - MERGED | |
ack "assert((True|False)\(.*isinstance\(.*\).*\))|((Not)*(Equal)\(.*type\(.+\).*\))" |
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
git filter-branch --commit-filter ' | |
if [ "$GIT_COMMITTER_EMAIL" = "WRONG_EMAIL" ]; | |
then | |
GIT_COMMITTER_EMAIL="NEW_EMAIL"; | |
GIT_AUTHOR_EMAIL="NEW_EMAIL"; | |
git commit-tree "$@"; | |
else | |
git commit-tree "$@"; | |
fi' HEAD |
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 PDF or PS files to CBZ files | |
CBZ files are ZIP-compressed sets of image files, this script in particular creates PNG images | |
it takes filename and target resolution (DPI) as arguments | |
''' | |
import os, sys | |
import getopt, shutil |
NewerOlder