Skip to content

Instantly share code, notes, and snippets.

@rsdy
rsdy / develenv.sh
Created May 26, 2012 15:56
enter a development chroot and run a command
#!/bin/ksh
## configuration
CHROOT=$HOME/sid-debootstrap
USER=rsdy
USER_HOME=/home/$USER
WORKDIR=$USER_HOME/build
TERM=rxvt-unicode
PATH_EXTEND='$HOME/.cabal/bin'
BIND_LIST="/dev /proc /sys"
@rsdy
rsdy / authorized_keys
Created June 25, 2012 22:36
dump android contacts to remote host using ssh
command="gpg --yes --encrypt --recipient [email protected] --output=contacts-$(date +%Y%m%d%H%M).json.gpg",no-pty,no-port-forwarding ssh-rsa etc....
@rsdy
rsdy / .xinitrc
Created August 25, 2012 15:17
ibm trackpoint configuration
# these settings make the trackpoint scroll horizontally and vertically when the middle button is pressed
/usr/bin/xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1
/usr/bin/xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 2
/usr/bin/xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5
/usr/bin/xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 150
/usr/bin/xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Middle Button Timeout" 50
@rsdy
rsdy / Solarized.colors
Created January 21, 2013 14:19
QTCurve style and solarized (with magenta) colours. GTK theme can be set to the same thing through KDE system settings.
# ~/.kde/share/apps/color-schemes/Solarized.colors
[ColorEffects:Disabled]
Color=56,56,56
ColorAmount=0
ColorEffect=0
ContrastAmount=0.65
ContrastEffect=1
IntensityAmount=0.1
IntensityEffect=2
@rsdy
rsdy / e
Last active December 12, 2015 01:19
open the file in emacs and switch to the emacs workspace at the same time
#!/bin/sh
# ~/bin/e
emacsclient --alternate-editor="emacs" -n "$@" 2>/dev/null & disown
# 4 is the number of the virtual desktop where emacs resides
# the wm should spawn a new instance there automagically
wmctrl -s 4
@rsdy
rsdy / output
Last active December 13, 2015 22:59
haskell zipwith vs. map-zip
warming up
estimating clock resolution...
mean is 1.363583 us (640001 iterations)
found 3371 outliers among 639999 samples (0.5%)
2926 (0.5%) high severe
estimating cost of a clock call...
mean is 38.34752 ns (12 iterations)
found 1 outliers among 12 samples (8.3%)
1 (8.3%) low severe
@rsdy
rsdy / tarsnap-backup.sh
Last active December 14, 2015 04:19
simple backup script wrapping tarsnap
#!/bin/ksh
#
# compile tarsnap, and install it to $BASEDIR
#
# put the files/dirs to be included into $BASEDIR/includes
# specify exclude patterns in $BASEDIR/excludes
# both files should contain either space or newline-separated items
#
# tweak $DELETE_ARCH to specify the retention time after which the
# archives will be deleted
@rsdy
rsdy / Makefile
Created December 3, 2013 08:44
Pdflatex livecoding with tmux
do:
pandoc -f markdown -t latex plan.md > sections.tex
pdflatex plan.tex
pdflatex plan.tex
live:
while inotifywait plan.md; do \
make do; \
done
@rsdy
rsdy / sudoers
Created March 10, 2014 18:51
invoke yaourt as a dedicated user with sudo rights
# append to /etc/sudoers
#
yaourt ALL=(root) NOPASSWD: /usr/bin/pacman, /usr/bin/pacdiffviewer
@rsdy
rsdy / i3-stop
Created September 14, 2015 01:05
Stops a process by name if switched away from workspace
#!/usr/bin/env python3
import i3ipc
from sh import pkill
WNAME='browser'
PNAME='firefox'
def on_workspace(i3, e):
if e.current.props.name == WNAME: