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 click | |
@click.group() | |
@click.option('--foo', help='This is great.') | |
def cli(foo): | |
pass |
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
Options -Indexes | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ http://lakka.n.kapsi.fi:31859/$1 [L,P] |
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 python3 | |
# Joonas Kuorilehto 2013 | |
# This script is Public Domain. | |
import csv | |
import subprocess | |
import pipes | |
from datetime import datetime | |
import smtplib |
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 | |
# Sort Wells Fargo CSV account activity by actual payment date, not post date | |
# By Joonas Kuorilehto. This script is Public Domain. | |
# Input: CSV file downloaded from Wells Fargo account activity | |
# Output: list of payments by transaction date | |
import re | |
import csv | |
import sys |
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
#encoding: utf-8 | |
class Node: | |
left = None | |
right = None | |
parent = None | |
key = None | |
def __init__(self, key): | |
self.key = key |
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 | |
# Git clone all my gists | |
import json | |
import urllib | |
from subprocess import call | |
from urllib import urlopen | |
import os | |
USER = os.environ['USER'] |
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
function zfs-snapshots () { | |
if [[ $PWD =~ "/.zfs" ]]; then | |
echo "Not supported under .zfs directory" | |
return | |
fi | |
local oIFS | |
declare -A snapshots | |
oIFS=$IFS | |
IFS=$'\t' # the display name and path are \t separated, \0 terminated | |
snapshot_list=() |
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 python3 | |
# Joonas Kuorilehto 2011 | |
import os.path | |
from subprocess import Popen, PIPE | |
import shutil | |
from contextlib import contextmanager | |
from tempfile import mkdtemp |
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 | |
print "Content-type: text/plain; charset=UTF-8" | |
import os | |
ignore_these = [ | |
'PATH', | |
'DOCUMENT_ROOT', |
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 | |
IRSSI=$(pgrep irssi) | |
while [[ -n $IRSSI ]]; do | |
tokill=$(pgrep irssi | head -n 100) | |
kill $tokill | |
echo "Killing 100 irssis. Hit enter to kill more." | |
echo $(pgrep irssi|wc -l) to go | |
read | |
IRSSI=$(pgrep irssi) |