various fixes and improvements
[distro-setup] / brc
diff --git a/brc b/brc
index bd8429e1d526b6252367f3d38b65005bca5d3337..96e66a883d647c5e69538b53e96b704814f1f14a 100644 (file)
--- a/brc
+++ b/brc
@@ -558,7 +558,7 @@ fa() {
 }
 
 faf() { # find all files
-    find -L $1 -type f -not \( -name .svn -prune -o -name .git -prune \
+    find -L $1 -not \( -name .svn -prune -o -name .git -prune \
          -o -name .hg -prune -o -name .editor-backups -prune \
          -o -name .undo-tree-history -prune \) 2>/dev/null
 }
@@ -951,6 +951,10 @@ else
     }
 fi
 
+ipdrop() {
+    s iptables -A INPUT -s $1 -j DROP
+}
+
 net-dev-info() {
     e "lspci -nnk|gr -iA2 net"
     lspci -nnk|gr -iA2 net
@@ -1527,7 +1531,7 @@ t() {
      declare -gi _seq; _seq+=1
      echo "test body" | m mail -s "test mail from $HOSTNAME, $_seq" "${@:-root@localhost}"
      # for testing to send from an external address, you can do for example
-     # -aFrom:ian@iank.bid web-6fnbs@mail-tester.com
+     # -fian@iank.bid -aFrom:ian@iank.bid web-6fnbs@mail-tester.com
      # note in exim, you can retry a deferred message
      # s exim -M MSG_ID
      # MSG_ID is in /var/log/exim4/mainlog, looks like 1ccdnD-0001nh-EN
@@ -1602,7 +1606,7 @@ EOF
  tx() { # toggle set -x, and the prompt so it doesn't spam
         if [[ $- == *x* ]]; then
             set +x
-            PROMPT_COMMAND=prompt_command
+            PROMPT_COMMAND=prompt-command
         else
             unset PROMPT_COMMAND
             PS1="\w \$ "
@@ -1709,8 +1713,11 @@ vspicy() { # usage: VIRSH_DOMAIN
 wtr() { curl wttr.in/boston; }
 
 xl() {
-    # this succeeds even if gnome-screensaver isn\'t running.
+    if pgrep gnome-screensav &>/dev/null; then
+    # this command actually starts gnome-screensaver if it isn't running.
+    # lololol, what crap
     gnome-screensaver-command --exit &>/dev/null
+    fi
     mate-screensaver-command --exit &>/dev/null
     if ! pidof xscreensaver; then
         pushd /
@@ -1719,7 +1726,7 @@ xl() {
         # 1 was not long enough
         sleep 3
     fi
-    xscreensaver-command -lock
+    xscreensaver-command -activate
 }
 
 #############################
@@ -1940,6 +1947,25 @@ scrollbar true
 EOF
 }
 
+reset-xscreensaver() {
+    # except for spash, i set these by setting gui options in
+    # xscreensaver-command -demo
+    # then finding the corresponding option in .xscreensaver
+    # spash, i happened to notice in .xscreensaver
+    cat > /home/iank/.xscreensaver <<'EOF'
+mode:          blank
+dpmsEnabled:   True
+dpmsStandby:   0:01:00
+dpmsSuspend:   0:01:00
+dpmsOff:       0:02:00
+timeout:       0:01:00
+lock:           True
+lockTimeout:   0:02:00
+splash:                False
+EOF
+
+}
+
 
 ###########################################
 # stuff that makes sense to be at the end #