From 88a54cdff583fe1acdd0e441a331b5fcb570e258 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sat, 30 Mar 2019 14:58:12 -0400 Subject: [PATCH] misc improvements --- .gitconfig | 1 + brc | 38 ++++++++++++++++++++++++++++++++++++-- distro-end | 15 ++++++++++++--- pkgs | 2 ++ 4 files changed, 51 insertions(+), 5 deletions(-) diff --git a/.gitconfig b/.gitconfig index 7dd509e..186dac4 100644 --- a/.gitconfig +++ b/.gitconfig @@ -10,6 +10,7 @@ co = checkout s = status ci = commit lol = log --graph --decorate --pretty=oneline --abbrev-commit --all +dt = difftool [core] excludesfile = ~/.gitignore_global diff --git a/brc b/brc index 16b7eb7..6389c04 100644 --- a/brc +++ b/brc @@ -147,13 +147,13 @@ HISTFILE=$HOME/.bh # 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 @@ -440,6 +440,7 @@ cgpl() cp /a/bin/data/COPYING . fi } + capache() { if (($#)); then @@ -448,6 +449,20 @@ capache() 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 @@ -1003,6 +1018,7 @@ ic() { git commit -am "$*" } + idea() { /a/opt/idea-IC-163.7743.44/bin/idea.sh "$@" &r } @@ -1079,6 +1095,8 @@ l() { lcn() { locate -i "*$**"; } +lg() { LC_COLLATE=C.UTF-8 ll --group-directories-first; } + lt() { ll -tr "$@"; } lld() { ll -d "$@"; } @@ -1149,6 +1167,7 @@ mbenable() { 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 ~ @@ -1160,6 +1179,7 @@ mbdisable() { 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 @@ -1443,6 +1463,13 @@ ser() { $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 @@ -1550,6 +1577,10 @@ splay() { # script replay 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 "$@" } @@ -1881,6 +1912,9 @@ vspicy() { # usage: VIRSH_DOMAIN sed -r "s/.*port='([0-9]+).*/\1/") } +wian() { + cat-new-files /m/4e/INBOX/new +} wtr() { curl wttr.in/boston; } diff --git a/distro-end b/distro-end index 7bc1f4b..43ca158 100755 --- a/distro-end +++ b/distro-end @@ -1475,6 +1475,15 @@ DEVICESCAN -a -o on -S on -n standby,q $sched \ ########### 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. @@ -1533,9 +1542,9 @@ case $distro in # compilers. spa unison unison-gtk ;; -arch) - spa unison gtk2 - ;; + arch) + spa unison gtk2 + ;; esac case $distro in diff --git a/pkgs b/pkgs index b7c1111..56d48c6 100644 --- a/pkgs +++ b/pkgs @@ -22,6 +22,7 @@ p3=( at bash-completion curl + ethtool eatmydata fping git @@ -105,6 +106,7 @@ p4=( gnupg-doc guvcview i3lock + inotify-tools iputils-tracepath iperf3 iproute2-doc -- 2.30.2