This file contains 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/python3 | |
import sys | |
sys.path.append('/home/pi/fliclib-linux-hci/clientlib/python/') | |
import mpd | |
import fliclib | |
from random import choice |
This file contains 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 scapy.all import * | |
from qhue import Bridge | |
# Also remember to firewall it off, as I did use mine to order something | |
# in order to get a discount on the button. After that, I get a note in the | |
# app each time I press - which I want to surpress. | |
# I have my DHCP server always give the same IP, and then I DENY that one | |
# at my main router: | |
# iptables -I FORWARD 1 -m mac --mac-source ac:63:be:36:9b:e1 -j REJECT |
This file contains 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 csv | |
import requests | |
import glob | |
# Quick and dirty script to convert a CSV file of album names to a Spotify playlist | |
SEARCH = "https://api.spotify.com/v1/search" | |
ALBUMS = "https://api.spotify.com/v1/albums" | |
AUTH = "Bearer xxxxxxxx" # Fill in with OAUTH token | |
PLAYLIST = "https://api.spotify.com/v1/users/xxxx/playlists/xxxxxxxx/tracks" # fill in |
This file contains 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 | |
# Print a count of how many receipts were filed for each month | |
# put in receiptbank.ini | |
""" | |
[credentials] | |
login = email@example.com | |
password = yourpassword | |
""" |
This file contains 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 | |
## Convert from https://www.receipt-bank.com CSV format to QIF | |
# ./receipt-bank-to-qif.py <receipts.csv >receipts.qif | |
import csv, sys | |
rows = csv.DictReader(sys.stdin) | |
# read it all in, then we'll write out one payment method at a time |
This file contains 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 os | |
import time | |
import gc | |
import itertools | |
from svn import fs, repos, core, delta | |
# demonstrate leaking file descriptors |
This file contains 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
mkdir tmpdir | |
cd tmpdir | |
wget http://ftp.edgewall.com/pub/bitten/Bitten-0.6b2.tar.gz | |
wget http://pypi.python.org/packages/source/s/simplejson/simplejson-2.1.1.tar.gz#md5=0bbe3a2e5e4cac040013733aca159d89 | |
tar xvzf Bitten-0.6b2.tar.gz | |
tar xvzf simplejson-2.1.1.tar.gz | |
cat >>Bitten-0.6b2/setup.cfg <<EOF | |
[pytest_unittest] | |
scan = | |
bitten.tests:suite |
This file contains 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
""" | |
py.test plugin to find unittest cases using the same method that setuptools/setup.py uses. | |
We can't ready setup.py very easily though :-( So instead we'll read | |
setup.cfg and get a list of places to search for unittest tests from | |
there. | |
We read setup.cfg like this: | |
[pytest_unittest] |
This file contains 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
#!/bin/bash | |
echo "Please click on your browser" | |
BROWSER=$(xwininfo -int | awk '/Window id/ {print $4}') | |
while :; do | |
inotifywait -e close_write -r . | |
echo "Small sleep to let server restart..." | |
sleep 2 | |
echo "Sending F5" |
NewerOlder