Skip to content

Instantly share code, notes, and snippets.

View iki's full-sized avatar

Jan Killian iki

View GitHub Profile
#!/bin/sh
VER=0.9.8.0
MD5=13c5539712041c80b1a9ec65515694fd
APP=Kamaelia-$VER
PKG=Original-$APP-with-Axon.tar.gz
URL=http://www.kamaelia.org/release/MonthlyReleases/$APP.tar.gz
DST=dist-external
if [ "$OS" = "Windows_NT" ]; then
#!/bin/sh
N="${1:-projectx}"
I="${2:-0}"
echo "=== Opening terminal multiplexer server [$N] session [$I]"
G="tmux-$N" # group name
D="/var/lib/tmux/sockets/$N"
S="$D/.shared"
# Download/update daily Sabayon Linux image via rsync
# List of mirrors: http://www.sabayon.org/download
# Available files: http://na.mirror.garr.it/mirrors/sabayonlinux/iso/daily/
# Settings:
R=rsync://na.mirror.garr.it/sabayonlinux/iso/daily
# R=rsync://ftp.sh.cvut.cz/sabayon/iso/daily # frozen on 2010-05-15
N=Sabayon_Linux_DAILY_
T=. # target directory
@iki
iki / Questions
Created June 26, 2011 08:47
Kiwi Pycon Give-away
GitHub username: iki
Day job: freelance dev
Favorite open source project: linux, python, ruby
Open Source contributions (if any): python modules
Stranded on an island, what 3 items do you take: zippo, machette, solar powered netbook with gps
Tie-breaker, pick a number between 1 and 20,000: 2829
#!/usr/bin/env python
"""Test wordlist parsing speed.
See http://news.ycombinator.com/item?id=2716714
Use with /usr/share/dict/words,
or e.g. http://www.freebsd.org/cgi/cvsweb.cgi/src/share/dict/web2?rev=1.14;content-type=text/plain
"""
import pickle
@iki
iki / accept_languages.py
Created November 28, 2011 14:29 — forked from filippo/accept_languages.py
decode HTTP_ACCEPT_LANGUAGE headers
def accept_languages(browser_pref_langs):
"""Parses the request and return language list.
browser_pref_langs is the plain Accept-Language http request header
value.
Stolen from Products.PloneLanguageTool, under GPL (c) Plone Foundation,
slightly modified.
Taken from tweetengine http://github.com/Arachnid/tweetengine/
"""
browser_pref_langs = browser_pref_langs.split(',')
i = 0
@iki
iki / make_deb.sh
Created October 11, 2012 09:45
building deb packages for python projects - just snippet to see how to
make_deb () { # dscfile|srcdir [destdir] [[backportable:] build_dependencies..] [signkey_id] [buildpackage_options..]
local S D BD K SA SX SI ST T W X AA A
S="$1"; D="${2:-.}"; BD="$3"; K="$4"; [ $# -ge 4 ] && shift 4 || shift $#
[ -d "$S" ] && SA='debian source control' && SX='temporary' && SI="$S/debian/control" && ST="$S/debian/changelog"
[ ! -d "$S" ] && SA='debian source archive' && SX='extracted' && SI="$S" && ST=
check_file existing: "$SA" "$SI" || return $?
[ -f "$ST" ] || ST="$SI"
@iki
iki / secure_view_method.py
Created October 29, 2012 15:57
Secure:always view method decorator for Google App Engine - workaround for issue 7979
import os
import logging
from functools import update_wrapper
def secure(view_method):
"""Decorates view/handler method to redirect to https if requested over http.
Equivalent to handler setting secure:always in app.yaml.
Provided as a workaround for App Engine issue 7979.
@iki
iki / api-ga-gae.md
Last active December 14, 2015 01:09

Using API's on Google App Engine

Demo and code

Missing presentable (non-internal) implementation atm. Maybe on later Pyvo's:

>>> from future import demo

@iki
iki / README.md
Last active December 14, 2015 18:49
Building Angular.js on Windows

Building Angular.js on Windows

Current grunt based build

  1. Install grunt launcher.

     npm install -g grunt-cli
    
  2. Run grunt as Administrator. That's needed to create directory symlinks using mklink /d.