summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-09-14 12:54:57 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-09-14 12:54:57 -0400
commitf10c72808bbff17f5c123285f9deb93993b4445e (patch)
tree5baa5a98dcb2991d7fa74c42cb04ca8042bb5ad6
parent86d06b4e08602e1d1ae71d629f88440d2779cfbc (diff)
parenta455a332886d705dc2fb579d1791e69befb29587 (diff)
Merge branch 'master' into gluglugt60-par/master
-rw-r--r--.config/bash/rc.d/10_aliases.sh79
-rw-r--r--.config/maildirproc/att.rc15
-rw-r--r--.config/maildirproc/purdue.rc68
-rw-r--r--.config/ssh/config2
-rw-r--r--.config/wmii-hg/config.sh22
5 files changed, 117 insertions, 69 deletions
diff --git a/.config/bash/rc.d/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh
index a4ab60e..2e28a5d 100644
--- a/.config/bash/rc.d/10_aliases.sh
+++ b/.config/bash/rc.d/10_aliases.sh
@@ -72,6 +72,14 @@ if [ -x "`which dircolors`" ]; then
command diff "$@"
fi
}
+
+ diffstat() {
+ if [[ -t 1 ]]; then
+ command diffstat -C "$@"
+ else
+ command diffstat "$@"
+ fi
+ }
else
alias ls='ls -1v'
alias dir='dir -v'
@@ -89,7 +97,6 @@ alias l='ls -CF'
# Some preferences for miscellaneous stuff #
######################################################################
#alias rm='gvfs-trash'
-#alias sed='sed --follow-symlinks' # breaks operating on stdio in GNU sed 4.2.2
alias tree='tree --charset utf8'
alias cd=pushd
alias gitk='gitk --all --date-order'
@@ -108,42 +115,48 @@ term-title() {
printf "$fmt" "$*"
}
mvln() {
- local target link
- if [[ ! -L "$1" ]]; then
- libremessages error 'Not a soft link: %s' "$1"
- return 1
- fi
- if [[ -d "$2" ]]; then
- link="$2/${1##*/}"
- else
- link="$2"
- fi
- target=$(readlink -f -- "$1") || return 1
- ln -srT -- "$target" "$link"
- if cmp -- "$1" "$link"; then
- rm -f -- "$1"
- else
- libremessages error 'Failed moving link: %s -> %s' "$1" "$link"
- return 1
- fi
+ local name=mvln
+ local verbing=moving
+ _cpln "$@"
}
cpln() {
- local target link
- if [[ ! -L "$1" ]]; then
- libremessages error 'Not a soft link: %s' "$1"
- return 1
- fi
- if [[ -d "$2" ]]; then
- link="$2/${1##*/}"
- else
- link="$2"
- fi
- target=$(readlink -f -- "$1") || return 1
- ln -srT -- "$target" "$link"
- if ! cmp -- "$1" "$link"; then
- libremessages error 'Failed copying link: %s -> %s' "$1" "$link"
+ local name=cpln
+ local verbing=copying
+ _cpln "$@"
+}
+_cpln() {
+ if [[ $# -lt 2 ]]; then
+ libremessages error 'Usage: %s FILES... DEST' "$name"
return 1
fi
+ declare -i i=1
+ while [[ $i -lt $# ]]; do
+ local src dst target link
+ src="${!i}"
+ dst="${!#}"
+ if [[ ! -L "$src" ]]; then
+ libremessages error 'Not a soft link: %s' "$src"
+ return 1
+ fi
+ if [[ -d "$dst" ]]; then
+ link="$dst/${src##*/}"
+ else
+ link="$dst"
+ fi
+ target=$(readlink -f -- "$src") || return 1
+ ln -srT -- "$target" "$link"
+ # using `cmp` instead of `[ "$src" -ef "$link" ]` has
+ # the use-case where "$link" was a pre-existing link
+ # to a duplicate of "$src".
+ if ! cmp -- "$src" "$link"; then
+ libremessages error 'Failed %s link: %s -> %s' "$verbing" "$src" "$link"
+ return 1
+ fi
+ if [[ "$name" = mvln ]]; then
+ rm -f -- "$src"
+ fi
+ i+=1
+ done
}
jarls() {
jar tf "$1" |
diff --git a/.config/maildirproc/att.rc b/.config/maildirproc/att.rc
index 4532bec..ecd9c20 100644
--- a/.config/maildirproc/att.rc
+++ b/.config/maildirproc/att.rc
@@ -101,6 +101,7 @@ def handle_incoming_unknown(mail):
# Whitelist
if (
False
+ or is_to_or_from(mail, "@purestorage.com")
or is_to_or_from(mail, "Bryan@ChankTunUnGi.onmicrosoft.com")
or is_to_or_from(mail, "cacnedcomms@gmail.com")
or is_to_or_from(mail, "fsf.org")
@@ -158,6 +159,10 @@ def handle_incoming_unknown(mail):
return
def my_filters(mail):
+ if is_to_or_from(mail,"@purestorage.com"):
+ move_ham(mail, ".purestorage")
+ return
+
# Sort mail from various mailing lists
# https://lists.gnu.org/mailman/options/bug-librejs/lukeshu@sbcglobal.net
# https://lists.nongnu.org/mailman/options/libreboot/lukeshu@sbcglobal.net
@@ -168,6 +173,8 @@ def my_filters(mail):
[ 'archlinux.org', 'archlinux' ],
[ 'lists.freedesktop.org', 'freedesktop' ],
[ 'lists.fedorahosted.org', 'fedorahosted' ],
+ [ 'lists.arthurdejong.org', 'arthurdejong' ],
+ [ 'lists.stanford.edu', 'stanford' ],
[ 'lists.parabola.nu', 'parabola' ],
[ 'parabola.nu', 'parabola' ] ]:
list = mailman_domain(mail, pair[0])
@@ -218,6 +225,14 @@ def my_filters(mail):
if mail["From"].matches("@xkcd\.com"):
move_ham(mail, ".Social.xkcd")
return
+
+ if mail["From"].matches("schwab\.com"):
+ move_ham(mail, ".schwab")
+ return
+
+ if mail["From"].matches("@ebay\.com"):
+ move_ham(mail, ".ebay")
+ return
# Sort mail related to Troop 276
if (
diff --git a/.config/maildirproc/purdue.rc b/.config/maildirproc/purdue.rc
index 952e356..11b0d46 100644
--- a/.config/maildirproc/purdue.rc
+++ b/.config/maildirproc/purdue.rc
@@ -33,6 +33,10 @@ def piazza_topic(mail, topic):
def my_filters(mail):
# Generic stuff ########################################################
+ if is_to_or_from(mail,"@purestorage.com"):
+ mail.move("INBOX.purestorage")
+ return
+
if (
False
or mail["Subject"].contains("[PASE]")
@@ -347,38 +351,38 @@ def my_filters(mail):
# Spring 2016 ##########################################################
- # CS 422 (Networking)
- if (
- False
- or mail["Subject"].contains("spring-2016-cs-42200")
- or is_to_or_from(mail, "rkarandi@cs.purdue.edu")
- ):
- mail.move("INBOX.classes.2016-1.CS422")
- return
- # CS 456 (Programming Languages)
- if piazza_topic(mail, "CS 456"):
- mail.move("INBOX.classes.2016-1.CS456.Piazza")
- return
- # VFS 491 (Mafia in the Movies)
- if (
- False
- or mail["Subject"].contains("spring-2016-fvs-49100")
- or is_to_or_from(mail, "lawton@purdue.edu")
- ):
- mail.move("INBOX.classes.2016-1.FVS491")
- return
- # FRC 4272
- if (
- False
- or mail["Subject"].contains("[ME297]")
- or is_to_or_from(mail, "firstteam4272@gmail.com")
- or is_to_or_from(mail, "@tscstudents.net")
- or is_to_or_from(mail, "abenyeho@purdue.edu")
- or is_to_or_from(mail, "Henry65@purdue.edu")
- or is_to_or_from(mail, "chang282@purdue.edu")
- ):
- mail.move("INBOX.classes.2016-1.FRC4272")
- return
+ # # CS 422 (Networking)
+ # if (
+ # False
+ # or mail["Subject"].contains("spring-2016-cs-42200")
+ # or is_to_or_from(mail, "rkarandi@cs.purdue.edu")
+ # ):
+ # mail.move("INBOX.classes.2016-1.CS422")
+ # return
+ # # CS 456 (Programming Languages)
+ # if piazza_topic(mail, "CS 456"):
+ # mail.move("INBOX.classes.2016-1.CS456.Piazza")
+ # return
+ # # VFS 491 (Mafia in the Movies)
+ # if (
+ # False
+ # or mail["Subject"].contains("spring-2016-fvs-49100")
+ # or is_to_or_from(mail, "lawton@purdue.edu")
+ # ):
+ # mail.move("INBOX.classes.2016-1.FVS491")
+ # return
+ # # FRC 4272
+ # if (
+ # False
+ # or mail["Subject"].contains("[ME297]")
+ # or is_to_or_from(mail, "firstteam4272@gmail.com")
+ # or is_to_or_from(mail, "@tscstudents.net")
+ # or is_to_or_from(mail, "abenyeho@purdue.edu")
+ # or is_to_or_from(mail, "Henry65@purdue.edu")
+ # or is_to_or_from(mail, "chang282@purdue.edu")
+ # ):
+ # mail.move("INBOX.classes.2016-1.FRC4272")
+ # return
# Everything else #####################################################
mail.move("INBOX.ham");
diff --git a/.config/ssh/config b/.config/ssh/config
index 239d28d..9dbf510 100644
--- a/.config/ssh/config
+++ b/.config/ssh/config
@@ -14,7 +14,7 @@ Host *.cs.purdue.edu
# Parabola #################################################
-Host parabola.nu
+Host parabola.nu *.parabola.nu
Port 1863
User lukeshu
diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh
index fa16269..1b48cc4 100644
--- a/.config/wmii-hg/config.sh
+++ b/.config/wmii-hg/config.sh
@@ -12,6 +12,23 @@ mkdir -p -- "${HIST%/*}"
# Colors tuples: "<text> <background> <border>"
. theme-tango-dark
+if [[ "$(uname -m)" = i686 ]]; then
+ mount.9p() {
+ 9pfuse "$1" "$2"
+ while ! [[ -f "$2/event" ]]; do :; done
+ }
+ umount.9p() {
+ fusermount -u "$1"
+ }
+else
+ mount.9p() {
+ 9mount -i "$1" "$2"
+ }
+ umount.9p() {
+ 9umount "$1"
+ }
+fi
+
Event() {
local event=$1; shift;
case "$event" in
@@ -59,12 +76,11 @@ Event() {
echo " -> Creating mountpoint WMII_DIR=$WMII_DIR..."
mkdir -p "$WMII_DIR"
echo " -> Mounting WMII_DIR=$WMII_DIR..."
- 9pfuse "$WMII_ADDRESS" "$WMII_DIR"
- while ! [[ -f "$WMII_DIR/event" ]]; do :; done
+ mount.9p "$WMII_ADDRESS" "$WMII_DIR"
;;
WmiircUnmount) ## No args
echo " -> Unmounting WMII_DIR=$WMII_DIR..."
- fusermount -u "$WMII_DIR"
+ umount.9p "$WMII_DIR"
echo " -> Removing mountpoint WMII_DIR=$WMII_DIR..."
rmdir -p "$WMII_DIR" 2>/dev/null;;
## WMII-meta events