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 | |
# tested with transmission-remote 2.51 (13280) | |
# call like: | |
# $ transmission-remote -l | ./sum_up.py | |
# units: https://en.wikipedia.org/wiki/Megabyte | |
import sys | |
total = 0 | |
input = sys.stdin | |
for l in input: |
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 sh | |
# Download lists, unpack and filter, write to gzipped file | |
curl -s https://www.iblocklist.com/lists.php \ | |
| grep -A 2 Bluetack \ | |
| sed -n "s/.*value='\(http:.*\)'.*/\1/p" \ | |
| xargs wget -O - \ | |
| gunzip \ | |
| egrep -v '^#' \ | |
| gzip - > bt_blocklist.gz |
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
### Keybase proof | |
I hereby claim: | |
* I am flowolf on github. | |
* I am flowolf (https://keybase.io/flowolf) on keybase. | |
* I have a public key whose fingerprint is 82CB C28E 4125 ABF9 DB0C 0E07 0167 D15E 878D 8361 | |
To claim this, I am signing this object: |
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
# Python solution to the puddle problem | |
# from: http://qandwhat.apps.runkite.com/i-failed-a-twitter-interview/ | |
# | |
# single pass, streaming capable. O(n), memory as much as wall size. | |
# | |
def calc_vol(a): | |
vol = 0 | |
count = [0] | |
maxi = 0 | |
last = 0 |
NewerOlder