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 | |
import sys | |
import json | |
filename = sys.argv[1] | |
data = [] | |
limit_attempts = 2 | |
f = open(filename, 'r').readlines() | |
f.pop(0) |
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
# | |
# Thanks: http://cryptofroot.hateblo.jp/entry/20121025/1351105690 | |
# for ksh substition alternative for PWD | |
# ${PWD/#$HOME/\~} would not work in NetBSD's ksh version | |
if [ `id -u` == 0 ]; then | |
PS1='$USER@${HOST%%.*}: ($([[ "${PWD#$HOME}" !!= "$PWD" ]] && print -n "~${PWD#$HOME}" || print -n "$PWD"))# ' | |
else | |
# Remove last trailing slash from $HOME | |
# only needed for normal user |