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
# | |
# zsh script to show how long a command took to run | |
# put in your .zshrc | |
# | |
BG_BLUE='\e[0;44m' | |
OCOLOR='\e[0m' | |
BOLD='\e[1;39m' | |
prompt_command_start=0 | |
show_time_threash=5 |
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 | |
""" | |
Plot histogram from list of dates | |
Usage | |
===== | |
Feed newline separated unix time via STDIN. | |
Ex.1: plot repository activity:: |
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 node | |
var fs = require('fs'); | |
var jsonpath = require('JSONPath'); | |
if (process.argv.length<3) | |
{ | |
console.log('usage: jsonpath json_filename json_path_expr'); | |
exit; |
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 | |
# |
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
#!/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 | |
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 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 | |
# | |
# 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
#!/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 |
OlderNewer