misc improvements
authorIan Kelling <iank@fsf.org>
Sat, 30 Mar 2019 18:58:12 +0000 (14:58 -0400)
committerIan Kelling <iank@fsf.org>
Sat, 30 Mar 2019 18:58:12 +0000 (14:58 -0400)
.gitconfig
brc
distro-end
pkgs

index 7dd509e5b81e88d1a67ea815d69bf8563d5b64de..186dac41f0b3da86b764880bb9414b6085c007de 100644 (file)
@@ -10,6 +10,7 @@ co = checkout
 s = status
 ci = commit
 lol = log --graph --decorate --pretty=oneline --abbrev-commit --all
 s = status
 ci = commit
 lol = log --graph --decorate --pretty=oneline --abbrev-commit --all
+dt = difftool
 
 [core]
 excludesfile = ~/.gitignore_global
 
 [core]
 excludesfile = ~/.gitignore_global
diff --git a/brc b/brc
index 16b7eb74e341abfb8a3c08da20ee72084ac2775f..6389c0466b5ce31d4f602f672c7da95cbbe2755b 100644 (file)
--- 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
 # 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.
 # 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
 
 
 export BC_LINE_LENGTH=0
 
@@ -440,6 +440,7 @@ cgpl()
     cp /a/bin/data/COPYING .
   fi
 }
     cp /a/bin/data/COPYING .
   fi
 }
+
 capache()
 {
   if (($#)); then
 capache()
 {
   if (($#)); then
@@ -448,6 +449,20 @@ capache()
     cp /a/bin/data/LICENSE .
   fi
 }
     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
 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 "$*"
 }
 
   git commit -am "$*"
 }
 
+
 idea() {
   /a/opt/idea-IC-163.7743.44/bin/idea.sh "$@" &r
 }
 idea() {
   /a/opt/idea-IC-163.7743.44/bin/idea.sh "$@" &r
 }
@@ -1079,6 +1095,8 @@ l() {
 
 lcn() { locate -i "*$**"; }
 
 
 lcn() { locate -i "*$**"; }
 
+lg() { LC_COLLATE=C.UTF-8 ll --group-directories-first; }
+
 lt() { ll -tr "$@"; }
 
 lld() { ll -d "$@"; }
 lt() { ll -tr "$@"; }
 
 lld() { ll -d "$@"; }
@@ -1149,6 +1167,7 @@ mbenable() {
   dst=/m/4e/$1
   src=/m/md/$1
   set -x
   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 ~
   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
   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
   if [[ -L $dst ]]; then rm $dst; fi
   mv -T $src $dst
   set +x
@@ -1443,6 +1463,13 @@ ser() {
     $s service $2 $1
   fi
 }
     $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
 serstopnm() {
   ser stop NetworkManager
   ser stop dnsmasq
@@ -1550,6 +1577,10 @@ splay() { # script replay
   scriptreplay "$1.t" "$1.s"
 }
 
   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 "$@"
 }
 spd() {
   PATH=/usr/local/spdhackfix:$PATH command spd "$@"
 }
@@ -1881,6 +1912,9 @@ vspicy() { # usage: VIRSH_DOMAIN
                sed -r "s/.*port='([0-9]+).*/\1/")
 }
 
                sed -r "s/.*port='([0-9]+).*/\1/")
 }
 
+wian() {
+  cat-new-files /m/4e/INBOX/new
+}
 
 wtr() { curl wttr.in/boston; }
 
 
 wtr() { curl wttr.in/boston; }
 
index 7bc1f4ba52df7d07c0bfef217b54b830140eb209..43ca158ae4142b77d4b1e2c4f16aa0d6d0a4ae42 100755 (executable)
@@ -1475,6 +1475,15 @@ DEVICESCAN -a -o on -S on -n standby,q $sched \
 
 ########### misc stuff
 
 
 ########### 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.
 # 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
     ;;
     # compilers.
     spa unison unison-gtk
     ;;
-arch)
-  spa unison gtk2
-  ;;
+  arch)
+    spa unison gtk2
+    ;;
 esac
 
 case $distro in
 esac
 
 case $distro in
diff --git a/pkgs b/pkgs
index b7c11119613669f982f71030f84c2fe19443646a..56d48c6ff34d08ce11395193082a4595e6162288 100644 (file)
--- a/pkgs
+++ b/pkgs
@@ -22,6 +22,7 @@ p3=(
     at
     bash-completion
     curl
     at
     bash-completion
     curl
+    ethtool
     eatmydata
     fping
     git
     eatmydata
     fping
     git
@@ -105,6 +106,7 @@ p4=(
     gnupg-doc
     guvcview
     i3lock
     gnupg-doc
     guvcview
     i3lock
+    inotify-tools
     iputils-tracepath
     iperf3
     iproute2-doc
     iputils-tracepath
     iperf3
     iproute2-doc