# the time format display when doing the history command
# also, setting this makes the history file record time
# of each command as seconds from the epoch
-HISTTIMEFORMAT="%I:%M %p %m/%d "
+HISTTIMEFORMAT="%Y-%m-%d %I:%M %p "
# consecutive duplicate lines dont go in history
HISTCONTROL=ignoredups
# works in addition to HISTCONTROL to do more flexible things
# it could also do the same things as HISTCONTROL and thus replace it,
# but meh. dunno why, but just " *" does glob expansion, so use [ ] to avoid it.
-HISTIGNORE='pass *:k *:[ ]*:lom '
+HISTIGNORE='pass *:[ ]*:lom '
export BC_LINE_LENGTH=0
cp /a/bin/data/COPYING .
fi
}
+
capache()
{
if (($#)); then
cp /a/bin/data/LICENSE .
fi
}
+
+cat-new-files() {
+ local start=$SECONDS
+ local dir="$1"
+ inotifywait -m "$dir" -e create -e moved_to |
+ while read filedir _ file; do
+ cat "$filedir$file"
+ hr
+ calc $((SECONDS - start)) / 60
+ sleep 5
+ done
+
+}
+
chown() {
# makes it so chown -R symlink affects the symlink and its target.
if [[ $1 == -R ]]; then
git commit -am "$*"
}
+
idea() {
/a/opt/idea-IC-163.7743.44/bin/idea.sh "$@" &r
}
lcn() { locate -i "*$**"; }
+lg() { LC_COLLATE=C.UTF-8 ll --group-directories-first; }
+
lt() { ll -tr "$@"; }
lld() { ll -d "$@"; }
dst=/m/4e/$1
src=/m/md/$1
set -x
+ [[ -e $src ]] || { set +x; return 1; }
mv -T $src $dst || { set +x; return 1; }
ln -s -T $dst $src
/a/exe/lnf /p/.mu ~
dst=/m/md/$1
src=/m/4e/$1
set -x
+ [[ -e $src ]] || { set +x; return 1; }
if [[ -L $dst ]]; then rm $dst; fi
mv -T $src $dst
set +x
$s service $2 $1
fi
}
+# like restart, but do nothing if its not already started
+srestart() {
+ local service=$1
+ if [[ $(s systemctl --no-pager show -p ActiveState $service ) == ActiveState=active ]]; then
+ systemctl restart $service
+ fi
+}
serstopnm() {
ser stop NetworkManager
ser stop dnsmasq
scriptreplay "$1.t" "$1.s"
}
+smeld() { # usage host1 host2 file
+ meld <(ssh $1 cat $3) <(ssh $2 cat $3)
+}
+
spd() {
PATH=/usr/local/spdhackfix:$PATH command spd "$@"
}
sed -r "s/.*port='([0-9]+).*/\1/")
}
+wian() {
+ cat-new-files /m/4e/INBOX/new
+}
wtr() { curl wttr.in/boston; }
########### misc stuff
+# make networkmanager use resolvconf instead of its own dnsmasq which
+# conflicts with the normal dnsmasq package.
+f=/etc/NetworkManager/NetworkManager.conf
+m=$(md5sum $f)
+s sed -ri '/ *\[main\]/,/^ *\[[^]]+\]/{/^\s*dns[[:space:]=]/d}' $f
+if [[ $m != $(md5sum $f) ]]; then
+ srestart NetworkManager
+fi
+
# make my /etc/fonts/conf.d/ get used.
# I have a new sans-serif font there because the default one
# displays l and I as the same char, grrrrr.
# compilers.
spa unison unison-gtk
;;
-arch)
- spa unison gtk2
- ;;
+ arch)
+ spa unison gtk2
+ ;;
esac
case $distro in