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"
(interactive)
(re-search-backward "^[12][90]")
(let ((beg (point)))
(forward-char)
(re-search-forward "^[12][90]")
(beginning-of-line)
@vkurup
vkurup / vk-watch-rebuild.sh
Created June 15, 2010 15:03
Watch a blogofile directory and rebuild if a change is noticed.
#!/bin/bash
BLOGOFILE='/usr/local/bin/blogofile'
BLOGDIR='/home/vinod/web/blogofile'
while LINE=$(inotifywait -rq --timefmt '%F %R' --format '%T %e %f' -e close_write -e move -e delete "$BLOGDIR");
do
cd $BLOGDIR
$BLOGOFILE build
echo "Rebuilt: $LINE"
@vkurup
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
+ WPA_MIX_PAIR_CIPHER FlexibleCipher = WPA_TKIPAES_WPA2_TKIPAES;
@vkurup
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
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
vkurup / glue-quote.sh
Created November 23, 2011 20:43
Take formatted commodity output from ledger and feed it to getquote
#!/bin/bash
# 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 | glue-quote.sh
#
# Assumes that you have 'getquote' on your path
@vkurup
vkurup / init.el
Created October 24, 2012 21:18
Emacs for Python Programming setup
(require 'package)
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
(defvar my-packages '(starter-kit
starter-kit-bindings
@vkurup
vkurup / pycheckers.sh
Created October 24, 2012 21:22
Pycheckers
#!/bin/bash
pyflakes "$1"
pep8 --repeat "$1"
true
@vkurup
vkurup / gist:6813749
Created October 3, 2013 17:33
vumi setup
smpp_transport:
transport_name: "transport"
system_id: smppclient1 # username
password: password # password
host: localhost # the host to connect to
port: 2775 # the port to connect to
rapidsms_relay_fake:
transport_name: 'transport'
rapidsms_url: {{ pillar['vumi']['rapidsms_url'] }}
@vkurup
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) $ "