Skip to content

Instantly share code, notes, and snippets.

View kstep's full-sized avatar
🗺️

Konstantin Stepanov kstep

🗺️
View GitHub Profile
@kstep
kstep / Pearlwall.pm
Created January 15, 2012 14:45
Perl-based language to describe iptables rules
use strict;
package Pearlwall;
use base 'Exporter';
our @EXPORT = qw(iface port net mode oneof from to filter mangle nat raw flush with by user group marked list forwarding chain record on off);
my $_table = '';
my $_dry_run = 0;
BEGIN {
@kstep
kstep / gist:1615974
Created January 15, 2012 14:15
Me and My Shadow pkgbuild for ArchLinux
# Maintainer: Konstantin Stepanov <[email protected]>
pkgname=meandmyshadow
pkgdesc='Puzzle/platform game written by Luka Horvat.'
url='http://meandmyshadow.sourceforge.net/index.html'
pkgrel=1
pkgver=0.2
arch=('i686' 'x86_64')
provides=('meandmyshadow')
source=("$pkgname-$pkgver-src.tar.gz::https://sourceforge.net/projects/$pkgname/files/0.2/$pkgname-$pkgver-src.tar.gz/download")
@kstep
kstep / imgur.py
Last active August 10, 2024 22:25
#!/usr/bin/python
from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
import urllib2
import simplejson
import sys
try:
input_file = open(sys.argv[1], 'rb')
@kstep
kstep / gist:982872
Created May 20, 2011 13:20
List torrent file
perl -ne 'while (/(?:name|pathl)(\d+):/gc) { $n = $1; /(.{$n})/gc; print "$1\n"; }'
#!/usr/bin/python
# encoding: utf-8
import sys, os, itertools as it
try:
root = sys.argv[1]
except IndexError:
root = os.getcwd()