Skip to content

Instantly share code, notes, and snippets.

; i'm an elisp newbie
(defun vk-copy-ledger-entry-to-bottom ()
"Copy the current transaction to the bottom of the ledger"
(re-search-backward "^[12][90]")
(let ((beg (point)))
(re-search-forward "^[12][90]")
vkurup /
Created June 15, 2010 15:03
Watch a blogofile directory and rebuild if a change is noticed.
while LINE=$(inotifywait -rq --timefmt '%F %R' --format '%T %e %f' -e close_write -e move -e delete "$BLOGDIR");
echo "Rebuilt: $LINE"
vkurup / driver.patch
Created September 9, 2011 01:45
Patch to fix RT2860sta driver
diff -urbB old/common/cmm_wpa.c new/common/cmm_wpa.c
--- old/common/cmm_wpa.c 2010-07-08 07:40:24.000000000 -0400
+++ new/common/cmm_wpa.c 2011-08-30 18:27:46.856572005 -0400
@@ -2420,7 +2420,7 @@
UCHAR PrimaryRsnie;
BOOLEAN bMixCipher = FALSE; // indicate the pairwise and group cipher are different
UCHAR p_offset;
- WPA_MIX_PAIR_CIPHER FlexibleCipher = MIX_CIPHER_NOTUSE; // it provide the more flexible cipher combination in WPA-WPA2 and TKIPAES mode
vkurup / gist:1232648
Created September 21, 2011 16:57
emacs-snapshot on natty
vinod@rails:~$ uname -a
Linux rails 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:18:14 UTC 2011 i686 i686 i386 GNU/Linux
vinod@rails:~$ wajig install emacs-snapshot-nox
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
vkurup / config.log
Created October 9, 2011 12:14
Ledger 3.0 config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by ledger configure 3.0.0-20110325, which was
generated by GNU Autoconf 2.67. Invocation command line was
$ configure CPPFLAGS=-isystem /usr/local/include -isystem /usr/include/python2.6 CXXFLAGS=-Wconversion -pthread -g -pipe LDFLAGS=-fpch-deps -g -L/usr/local/lib -L/usr/lib -L/usr/lib/python2.6/config --with-included-gettext --enable-python --enable-pch --enable-debug
## --------- ##
## Platform. ##
vkurup /
Created November 23, 2011 20:43
Take formatted commodity output from ledger and feed it to getquote
# Reads from STDIN looking for ledger-formatted commodity symbols. Uses
# getquote (Perl script) to lookup the lastest price for commodity, then
# appends to PRICEDB file.
# Usage:
# ledger -n bal ^Assets:Investments |
# Assumes that you have 'getquote' on your path
vkurup / init.el
Created October 24, 2012 21:18
Emacs for Python Programming setup
(require 'package)
(add-to-list 'package-archives '("marmalade" . ""))
(add-to-list 'package-archives '("melpa" . ""))
(when (not package-archive-contents)
(defvar my-packages '(starter-kit
vkurup /
Created October 24, 2012 21:22
pyflakes "$1"
pep8 --repeat "$1"
vkurup / gist:6813749
Created October 3, 2013 17:33
vumi setup
transport_name: "transport"
system_id: smppclient1 # username
password: password # password
host: localhost # the host to connect to
port: 2775 # the port to connect to
transport_name: 'transport'
rapidsms_url: {{ pillar['vumi']['rapidsms_url'] }}
vkurup / gist:00c660135278f307e5d4
Created May 7, 2014 15:27
show git branch on command line
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
PS1="\u@\h:\w\$(parse_git_branch) $ "