Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python3
import sys
sys.path.append('/home/pi/fliclib-linux-hci/clientlib/python/')
import mpd
import fliclib
from random import choice
# http://www.waveshare.com/wiki/4.3inch_e-Paper
# Using FTDI cable - screen Green to FTDI Orange; screen White to FTDI Yellow
import serial
import binascii
import epd
# epd is from https://github.com/yy502/ePaperDisplay/blob/master/epd.py
# Note, using my FTDI USB serial cable - couldn't get rpi UART on 14/15 to work - writes always hung
rate = 115200
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
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
#!/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
"""
@nicholas-gh
nicholas-gh / receipt-bank-to-qif.py
Created September 13, 2011 13:33
Receipt Bank to QIF
#!/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
#!/usr/bin/python
import os
import time
import gc
import itertools
from svn import fs, repos, core, delta
# demonstrate leaking file descriptors
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
"""
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]
#!/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"