This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Auto execute section is the region before any return/hotkey | |
; For Terminal/Vim | |
GroupAdd Terminal, ahk_class PuTTY | |
GroupAdd Terminal, ahk_class mintty ; cygwin | |
GroupAdd TerminalVim, ahk_group Terminal | |
GroupAdd TerminalVim, ahk_class Vim | |
; Include IME.hak | |
; http://www6.atwiki.jp/eamat/pages/17.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name anti key-grabber | |
// @description Prevent web apps from capturing and muting vital keyboard shortcuts | |
// @grant none | |
// @version 1.1 | |
// ==/UserScript== | |
(function(){ | |
var isMac = unsafeWindow.navigator.oscpu.toLowerCase().contains("mac os x"); | |
unsafeWindow.document.addEventListener('keydown', function(e) { | |
if (e.keyCode === 116) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Read a CSV file from STDIN, assume the 1st column is unix-seconds | |
# convert it to excel time value ( (UNIXSEC + 32400) / 86400 + 25569 ) | |
# and insert it as 2nd column | |
# | |
import sys | |
for line in sys.stdin.readlines(): | |
(unixsec_str, delim, rest) = line.partition(',') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# a lazy guy's wrapper for apt commands | |
case $1 in | |
showpkg|showsrc|stats|search|show|depends|rdepends|pkgnames) | |
set -x | |
apt-cache "$@" | |
;; | |
# short-cuts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Give sudo right to run chrt for giving RT prio for synergys | |
# (relatively) safely to avoid delay of cursor or | |
# keyboard input in remote end. | |
# | |
# So far scheduler (SCHED_RR) and prio (50) is hard-coded. | |
synergys_exepath="/usr/bin/synergys" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import os | |
if len(sys.argv) <= 1: | |
print os.path.realpath(os.getcwd()) | |
else: | |
print os.path.realpath(sys.argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ue | |
bash_trace () { | |
typeset -i i=0 | |
for func in "${FUNCNAME[@]}" | |
do | |
printf '%15s() %s:%d\n' \ | |
"$func" "${BASH_SOURCE[$i]}" "${BASH_LINENO[$i]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import urllib | |
print urllib.unquote_plus(sys.argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# watch screensaver's lock/unlock activity and log | |
log=$HOME/usr/var/log/screensaver.log | |
DIE () { | |
touch $log | |
echo "ERROR: $*" | tee -a $log >&2 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# cutlink - Convert hardlink-ed file to just a copy. | |
# | |
# Basically, the command does the following, with many checks. | |
# | |
# $ cp $file $file.tmp | |
# $ rm -f $file | |
# $ mv $file.tmp $file | |
# |
NewerOlder