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 |
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
#!/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
#!/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
#!/bin/bash | |
# get a country statistic for Fail2Ban blocks: | |
# this just accounts for IPs once. Multiple failed attempts by one IP just show up once for a country. | |
for i in `sudo cat /var/log/fail2ban.log | sed 's/.*[Bb]an \(.*\)/\1/' | sort | uniq | cut -d ' ' -f 1 | grep "\."`; | |
do | |
echo $i; whois $i | grep country\: |head -n 1 >> fail2ban_ctry.log ; | |
done | |
cat fail2ban_ctry.log | sed 's/country: //g' |sort | uniq -c | sort -nr |
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
-- Prosody XMPP Server Configuration | |
-- | |
-- Information on configuring Prosody can be found on our | |
-- website at http://prosody.im/doc/configure | |
-- | |
-- Tip: You can check that the syntax of this file is correct | |
-- when you have finished by running: luac -p prosody.cfg.lua | |
-- If there are any errors, it will let you know what and where | |
-- they are, otherwise it will keep quiet. | |
-- |
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
/* | |
This is an Overpass query. | |
It queries all phone booths in Austria. | |
*/ | |
area | |
[admin_level=2] | |
["boundary"="administrative"] | |
["name"="Österreich"]->.a; | |
node | |
(area.a) |
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
# my working salt postgres config (updated since first post on IRC #salt) | |
postgres_server: | |
pkg: | |
- installed | |
- pkgs: | |
- postgresql | |
service: | |
- running | |
- name: postgresql | |
- enable: 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
/** | |
* door lock application (c) 2011 Florian Klien | |
* some code parts are borrowed from different authors ;) thx | |
*/ | |
#include <NewSoftSerial.h> | |
#define rxPin 2 | |
#define txPin 3 |
OlderNewer