Skip to content

Instantly share code, notes, and snippets.

@rsdy
rsdy / pwconv.py
Created December 28, 2010 01:43
convert from chrome password db csv dump to password exporter ff4 plugin csv format
#!/usr/bin/env python
import fileinput
print """# Generated by Password Exporter; Export format 1.1; Encrypted: false
"hostname","username","password","formSubmitURL","httpRealm","usernameField","passwordField" """
for line in fileinput.input():
s = line.split('","')
if s[0] == '"origin_url': continue # skip the header
@rsdy
rsdy / post-receive
Created January 25, 2011 21:09
git post-receive hook to post the last commit message and committer onto an irc channel through irssi-proxy
#!/bin/sh
USER='username'
PASS='password' # password for the irc server or irssi-proxy
PORT=6668 # port where irssi-proxy runs
HOST='localhost' # host where irssi-proxy runs
CHAN='#test' # channel in which to post
read oldrev newrev _branch
branch=$(echo $_branch | sed 's/.*\/\([a-z0-9][a-z0-9]*\)$/\1/')
@rsdy
rsdy / Makefile
Created September 11, 2011 22:54
grafika makefile
# usage:
# to build hazi1.cpp: make hazi1
# to build and run: make RUN=1 hazi1
# to build and strip //-style comments: make STRIP=1 hazi1
# guess what: make RUN=1 STRIP=1 hazi1
CC = g++
OPTS = -g --pedantic -Wall --ansi -lglut
.cpp:
$(CC) $(OPTS) $*.cpp -o $*
@rsdy
rsdy / repa.sh
Created September 11, 2011 23:45
reppa -- review, pick, phuck around
#!/bin/ksh
#
# REview - Pick - Phuck Around
#
# Copyright (C) 2011 Peter Parkanyi <me@rhapsodhy.hu>
# Distributed under the MIT license
#
SHA1='[a-f0-9]{40}'
LISTPATCHES=$(git log HEAD..$1 |grep -E "${SHA1}\$" |sed "s/^.*\(${SHA1//@([\{\}])/\\\1}\)\$/\1/")
alias show='git show --patch-with-stat'
@rsdy
rsdy / 01mac.sh
Created December 15, 2011 00:02
wicd random mac preconnect hook
#!/bin/sh
LOG=/tmp/mac
WIRELESS=wlan0
WIRED=eth0
mac_map() {
case "x$1" in
xfixed) mac='11:22:33:44:55:66'
;;
@rsdy
rsdy / getattr_time.py
Created December 22, 2011 02:56
perftesting different ways to override an arbitrary member method in python
#!/usr/bin/env python
#
# Example output:
#
# > testing mapped version
# 0.015753 usec/pass
# > waiting 1.0s
# > testing rebound version
# 0.025296 usec/pass
#
@rsdy
rsdy / ini
Created March 3, 2012 21:15
mc colors @ ~/.config/mc/ini
[Midnight-Commander]
skin=nicedark
[Colors]
base_color=brightgreen,black:normal=brightred,default:selected=black,brightred:markselect=white,gray:bbarhotkey=brightred,black:menusel=brighred,default:menuhot=magenta,default:
@rsdy
rsdy / .Xdefaults
Created March 3, 2012 21:17
urxvt settings and colouring
URxvt*termName: rxvt-256color
URxvt.font: xft:Envy Code R:size=8
URxvt*scrollBar: false
URxvt*urllauncher: /usr/bin/firefox
URxvt*urlLauncher: /usr/bin/firefox
URxvt*matcher.button: 3
URxvt*saveLines: 8192
URxvt.perl-ext-common:default,matcher
URxvt*cursorColor: #d8d8d8
@rsdy
rsdy / .vimrc
Created April 26, 2012 14:24
vim prezentation macros
au! BufRead,BufNewFile *.prez setfiletype prez
@rsdy
rsdy / python.prez
Created April 30, 2012 21:59
A prezentation about what is wrong with Python
{{{
╻ ╻╻ ╻╻ ╻
┃╻┃┣━┫┗┳┛
┗┻┛╹ ╹ ╹
┏━┓╻ ╻╺┳╸╻ ╻┏━┓┏┓╻
┣━┛┗┳┛ ┃ ┣━┫┃ ┃┃┗┫
╹ ╹ ╹ ╹ ╹┗━┛╹ ╹
┏━┓╻ ╻┏━╸╻┏ ┏━┓
┗━┓┃ ┃┃ ┣┻┓┗━┓
┗━┛┗━┛┗━╸╹ ╹┗━┛