Skip to content

Instantly share code, notes, and snippets.

Avatar

Jan Killian iki

View GitHub Profile
View get-kamaelia.sh
#!/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
View tmux4group.sh
#!/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"
View Sabayon_Linux_DAILY_amd64_K.update.sh
# 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 Jun 26, 2011
Kiwi Pycon Give-away
View Questions
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
View wordlist.py
#!/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 Nov 28, 2011 — forked from filippo/accept_languages.py
decode HTTP_ACCEPT_LANGUAGE headers
View accept_languages.py
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 Oct 11, 2012
building deb packages for python projects - just snippet to see how to
View make_deb.sh
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 Oct 29, 2012
Secure:always view method decorator for Google App Engine - workaround for issue 7979
View secure_view_method.py
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.
View api-ga-gae.md

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 Dec 14, 2015
Building Angular.js on Windows
View README.md

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.