-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.local.example
54 lines (42 loc) · 1.56 KB
/
shell.local.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#
# ~/.shell.local
#
# A more colourful prompt
export PS1='\[\033[1;31m\]\h#\[\033[0m\] '
# W3C Tidy
alias tidy="tidy -config ${HOME}/.tidyrc"
# Combine pwgen & passwdqc
pwgen_check() { pwgen "$@" | pwqcheck -1 --multi; }
# dmesg filter to omit printk timestamps (if dmesg -t is not available yet)
npk() { sed 's/^\[[ 0-9\.]*\] //'; }
##### MacOS X
if [ -d /opt/local/bin ]; then
export PATH=/opt/local/sbin:/opt/local/bin:${PATH}
fi
# On MacOS X, TMPDIR changes every time Terminal.app starts
export SCREENDIR=${HOME}/.screen
# More MacOS X shortcuts
alias top="top -o cpu"
alias df="df -P"
alias shuf="perl -MList::Util=shuffle -e 'print shuffle(<STDIN>);'"
# Android SDK
# alias adb="/Applications/Non-Apple/AndroidSDK/sdk/platform-tools/adb"
# alias fastboot="/Applications/Non-Apple/AndroidSDK/sdk/platform-tools/fastboot"
# Enable "Secure Keyboard" for MacOS X
# > How secure is “Secure Keyboard Entry” in Mac OS X's Terminal?
# > https://security.stackexchange.com/q/47749
#
# > Technical Note TN2150: Using Secure Event Input Fairly
# > https://developer.apple.com/library/archive/technotes/tn2150/
defaults write com.apple.Terminal SecureKeyboardEntry 1
# > tobym/pwdx_for_mac.bash
# > https://gist.github.com/tobym/648188
_pwdx() {
lsof -a -p "${1}" -d cwd -n | tail -1 | awk '{print $NF}'
}
# https://www.funtoo.org/Keychain
eval $(keychain --eval --quiet)
# dmesg: translate relative printk time stamps to absolute time stamps
_kmsg() {
dmesg | perl -ne "BEGIN{\$a= time()- qx!cat /proc/uptime!}; s/\[\s*(\d+)\.\d+\]/localtime(\$1 + \$a)/e; print \$_;"
}