From 39ce2af71a83189fb8acb61829b35aca75534809 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 7 Dec 2016 18:05:03 -0500 Subject: bash: move HISTFILE to XDG_DATA_HOME --- .config/bash/rc.d/10_hist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/bash/rc.d/10_hist.sh b/.config/bash/rc.d/10_hist.sh index d7c6bfc..6b2c4f1 100644 --- a/.config/bash/rc.d/10_hist.sh +++ b/.config/bash/rc.d/10_hist.sh @@ -2,7 +2,7 @@ # don't overwrite GNU Midnight Commander's setting of `ignorespace'. HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups -HISTFILE=${XDG_CACHE_HOME}/bash/history +HISTFILE=${XDG_DATA_HOME}/bash/history HISTTIMEFORMAT='[%Y-%m-%d %H:%M] ' HISTSIZE=5000 shopt -s histappend # append to the history file, don't overwrite it -- cgit v1.1-4-g5e80 From 63e306a9a9e5626d18d5cab9c61be50e1800b33f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 7 Dec 2016 18:06:15 -0500 Subject: bash: emacs: hostname communication --- .config/bash/rc.d/90_emacs.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.config/bash/rc.d/90_emacs.sh b/.config/bash/rc.d/90_emacs.sh index 79d5e61..90e771c 100644 --- a/.config/bash/rc.d/90_emacs.sh +++ b/.config/bash/rc.d/90_emacs.sh @@ -35,17 +35,23 @@ if [[ $TERM == eterm* ]]; then # before the hostname is set, otherwise it will set # (default-directory) to an invalid TRAMP string. # - # Because the hostname is compared to (system-name) to - # check if it is localhost, "$(hostname -f)" may need - # to be used instead of $HOSTNAME, if - # $HOSTNAME/$(hostname) doesn't return a qualified - # domain. - local hostname=$HOSTNAME - [[ $hostname = *.* ]] || hostname="$(hostname -f)" + # The hostname is compared to (system-name) to check + # if it is localhost. In Emacs 25, (system-name) is + # just gethostname(2), and in Bash 4.2, $HOSTNAME is + # also just gethostname(2). + # + # As an aside, Emacs and Bash deal with hostnames > + # 255 bytes differently. They both use 255 bytes for + # the initial call, but Bash won't retry with a bigger + # limit, but Emacs will. I don't care, because + # besides such long hostnames being uncommon, Linux's + # HOST_NAME_MAX on i686 and x86_64 is only 64, so it's + # actually impossible. IDK about other kernels or + # architectures. printf '\eAnSiT%s %s\n' \ u "$USER" \ c "$PWD" \ - h "$hostname" + h "$HOSTNAME" } # Set the shell's X11 display (emacs -> shell) _emacs_set_shell_DISPLAY() { -- cgit v1.1-4-g5e80 From ad8b07937aa9ebf916b5fe1dba47f2a884d8e0bd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 7 Dec 2016 18:09:09 -0500 Subject: offlineimap: clean up --- .config/offlineimap/config | 26 +++++++++++ .config/offlineimaprc | 51 ---------------------- .config/symlinks | 1 - .../systemd/user/default.target.wants/mail.target | 1 + .../user/mail.target.wants/offlineimap.service | 1 + .../user/mail.target.wants/offlineimap.timer | 1 + .../systemd/user/offlineimap.timer.d/length.conf | 2 + 7 files changed, 31 insertions(+), 52 deletions(-) create mode 100644 .config/offlineimap/config delete mode 100644 .config/offlineimaprc create mode 120000 .config/systemd/user/default.target.wants/mail.target create mode 120000 .config/systemd/user/mail.target.wants/offlineimap.service create mode 120000 .config/systemd/user/mail.target.wants/offlineimap.timer create mode 100644 .config/systemd/user/offlineimap.timer.d/length.conf diff --git a/.config/offlineimap/config b/.config/offlineimap/config new file mode 100644 index 0000000..2fc6ecc --- /dev/null +++ b/.config/offlineimap/config @@ -0,0 +1,26 @@ +# -*- Mode: Conf -*- +[general] +accounts = ATT +metadata = ~/.local/share/offlineimap + +## AT&T ############################################################### + +[Account ATT] +localrepository = Local-Main +remoterepository = Remote-SBCGlobal + +[Repository Local-Main] +type = Maildir +localfolders = ~/Maildir +sep = . +folderfilter = lambda folder: folder in [ 'Inbox', 'Bulk Mail' ] + +[Repository Remote-SBCGlobal] +type = IMAP +ssl = yes +sslcacertfile = /etc/ssl/certs/ca-certificates.crt +auth_mechanisms = PLAIN +remotehost = imap.mail.yahoo.com +remoteuser = lukeshu@sbcglobal.net +folderfilter = lambda folder: folder in [ 'Inbox', 'Bulk Mail' ] +idlefolders = [ 'Inbox', 'Bulk Mail' ] diff --git a/.config/offlineimaprc b/.config/offlineimaprc deleted file mode 100644 index c1390c5..0000000 --- a/.config/offlineimaprc +++ /dev/null @@ -1,51 +0,0 @@ -# -*- Mode: Conf -*- -[general] -accounts = ATT,Purdue - -## AT&T ############################################################### - -[Account ATT] -localrepository = Local-Main -remoterepository = Remote-SBCGlobal - -[Repository Local-Main] -type = Maildir -localfolders = ~/Maildir -sep = . -folderfilter = lambda folder: folder in [ 'Inbox', 'Bulk Mail' ] - -[Repository Remote-SBCGlobal] -type = IMAP -ssl = yes -sslcacertfile = /etc/ssl/certs/ca-certificates.crt -remotehost = imap.mail.yahoo.com -remoteuser = lukeshu@sbcglobal.net -folderfilter = lambda folder: folder in [ 'Inbox', 'Bulk Mail' ] - -## Purdue ############################################################ - -[Account Purdue] -localrepository = Local-Purdue -remoterepository = Remote-PurdueMS - -[Repository Local-Purdue] -type = Maildir -localfolders = ~/Maildir.purdue -sep = . -folderfilter = lambda foldername: re.search('INBOX', foldername) - -[Repository Remote-PurdueMyMail] -type = IMAP -ssl = yes -cert_fingerprint = 2189e7d568d93352fcdccaa24137856191703c4a -remotehost = mymail.purdue.edu -remoteuser = shumakl -folderfilter = lambda foldername: re.search('INBOX', foldername) - -[Repository Remote-PurdueMS] -type = IMAP -ssl = yes -remotehost = outlook.office365.com -remoteuser = shumakl@purdue.edu -folderfilter = lambda foldername: re.search('INBOX', foldername) -sslcacertfile = /etc/ssl/certs/ca-certificates.crt diff --git a/.config/symlinks b/.config/symlinks index 8d92ec8..550f444 100644 --- a/.config/symlinks +++ b/.config/symlinks @@ -24,7 +24,6 @@ .config/selected_editor .selected_editor .config/X11/login .vnc/xstartup -.config/offlineimaprc .offlineimaprc .cache/offlineimap .offlineimap # Directories diff --git a/.config/systemd/user/default.target.wants/mail.target b/.config/systemd/user/default.target.wants/mail.target new file mode 120000 index 0000000..40ca36d --- /dev/null +++ b/.config/systemd/user/default.target.wants/mail.target @@ -0,0 +1 @@ +/usr/lib/systemd/user/mail.target \ No newline at end of file diff --git a/.config/systemd/user/mail.target.wants/offlineimap.service b/.config/systemd/user/mail.target.wants/offlineimap.service new file mode 120000 index 0000000..aacc641 --- /dev/null +++ b/.config/systemd/user/mail.target.wants/offlineimap.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/offlineimap.service \ No newline at end of file diff --git a/.config/systemd/user/mail.target.wants/offlineimap.timer b/.config/systemd/user/mail.target.wants/offlineimap.timer new file mode 120000 index 0000000..0644e30 --- /dev/null +++ b/.config/systemd/user/mail.target.wants/offlineimap.timer @@ -0,0 +1 @@ +/usr/lib/systemd/user/offlineimap.timer \ No newline at end of file diff --git a/.config/systemd/user/offlineimap.timer.d/length.conf b/.config/systemd/user/offlineimap.timer.d/length.conf new file mode 100644 index 0000000..c010b38 --- /dev/null +++ b/.config/systemd/user/offlineimap.timer.d/length.conf @@ -0,0 +1,2 @@ +[Timer] +OnUnitInactiveSec=5m -- cgit v1.1-4-g5e80 From 7469ba154623ce5b231ae902d4cfb617927cebeb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 7 Dec 2016 18:10:04 -0500 Subject: makepkg: switch MAKEFLAGS to use `nproc` --- .config/pacman/makepkg.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/pacman/makepkg.conf b/.config/pacman/makepkg.conf index dc3c5ba..2e627b8 100644 --- a/.config/pacman/makepkg.conf +++ b/.config/pacman/makepkg.conf @@ -7,7 +7,7 @@ LOGDEST="${LIBREHOME:-$HOME}/packages/logdest" PACKAGER="Luke Shumaker " -MAKEFLAGS="-j3" +MAKEFLAGS="-j$(($(nproc)+1))" if type ccache &>/dev/null; then f=false -- cgit v1.1-4-g5e80 From 111574bcf3e81ae6b6da95ce11d56de22342490c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 7 Dec 2016 18:17:41 -0500 Subject: maildirproc: update --- .config/maildirproc/att.rc | 453 +++++++++++++++++++++--------------------- .config/maildirproc/purdue.rc | 395 ------------------------------------ 2 files changed, 223 insertions(+), 625 deletions(-) delete mode 100644 .config/maildirproc/purdue.rc diff --git a/.config/maildirproc/att.rc b/.config/maildirproc/att.rc index ecd9c20..79d4469 100644 --- a/.config/maildirproc/att.rc +++ b/.config/maildirproc/att.rc @@ -5,12 +5,9 @@ import os.path import subprocess import datetime import re +# +# Mail attribute utilities -processor.maildir_base = "~/Maildir" -processor.auto_reload_rcfile = True - -# FIXME: this doesn't handle the case where someone replies `To` you -# directly an `Cc`s the list. def mailman_domain(mail, domain): """ Return a string that is the list-name for a mailman domain @@ -38,6 +35,18 @@ def ezmlm_domain(mail, domain): return m.group(1) return None +def majordomo_domain(mail, domain): + """ + Return a string that is the list-name for a majordomo domain + """ + m = mail["List-Id"].matches("^(.*<|)([^<]*)\."+re.escape(domain)) + if m: + return m.group(2) + for hdr in [ 'To', 'Cc', 'From' ]: + m = mail[hdr].matches("((\w|-)*)@"+re.escape(domain)) + if m: + return m.group(1) + def is_to_or_from(mail,address): """ Return true if [mail] is to or from an address that contains [address]. @@ -55,17 +64,9 @@ def is_to_or_from_re(mail,address): return ( mail["From"].matches(address) or mail.target.matches(address)) -def move_ham(mail,folder): - y = datetime.datetime.now().year - folder = "FOLDERS.Ham."+str(y)+folder - dir = processor.maildir_base+"/"+folder - if not os.path.isfile(dir+"/maildirfolder"): - os.makedirs(dir+"/tmp", 0o777, True) - os.makedirs(dir+"/new", 0o777, True) - os.makedirs(dir+"/cur", 0o777, True) - open(dir+"/maildirfolder", 'a').close() - mail.move(folder) - +# +# bogofilter utilites + def bogofilter_auto(mail): p = subprocess.Popen( ["bogofilter", "-u", "-v", "-I", mail.path], @@ -82,26 +83,26 @@ def bogofilter_ham(mail): subprocess.call(["bogofilter", "-S", "-n", "-I", mail.path]) def bogofilter_spam(mail): subprocess.call(["bogofilter", "-N", "-s", "-I", mail.path]) +# +# The core of my filters -def handle_incoming_ham_training(mail): - bogofilter_ham(mail) - handle_incoming_ham(mail) -def handle_incoming_spam_training(mail): - bogofilter_spam(mail) - mail.move("FOLDERS.Spam") - -def handle_incoming_ham(mail): - my_filters(mail) -def handle_incoming_spam(mail): - mail.move("FOLDERS.Spam") - -def handle_incoming_unknown(mail): - # Filter spam +def move_ham(mail,folder): + y = datetime.datetime.now().year + folder = "FOLDERS.Ham."+str(y)+folder + dir = processor.maildir_base+"/"+folder + if not os.path.isfile(dir+"/maildirfolder"): + os.makedirs(dir+"/tmp", 0o777, True) + os.makedirs(dir+"/new", 0o777, True) + os.makedirs(dir+"/cur", 0o777, True) + open(dir+"/maildirfolder", 'a').close() + mail.move(folder) - # Whitelist - if ( +def my_whitelist(mail): + return ( False + or is_to_or_from(mail, "@opengroup.org") or is_to_or_from(mail, "@purestorage.com") + or is_to_or_from(mail, "@vger.kernel.org") 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") @@ -110,6 +111,8 @@ def handle_incoming_unknown(mail): or is_to_or_from(mail, "parabolagnulinux.org") or mail["From"] == "3174451635@mms.att.net" or mail["From"] == "MAILER-DAEMON@yahoo.com" + or mail["From"].contains("@careereco.com") + or mail["From"].contains("@ciholas.com") or mail["From"].contains("@e.oldnational.com>") or mail["From"].contains("@facebookmail.com>") or mail["From"].contains("@gandi.net") @@ -126,8 +129,10 @@ def handle_incoming_unknown(mail): or mail["From"].contains("@post.oreilly.com>") or mail["From"].contains("@scouting.org>") or mail["From"].contains("@solutionsinplastic.com>") - or mail["From"].contains("@startcom.org>") + or mail["From"].contains("@startcom.org>") or mail["From"].contains("@usfirst.org>") + or mail["From"].contains("@vectren.com") + or mail["From"].contains("@vectrenemail.com") or mail["From"].contains("@wolframalpha.com>") or mail["From"].contains("Promo@email.newegg.com") or mail["From"].contains("info@email2.mysimplemobile.com") @@ -140,36 +145,13 @@ def handle_incoming_unknown(mail): or mail["Subject"].contains("[Maintenance]") or mail["Subject"].contains("[PATCH") or mail["Subject"].contains("[systemd-devel]") - ): - handle_incoming_ham_training(mail) - return - - spam = bogofilter_auto(mail) - if spam == 0: - handle_incoming_spam(mail) - return - elif spam == 1: - handle_incoming_ham(mail) - return - elif spam == 2: - mail.move("FOLDERS.MysteryMeat") - return - else: - mail.move("FOLDERS.BogoFail") - 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 - # https://mail.gnome.org/mailman/options/networkmanager-list/lukeshu@sbcglobal.net - for pair in [ [ 'gnu.org', 'gnu' ], - [ 'nongnu.org', 'nongnu' ], - [ 'gnome.org', 'gnome' ], + # .software.* (GNU Mailman) + for pair in [ [ 'gnu.org', 'gnu' ], # https://lists.gnu.org/mailman/options/bug-librejs/lukeshu@sbcglobal.net + [ 'nongnu.org', 'nongnu' ], # https://lists.nongnu.org/mailman/options/libreboot/lukeshu@sbcglobal.net + [ 'gnome.org', 'gnome' ], # https://mail.gnome.org/mailman/options/networkmanager-list/lukeshu@sbcglobal.net [ 'archlinux.org', 'archlinux' ], [ 'lists.freedesktop.org', 'freedesktop' ], [ 'lists.fedorahosted.org', 'fedorahosted' ], @@ -181,11 +163,19 @@ def my_filters(mail): if list: move_ham(mail, ".software."+pair[1]+"."+list) return + # .software.* (EZMLM) for pair in [ [ 'list.cr.yp.to', 'djb' ] ]: list = ezmlm_domain(mail, pair[0]) if list: move_ham(mail, ".software."+pair[1]+"."+list) return + # .software.* (Majordomo) + for pair in [ [ 'vger.kernel.org', 'kernel' ] ]: + list = majordomo_domain(mail, pair[0]) + if list: + move_ham(mail, ".software."+pair[1]+"."+list) + return + # .software.parabola if ( False or is_to_or_from(mail, "parabolagnulinux.org") @@ -194,53 +184,75 @@ def my_filters(mail): ): move_ham(mail, ".software.parabola") return - - # Sort mail from some social websites - if mail["From"].matches("facebook(|mail)\.com"): - move_ham(mail, ".Social.Facebook") + # .software.POSIX + if is_to_or_from(mail,"austin-group-l@opengroup.org"): + move_ham(mail, ".software.POSIX") return - - if ( - False - or mail["From"].matches("identi\.ca") - or mail["From"].matches("statusnet") - ): - move_ham(mail, ".Social.Identica") + # .software.TravisCI + if mail["From"].contains("builds@travis-ci.org"): + move_ham(mail, ".software.TravisCI") return - + # .software + for address in [ + "@archlinux.org", + "@canonical.org", + "@cnuk.org", + "@core3.amsl.com", + "@defectivebydesign.org", + "@eff.org", + "@fedorahosted.org", + "@foocorp.net", + "@fsf.org", + "@github.com", + "@gitorious.org", + "@gnome.org", + "@gnu.org", + "@ietf.org", + "@kde.org", + "@lists.fedorahosted.org", + "@mozilla.org", + "@nongnu.org", + "@sourceforge.com", + "@thyrsus.com", + ]: + if is_to_or_from(mail,address): + move_ham(mail, ".software") + return + # .servers if ( False or mail["From"].contains("@gandi.net") or mail["From"].contains("@ramhost.us") or mail["From"].contains("@startcom.org") + or mail["From"].contains("@startssl.com") + or mail["From"].contains("@vultr.com") or (mail["From"].contains("@2co.com") and mail["Subject"].contains("RAM Host")) ): - move_ham(mail, ".lukeshu-com") + move_ham(mail, ".servers") + return + # .Social.* + if mail["From"].matches("facebook(|mail)\.com"): + move_ham(mail, ".Social.Facebook") + return + if mail["From"].matches("identi\.ca|statusnet"): + move_ham(mail, ".Social.Identica") return - if mail["From"].matches("twitter\.com"): move_ham(mail, ".Social.Twitter") return - 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") + if is_to_or_from(mail,"linkedin.com"): + move_ham(mail, ".Social.LinkedIn") return - - # Sort mail related to Troop 276 + # .BSA if ( False or mail["List-Id"].contains("troopmailinglist.troop276.net") - or is_to_or_from(mail, "t276_announcements@att.net") or mail["Subject"].matches("troop") or mail["Subject"].matches("merit\s*badge") + or is_to_or_from(mail, "t276_announcements@att.net") or is_to_or_from(mail, "Bryan@ChankTunUnGi.onmicrosoft.com") or is_to_or_from(mail, "basu@maharjan.org") or is_to_or_from(mail, "cacnedcomms@gmail.com") @@ -259,10 +271,93 @@ def my_filters(mail): or is_to_or_from(mail, "trdindy@comcast.net") or is_to_or_from(mail, "wjensen111@aol.com") ): - move_ham(mail, ".BoyScouts") + move_ham(mail, ".BSA") + return + # .FRC + for address in [ "@ni.com", "@usfirst.org" ]: + if is_to_or_from(mail,address): + move_ham(mail, ".FRC") + return + # .FRC.829 + if ( + False + or mail["Subject"].matches("\b829\b") + or is_to_or_from(mail, "wcxctrack829@aim.com") # Pat + or is_to_or_from(mail, "william.walk@gmail.com") + ): + move_ham(mail, ".FRC.829") + return + # .FRC.1024 + if ( + False + or mail["Subject"].matches("\b1024\b") + or mail["Subject"].matches("kil-?a-?bytes") + or is_to_or_from(mail, "BBonahoom@stanleyworks.com") + or is_to_or_from(mail, "bryanbonahoom@gmail.com") + or is_to_or_from(mail, "allison.m.babcock@gmail.com") + or is_to_or_from(mail, "cdewalt3@yahoo.com") + or is_to_or_from(mail, "dave.nelson@ecolab.com") + or is_to_or_from(mail, "dickaustin190@yahoo.com") + or is_to_or_from(mail, "djnels1@comcast.net") # Dave and Julie Nelson + or is_to_or_from(mail, "gamefreak207@gmail.com") # Brett Leedy + or is_to_or_from(mail, "jason.zielke@gmail.com") + or is_to_or_from(mail, "jeffreysmith@msdlt.k12.in.us") + or is_to_or_from(mail, "sarahlittell@comcast.net") + or is_to_or_from(mail, "silioso@gmail.com") + or is_to_or_from(mail, "skiplittell@comcast.net") + or is_to_or_from(mail, "tswilson4801@att.net") + ): + move_ham(mail, ".FRC.1024") + return + # .FRC.4272 + if ( + False + or mail["Subject"].matches("\b4272\b") + 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") + ): + move_ham(mail, ".FRC.4272") + return + # .Purdue.* + if ( + False + or mail["Subject"].contains("[PASE]") + or is_to_or_from(mail,"Purduealumni@purdue.edu") + or is_to_or_from(mail,"pase@purdue.edu") + ): + move_ham(mail, ".Purdue.PASE") + return + if mail["Subject"].contains("[PLUG]"): + move_ham(mail, ".Purdue.PLUG") + return + if is_to_or_from(mail,"@cerias.purdue.edu"): + move_ham(mail, ".Purdue.CERIAS") + return + if ( + False + or is_to_or_from(mail,"royfu@purdue.edu") + or is_to_or_from(mail,"usmannkhan@purdue.edu") + ): + move_ham(mail, ".Purdue.Hackers") + return + if ( + False + or mail["Subject"].contains("[CS Opportunity Update]") + or mail["Subject"].contains("[CS Majors]") + ): + move_ham(mail, ".Purdue.CS") + return + # .misc.* + if mail["From"].matches("schwab\.com"): + move_ham(mail, ".misc.schwab") + return + if mail["From"].matches("@ebay\.com"): + move_ham(mail, ".misc.ebay") return - - # Sort mail from misc people if ( False or is_to_or_from(mail, "margieshu@sbcglobal.net") @@ -270,15 +365,6 @@ def my_filters(mail): ): move_ham(mail, ".misc.Mom") return - - for address in [ - "nintendo.com", - "nintendo-news.com", - ]: - if mail["From"].contains(address): - move_ham(mail, ".misc.Nintendo") - return - for address in [ "@lpi.org", "@pearson.com", @@ -288,96 +374,6 @@ def my_filters(mail): if mail["From"].contains(address): move_ham(mail, ".misc.CompTIA") return - - # Sort mail from FRC people - # Generic - for address in [ "@ni.com", "@usfirst.org" ]: - if is_to_or_from(mail,address): - move_ham(mail, ".FRC") - return - # FRC 829 - for address in [ - "wcxctrack829@aim.com", # Pat - "william.walk@gmail.com", - ]: - if is_to_or_from(mail,address): - move_ham(mail, ".FRC.829") - return - if mail["Subject"].matches("\b829\b"): - move_ham(mail, ".FRC.829") - return - # FRC 1024 - for address in [ - "BBonahoom@stanleyworks.com", - "bryanbonahoom@gmail.com", - "allison.m.babcock@gmail.com", - "cdewalt3@yahoo.com", - "dave.nelson@ecolab.com", - "dickaustin190@yahoo.com", - "djnels1@comcast.net", # Dave and Julie Nelson - "gamefreak207@gmail.com", # Brett Leedy - "jason.zielke@gmail.com", - "jeffreysmith@msdlt.k12.in.us", - "sarahlittell@comcast.net", - "silioso@gmail.com", - "skiplittell@comcast.net", - "tswilson4801@att.net", - ]: - if is_to_or_from(mail,address): - move_ham(mail, ".FRC.1024") - return - for subject_re in [ "\b1024\b", "kil-?a-?bytes" ]: - if mail["Subject"].matches(subject_re): - move_ham(mail, ".FRC.1024") - return - # FRC 4272 - if mail["Subject"].matches("\b4272\b"): - move_ham(mail, ".FRC.4272") - return - - # Catch BS things because of CS classes before the general - # software filters - if mail["Subject"].contains("[Quizroom]"): - mail.delete() - return - - # Sort mail from software people - for address in [ - "@archlinux.org", - "@canonical.org", - "@cnuk.org", - "@core3.amsl.com", - "@defectivebydesign.org", - "@eff.org", - "@fedorahosted.org", - "@foocorp.net", - "@fsf.org", - "@github.com", - "@gitorious.org", - "@gnome.org", - "@gnu.org", - "@ietf.org", - "@kde.org", - "@lists.fedorahosted.org", - "@mozilla.org", - "@nongnu.org", - "@sourceforge.com", - "@thyrsus.com", - ]: - if is_to_or_from(mail,address): - move_ham(mail, ".software") - return - - # Sort mail from the school newspaper - if ( - False - or is_to_or_from(mail, "@lnnorthstar.org") - or is_to_or_from(mail, "lnnorthstar.org@tigertech.net") - ): - move_ham(mail, ".HighSchool.Newspaper") - return - - # Sort misc newsletters if ( False or mail["From"].contains("newsletter") @@ -407,46 +403,6 @@ def my_filters(mail): ): move_ham(mail, ".misc.Newsletters") return - - if ( - False - or mail["From"].contains("@msdlt.k12.in.us") - or mail["From"].contains("ltschoolfoundation@gmail.com") - or mail["From"].contains("naviance.com") - or is_to_or_from(mail, "ibwhite@comcast.net") - or mail["Subject"].contains("IOA") - or mail["From"].contains("nths.org") - or mail["Subject"].contains("NTHS") - or mail["Subject"].contains("National Technical Honor Society") - or mail["Subject"].contains("NHS") - or mail["Subject"].contains("National Honor Society") - ): - move_ham(mail, ".HighSchool") - return - - # from college stuff - if ( - False - or mail["Subject"].contains("NYLF") # National Youth Leadership Conference - or mail["Subject"].contains("NSHSS") - ): - move_ham(mail, ".College.Societies") - return - if ( - False - or mail["From"].contains("admissions@") - or mail["Subject"].contains("college") - # now we get to the BS - or mail["From"].contains("@dreamitdoitindiana.com") - or mail["From"].contains("@indianatechinfo.org") - ): - move_ham(mail, ".College") - return - - if mail["From"].contains("@projectwonderful.com"): - move_ham(mail, ".misc.ProjectWonderful") - return - if ( False or mail["From"].matches("@localhost") @@ -454,7 +410,7 @@ def my_filters(mail): or mail["From"].matches("@[^,>]*\.lan") or mail["To"].matches("luke@") ): - move_ham(mail, ".LocalSystems") + move_ham(mail, ".misc.LocalSystems") return if ( False @@ -466,10 +422,47 @@ def my_filters(mail): return move_ham(mail, "") +# +# call the above + +def handle_incoming_ham_training(mail): + bogofilter_ham(mail) + handle_incoming_ham(mail) +def handle_incoming_spam_training(mail): + bogofilter_spam(mail) + mail.move("FOLDERS.Spam") + +def handle_incoming_ham(mail): + my_filters(mail) +def handle_incoming_spam(mail): + mail.move("FOLDERS.Spam") + +def handle_incoming_unknown(mail): + # Whitelist + if my_whitelist(mail): + handle_incoming_ham_training(mail) + return + spam = bogofilter_auto(mail) + if spam == 0: + handle_incoming_spam(mail) + return + elif spam == 1: + handle_incoming_ham(mail) + return + elif spam == 2: + mail.move("FOLDERS.MysteryMeat") + return + else: + mail.move("FOLDERS.BogoFail") + return + +# hook the above functions into the maildirproc processor +processor.maildir_base = "~/Maildir" +processor.auto_reload_rcfile = True handle_mapping = { "Inbox": handle_incoming_unknown, - "Bulk Mail": handle_incoming_unknown, + "Bulk Mail": handle_incoming_unknown, # fucking Yahoo! "FOLDERS.Spam.training": handle_incoming_spam_training, "FOLDERS.Ham.training": handle_incoming_ham_training, } diff --git a/.config/maildirproc/purdue.rc b/.config/maildirproc/purdue.rc deleted file mode 100644 index 11b0d46..0000000 --- a/.config/maildirproc/purdue.rc +++ /dev/null @@ -1,395 +0,0 @@ -# -*- mode: python; indent-tabs-mode: t -*- - -import os -import subprocess - -processor.maildir_base = "~/Maildir.purdue" -processor.auto_reload_rcfile = True - -def is_to_or_from(mail,address): - """ - Return true if [mail] is to or from an address that contains [address]. - """ - return ( - mail["From"].contains(address) - or mail.target.contains(address)) -def is_to_or_from_re(mail,address): - """ - Return true if [mail] is to or from an address that matches the - regex [address]. - """ - return ( - mail["From"].matches(address) - or mail.target.matches(address)) - -def piazza_topic(mail, topic): - return ( - False - or is_to_or_from(mail, topic+" on Piazza") - or mail["Subject"].contains(topic+" on Piazza") - or (is_to_or_from(mail, "@piazza.com>") and mail["Subject"].contains(" in "+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]") - or is_to_or_from(mail,"Purduealumni@purdue.edu") - or is_to_or_from(mail,"pase@purdue.edu") - ): - mail.move("INBOX.crap.PASE") - return - - if mail["Subject"].contains("[PLUG]"): - mail.move("INBOX.crap.PLUG") - return - - if mail["From"].matches(".*bursar.*@purdue\.edu"): - mail.move("INBOX.tuition") - return - - if mail["From"].contains("mailhub-admin@purdue.edu"): - mail.move("INBOX.crap.mailhub-admin") - return - - if mail["From"].matches("pmx-.*@purdue.edu"): - mail.move("INBOX.crap.spam") - return - - if is_to_or_from(mail,"linkedin.com"): - mail.move("INBOX.crap.LinkedIn") - return - - if is_to_or_from(mail,"follet.com"): - mail.move("INBOX.Follet") - return - - if ( - False - or is_to_or_from(mail,"@edrtrust.com") - or is_to_or_from(mail,"@propertysolutions.com") - or is_to_or_from(mail,"collegestationapartments@gmail.com") - or is_to_or_from_re(mail,"collegestationca\..*@gmail.com") - ): - mail.move("INBOX.housing.CollegeStation") - return - if ( - False - or is_to_or_from(mail,"@hunterlp.com") - or is_to_or_from(mail, "@duke-energy.com") - or is_to_or_from(mail, "@alerts.comcast.net") - or is_to_or_from(mail, "rentpayment.com") - or is_to_or_from(mail, "@vectren.com") - or is_to_or_from(mail, "@vectrenemail.com") - or is_to_or_from(mail, "@apartments247.com") - ): - mail.move("INBOX.housing.BeauJardin") - return - - if mail["From"].matches("facebook(|mail)\.com"): - mail.move("INBOX.crap.Facebook") - return - - if is_to_or_from(mail,"@cerias.purdue.edu"): - mail.move("INBOX.crap.CERIAS") - return - - if ( - False - or is_to_or_from(mail,"royfu@purdue.edu") - or is_to_or_from(mail,"usmannkhan@purdue.edu") - ): - mail.move("INBOX.crap.Hackers") - return - - if ( - False - or is_to_or_from(mail,"@cable.comcast.com") - or is_to_or_from(mail,"@apexsystemsinc.com") - ): - mail.move("INBOX.work.2013.Comcast") - return - - if ( - False - or is_to_or_from(mail,"@qualcomm.com") - or is_to_or_from(mail,"@Cartus.com") - or is_to_or_from(mail,"@quicinc.com") - ): - mail.move("INBOX.work.2015.qualcomm") - return - - if ( - False - or mail["Subject"].contains("[CS Opportunity Update]") - or mail["Subject"].contains("[CS Majors]") - ): - mail.move("INBOX.crap.CS") - return - if (mail["From"].contains("shumakl@cs.purdue.edu") and mail["Subject"].matches("^cron:")): - mail.move("INBOX.crap.cron") - return - - if is_to_or_from(mail,"austin-group-l@opengroup.org"): - mail.move("INBOX.POSIX") - return - - if mail["From"].contains("builds@travis-ci.org"): - mail.move("INBOX.crap.TravisCI") - return - - # # Fall 2012 ############################################################ - - # # SCI210 (Teaming principles) - # if mail["Subject"].contains("Fall-2012-SCI-21000-001:"): - # mail.move("INBOX.classes.2012-2.SCI210") - # # CS180 (Java) - # if mail["Subject"].contains("fall-2012-cs-18000"): - # mail.move("INBOX.classes.2012-2.CS180") - # return - # if piazza_topic(mail, "CS 18000"): - # mail.move("INBOX.classes.2012-2.CS180.Piazza") - # return - # # SOC100 - # if mail["Subject"].contains("Fall-2012-SOC-10000"): - # mail.move("INBOX.classes.2012-2.SOC100") - # return - - # # Spring 2013 ########################################################## - - # # CS240 (C) - # if mail["Subject"].contains("[CS240] Submission result for"): - # mail.move("INBOX.classes.2013-1.CS240.autograder") - # return - # if mail["Subject"].contains("[CS240]") or mail["Subject"].contains("Spring-2013-CS-24000"): - # mail.move("INBOX.classes.2013-1.CS240") - # return - # if piazza_topic(mail, "CS 240"): - # mail.move("INBOX.classes.2013-1.CS240.Piazza") - # return - # # PHYS220 - # if mail["Subject"].matches(".*(PHYS|CHIP)\s*220.*") or is_to_or_from(mail,"srdas@purdue.edu"): - # mail.move("INBOX.classes.2013-1.PHYS220") - # return - # # SOC220 (Social Problems) - # if mail["Subject"].contains("Spring-2013-SOC-22000"): - # mail.move("INBOX.classes.2013-1.SOC220") - # return - - # # Fall 2013 ############################################################ - - # # CS250 (Computer Architecture) - # if mail["Subject"].contains("Fall-2013-CS-25000"): - # mail.move("INBOX.classes.2013-2.CS250") - # return - # if piazza_topic(mail, "CS 250") or piazza_topic(mail, "CS 250-FALL2013"): - # mail.move("INBOX.classes.2013-2.CS250.Piazza") - # return - # # CS251 (Intro Algo) - # if mail["Subject"].contains("Fall-2013-CS-25100"): - # mail.move("INBOX.classes.2013-2.CS251") - # return - # if piazza_topic(mail, "CS 251"): - # mail.move("INBOX.classes.2013-2.CS251.Piazza") - # return - # # SPAN101 - # if mail["Subject"].contains("Fall-2013-SPAN-10100"): - # mail.move("INBOX.classes.2013-2.SPAN101") - # return - # # MA261 (Calc III) - # if mail["Subject"].contains("Fall-2013-MA-26100"): - # mail.move("INBOX.classes.2013-2.MA261") - # return - # # MA265 (Linear Algebra) - # if mail["Subject"].contains("Fall-2013-MA-26500"): - # mail.move("INBOX.classes.2013-2.MA265") - # return - - # # Spring 2014 ########################################################## - - # # COM217 - # if mail["Subject"].contains("Spring-2014-COM-21700-004"): - # mail.move("INBOX.classes.2014-1.COM217") - # return - # if mail["From"].contains("mixable") and mail["Subject"].matches("^COM 21700"): - # mail.move("INBOX.classes.2014-1.COM217.Mixable") - # return - # # CS252 (Systems Programming) - # if piazza_topic(mail, "CS 25200"): - # mail.move("INBOX.classes.2014-1.CS252.Piazza") - # return - # # CS307 (Software Engineering) - # if is_to_or_from(mail, "dunsmore@purdue.edu") or mail["Subject"].contains("Spring-2014-CS-30700-LE1"): - # mail.move("INBOX.classes.2014-1.CS307") - # return - # # SPAN102 - # if mail["Subject"].contains("spring-2014-span-102"): - # mail.move("INBOX.classes.2014-1.SPAN102") - # return - # # STAT350 - # if is_to_or_from(mail, "ssellke@purdue.edu"): - # mail.move("INBOX.classes.2014-1.STAT350") - # return - # if piazza_topic(mail, "STAT 35000 (SELLKE)"): - # mail.move("INBOX.classes.2014-1.STAT350.Piazza") - # return - - # # Fall 2014 ############################################################ - - # # CS334 (Graphics) - # if (is_to_or_from(mail, "lin553@purdue.edu") or mail["Subject"].contains("Fall-2014-CS-33400")): - # mail.move("INBOX.classes.2014-2.CS334") - # return - # # CS354 (OS) - # if piazza_topic(mail, "CS 354"): - # mail.move("INBOX.classes.2014-2.CS354.Piazza") - # return - # # CS381 (Algo) - # if piazza_topic(mail, "CS 381"): - # mail.move("INBOX.classes.2014-2.CS381.Piazza") - # return - # # CS456 (Programming languages) - # if piazza_topic(mail, "CS 456"): - # mail.move("INBOX.classes.2014-2.CS456.Piazza") - # return - # # MA416 - # if mail["Subject"].contains("Fall-2014-MA-41600"): - # mail.move("INBOX.classes.2014-2.MA416") - # return - # # PHYS221 - # if (False - # or is_to_or_from(mail, "cui@purdue.edu") - # or is_to_or_from(mail, "shina@purdue.edu") - # or is_to_or_from(mail, "ajith@purdue.edu") - # ): - # mail.move("INBOX.classes.2014-2.PHYS221") - # return - - # # Spring 2015 ######################################################### - - # # CS352 (Compilers) - # if is_to_or_from(mail, "wjg@cs.purdue.edu"): - # mail.move("INBOX.classes.2015-1.CS352") - # return - # if piazza_topic(mail, "CS 352"): - # mail.move("INBOX.classes.2015-1.CS352.Piazza") - # return - # # CS408 (Software testing) - # if (False - # or mail["Subject"].contains("spring-2015-cs-40800") - # or is_to_or_from(mail, "li1471@purdue.edu") - # or is_to_or_from(mail, "kirby@purdue.edu") - # or is_to_or_from(mail, "webb39@purdue.edu") - # or is_to_or_from(mail, "Jkou@purdue.edu") - # or is_to_or_from(mail, "nstodda@purdue.edu") - # or is_to_or_from(mail, "aryker@purdue.edu") # TA - # ): - # mail.move("INBOX.classes.2015-1.CS408") - # return - # # CS448 (Databases) - # if piazza_topic(mail, "CS 44800"): - # mail.move("INBOX.classes.2015-1.CS448.Piazza") - # return - # if mail["Subject"].matches("CS *448"): - # mail.move("INBOX.classes.2015-1.CS448") - # return - # # ME297 (FRC) - # if (False - # or mail["Subject"].contains("[ME297]") - # or is_to_or_from(mail, "heller5@purdue.edu") - # ): - # mail.move("INBOX.classes.2015-1.ME297") - # return - # # SOC324 (Criminology) - # if mail["Subject"].contains("spring-2015-soc-32400"): - # mail.move("INBOX.classes.2015-1.SOC324") - # return - - # # Fall 2015 ############################################################ - - # # CHM 490 (History & Philosophy of Science) - # if is_to_or_from(mail, "gmbodner@purdue.edu"): - # mail.move("INBOX.classes.2015-2.CHM490") - # return - # # CS 334 (Graphics) - # if ( - # False - # or mail["Subject"].contains("fall-2015-cs-33400-le1") - # or is_to_or_from(mail, "aliaga@purdue.edu") - # or is_to_or_from(mail, "abejara@purdue.edu") - # ): - # mail.move("INBOX.classes.2015-2.CS334") - # return - # if piazza_topic(mail, "CS 334"): - # mail.move("INBOX.classes.2015-2.CS334.Piazza") - # return - # # CS 490 (Senior Project) - # if is_to_or_from(mail, "anesen@purdue.edu"): - # mail.move("INBOX.classes.2015-2.CS490") - # return - # if piazza_topic(mail, "CS 49000"): - # mail.move("INBOX.classes.2015-2.CS490.Piazza") - # return - # # MA 416 (Probability) - # if mail["Subject"].contains("fall-2015-ma-41600"): - # mail.move("INBOX.classes.2015-2.MA416") - # return - # if piazza_topic(mail, "SELLKE 416 "): - # mail.move("INBOX.classes.2015-2.MA416.Piazza") - # return - - # # FRC 4272 - # if mail["Subject"].contains("[ME297]"): - # mail.move("INBOX.classes.2015-2.FRC4272") - # return - - # 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 - - # Everything else ##################################################### - mail.move("INBOX.ham"); - -handle_mapping = { - "INBOX": my_filters, - } -processor.maildirs = handle_mapping.keys() -for mail in processor: - handle_mapping[mail.maildir](mail) -- cgit v1.1-4-g5e80 From 25ff8d52b6420a6bd3b43acb5d5b9a674f49af5d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 7 Dec 2016 18:18:58 -0500 Subject: wanderlust: change how .folders filtering happens Actually, remove the filtering. Just move old folders to ~/Maildir.old`. --- .config/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/Makefile b/.config/Makefile index 5274756..3b7ebb1 100644 --- a/.config/Makefile +++ b/.config/Makefile @@ -21,7 +21,7 @@ clean: .PHONY: all clean ${HOME}/.folders: ${HOME}/Maildir $(MAKEFILE_LIST) - find -L $< -mindepth 2 -maxdepth 2 \( -type f -name "maildirfolder" -o -type d -name new -o -type d -name tmp -o -type d -name cur \) -printf '%P\0' | xargs -r0 dirname -z -- | sort -zu | xargs -0 printf -- '.%s\n' | grep -vP '^\.FOLDERS.Ham.20(?!1[56])' > '$@' + find -L $< -mindepth 2 -maxdepth 2 \( -type f -name "maildirfolder" -o -type d -name new -o -type d -name tmp -o -type d -name cur \) -printf '%P\0' | xargs -r0 dirname -z -- | sort -zu | xargs -0 printf -- '.%s\n' > '$@' ${GIT_DIR}/info/exclude: ${HOME}/.git.info.exclude.in $(shell echo .??*/) ( cat $<; find $^ -type f -name 'CACHEDIR.TAG' -printf '%h\n'|sed 's@^\./@/@' ) > $@ -- cgit v1.1-4-g5e80 From b4209c316c27c49cebabe51804376640656d6e78 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 11 Feb 2017 18:23:08 -0500 Subject: emacs: migrate to use-package --- .config/emacs/init.el | 167 ++++++++++++++++++++------------------------------ 1 file changed, 67 insertions(+), 100 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index f1650a4..8d8859e 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -45,107 +45,79 @@ (set-face-attribute 'default nil :height 80) -;;;; Bootstrap el-get ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; This downloads and installs el-get (package management) if isn't -;; installed. +;;;; Package management ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Derived from ELPA installation -;; http://tromey.com/elpa/install.html -(defun eval-url (url) - (let ((buffer (url-retrieve-synchronously url))) - (save-excursion - (set-buffer buffer) - (goto-char (point-min)) - (re-search-forward "^$" nil 'move) - (eval-region (point) (point-max)) - (kill-buffer (current-buffer))))) - -(add-to-list 'load-path (concat el-get-dir "el-get")) -(unless (require 'el-get nil t) - (let ((el-get-install-branch "master")) ;; live life on the edge - (eval-url "https://github.com/dimitri/el-get/raw/master/el-get-install.el"))) - - -;;;; Install packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; This is kinda funny how it works. -;; -;; package.el/ELPA (The standard package manager in Emacs 24) has -;; terrible programatic management. It's great at installing packages, -;; but only interactively. So, I -;; 1) Disable package.el from getting loading all downloaded packages -;; 2) Use el-get to load a specified list of packages from elpa. -;; -;; This is also nice because I can do event-based programming for what -;; to do once a package is loaded, using :after. - -;; For some reason, el-get adds a bunch of 3rd-party repos to -;; package-archives. I guess I'm ok with that? I don't have to -;; manage them. +;; package.el +(require 'package) +(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) (setq package-enable-at-startup nil) - -;; What packages el-get should get from ELPA (if it gets them at all) -(setq el-get-sources '( - ;; Minor modes - (:name dtrt-indent :type elpa ;; Detect indent style for existing files - :after (dtrt-indent-mode 1)) - (:name page-break-lines :type elpa ;; Display form-feeds pretty - :before (advice-add 'page-break-lines-mode-maybe - :override #'page-break-lines-mode) - :after (global-page-break-lines-mode 1)) - (:name smart-tabs-mode :type elpa ;; Indent with tabs, align with spaces - :after (progn - (smart-tabs-mode 1) - (apply 'smart-tabs-insinuate - (mapcar 'car smart-tabs-insinuate-alist)))) - ;; Major modes - (:name bison-mode :type elpa) - (:name coffee-mode :type elpa - :after (add-hook 'coffee-mode-hook +(package-initialize) +;; use-package.el +(setq use-package-always-ensure t) +(add-to-list 'load-path (concat user-emacs-directory "use-package")) +(require 'use-package) +(require 'bind-key) + +;; Minor modes +(use-package dtrt-indent ;; Detect indent style for existing files + :config (dtrt-indent-mode 1)) +(use-package page-break-lines ;; Display form-feeds pretty + :init (advice-add 'page-break-lines-mode-maybe + :override #'page-break-lines-mode) + :config (global-page-break-lines-mode 1)) +(use-package smart-tabs-mode ;; Indent with tabs, align with spaces + :config (progn + (smart-tabs-mode 1) + (apply 'smart-tabs-insinuate + (mapcar 'car smart-tabs-insinuate-alist)))) +;; Major modes +(use-package bison-mode + :mode (("\\.l\\'" . bison-mode) + ("\\.y\\'" . bison-mode) + ("\\.jison\\'" . jison-mode))) +(use-package coffee-mode + :mode ("\\.coffee\\'" + "\\.iced\\'" + "\\Cakefile\\'" + "\\.cson\\'") + :interpreter "coffee" + :config (add-hook 'coffee-mode-hook '(lambda () (set (make-local-variable 'tab-width) 2) (set (make-local-variable 'indent-tabs-mode) nil) ))) - (:name glsl-mode :type elpa) - (:name go-mode :type elpa) - (:name graphviz-dot-mode :type elpa) - (:name haml-mode :type elpa) - (:name markdown-mode :type elpa - :after (add-to-list 'auto-mode-alist '("\\.ronn\\'" . markdown-mode))) - (:name mediawiki :type elpa) - (:name nginx-mode :type elpa - :after (put 'nginx-indent-level 'safe-local-variable 'integerp)) - (:name scss-mode :type elpa) - (:name yaml-mode :type elpa) - )) -;; What packages el-get should install, both from above, and its -;; internal list of sources. -(el-get 'sync (append - '(el-get) - ;; Minor modes - '(dtrt-indent - page-break-lines - smart-tabs-mode - ) - ;; Major modes - (if (file-exists-p "~/Maildir") ; wanderlust is huge, only use on emailing boxes - '(apel flim semi wanderlust) - '()) - '( - ;;nxhtml ; nxhtml is invasive, only enable if actively using - bison-mode - coffee-mode - glsl-mode - go-mode - graphviz-dot-mode - haml-mode - markdown-mode - yaml-mode - mediawiki - nginx-mode - php-mode-improved - scss-mode - yaml-mode - ))) +;;(use-package php-mode-improved +;; :mode (("\\.php[s34]?\\'" . php-mode) +;; ("\\.phtml\\'" . php-mode) +;; ("\\.inc\\'" . php-mode)) +;; :config (add-hook 'php-mode-hook +;; '(lambda () +;; (c-set-offset 'cpp-macro 0) +;; ))) +(use-package php-mode :mode ("\\.php[s345t]?\\'" "/\\.php_cs\\(\\.dist\\)?\\'" "\\.phtml\\'" "/Amkfile\\'" "\\.amk\\'")) +(use-package glsl-mode :mode ("\\.vert\\'" "\\.frag\\'" "\\.geom\\'" "\\.glsl\\'")) +(use-package go-mode :mode "\\.go\\'") +(use-package graphviz-dot-mode :mode ("\\.dot\\'" "\\.gv\\'")) +(use-package haml-mode :mode "\\.haml\\'") +(use-package less-css-mode :mode "\\.less\\'") +(use-package markdown-mode :mode ("\\.markdown\\'" "\\.md\\'" "\\.ronn\\'")) +(use-package nginx-mode :mode ("nginx\\.conf\\'" "/nginx/.+\\.conf\\'")) +(use-package scss-mode :mode "\\.scss\\'") +(use-package yaml-mode :mode "\\.e?ya?ml\\'") + +;;(use-package nxhtml) ; nxhtml is invasive, only enable if actively using + +(if (file-exists-p "~/Maildir") + ;;'(apel flim semi wanderlust) + (use-package wanderlust + :config (progn + (define-mail-user-agent + 'wl-user-agent + 'wl-user-agent-compose + 'wl-draft-send + 'wl-draft-kill + 'mail-send-hook) + (setq mail-user-agent 'wl-user-agent)))) ;; Misc. crap @@ -314,11 +286,6 @@ sh-script.el is broken." (set (make-local-variable 'tab-width) 4) )) -(add-hook 'php-mode-hook - '(lambda () - (c-set-offset 'cpp-macro 0) - )) - (add-hook 'tex-mode-hook '(lambda () (set (make-local-variable 'tab-always-indent) nil) -- cgit v1.1-4-g5e80 From 4da06eb82780b2592aa0d44c3f97c1b7caa9525c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 11 Feb 2017 18:25:02 -0500 Subject: email: use lukeshu@lukeshu.com, /bin/sendmail --- .config/emacs/wl.el | 16 ++++------------ .config/git/config | 7 +------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/.config/emacs/wl.el b/.config/emacs/wl.el index e9e61bd..c27c87e 100644 --- a/.config/emacs/wl.el +++ b/.config/emacs/wl.el @@ -1,24 +1,17 @@ ;; mode:-*-emacs-lisp-*- -(setq user-mail-address "lukeshu@sbcglobal.net") +(setq user-mail-address "lukeshu@lukeshu.com") ;; wanderlust (setq ;; Misc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - wl-local-domain "lukeshu.ath.cx" + wl-local-domain "lan.lukeshu.com" wl-icon-directory "~/.emacs.d/el-get/wanderlust/icons" + wl-message-id-domain user-mail-address ;; Network ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; This only deals with sending--I use offlineimap to fetch - wl-draft-send-mail-function 'wl-draft-send-mail-with-smtp - ;; The following settings are Yahoo!'s SMTP servers: - wl-smtp-connection-type (quote ssl) - wl-smtp-authenticate-type "login" - wl-smtp-posting-server "plus.smtp.mail.yahoo.com" - ;wl-smtp-posting-server "outbound.att.net" - wl-smtp-posting-port 465 - wl-smtp-posting-user user-mail-address - wl-message-id-domain user-mail-address + wl-draft-send-mail-function 'wl-draft-send-mail-with-sendmail ;; Folders/File system ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; elmo-maildir-folder-path "~/Maildir" ;; where I store my mail @@ -45,7 +38,6 @@ ;; Writing wl-from (concat user-full-name " <" user-mail-address ">") ;; From: line - ;;wl-organization "Foo Corp" wl-fcc-force-as-read t ;; mark sent messages as read mime-edit-split-message nil ;; don't split long messages diff --git a/.config/git/config b/.config/git/config index 71c68f6..4fe81a5 100644 --- a/.config/git/config +++ b/.config/git/config @@ -1,13 +1,8 @@ [user] name = Luke Shumaker - email = lukeshu@sbcglobal.net + email = lukeshu@lukeshu.com [color] ui = auto -[sendemail] - smtpencryption = ssl - smtpserver = plus.smtp.mail.yahoo.com - smtpuser = lukeshu@sbcglobal.net - smtpserverport = 465 [push] default = matching [alias] -- cgit v1.1-4-g5e80 From 54f87a1321656c43a8e25fb00bb048a8f732ed14 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 11 Feb 2017 18:26:01 -0500 Subject: Stuff --- .config/emacs/custom.el | 24 ++++++++++++++++++++++-- .config/emacs/init.el | 7 +++++-- .config/maildirproc/att.rc | 40 +++++++++++++++++++++++++++------------- 3 files changed, 54 insertions(+), 17 deletions(-) diff --git a/.config/emacs/custom.el b/.config/emacs/custom.el index a099221..ac20ba1 100644 --- a/.config/emacs/custom.el +++ b/.config/emacs/custom.el @@ -33,11 +33,30 @@ (quote ("xelatex -interaction nonstopmode -output-directory %o %f" "xelatex -interaction nonstopmode -output-directory %o %f" "xelatex -interaction nonstopmode -output-directory %o %f"))) '(org-src-fontify-natively t) + '(package-selected-packages + (quote + (wanderlust yaml-mode scss-mode nginx-mode markdown-mode less-css-mode haml-mode graphviz-dot-mode go-mode glsl-mode php-mode php-mode-improved coffee-mode bison-mode smart-tabs-mode page-break-lines dtrt-indent))) '(ruby-deep-arglist nil) '(ruby-deep-indent-paren nil) '(safe-local-variable-values (quote - ((Nginx-indent-tabs-mode) + ((Fill-Column . 64) + (eval c-set-offset + (quote arglist-close) + 0) + (eval c-set-offset + (quote arglist-intro) + (quote ++)) + (eval c-set-offset + (quote case-label) + 0) + (eval c-set-offset + (quote statement-case-open) + 0) + (eval c-set-offset + (quote substatement-open) + 0) + (Nginx-indent-tabs-mode) (Nginx-indent-level . 4) (Nginx-indent-level . 8) (c-set-style . "K&R")))) @@ -46,7 +65,8 @@ '(smtpmail-smtp-server "plus.smtp.mail.yahoo.com") '(smtpmail-smtp-service 587) '(tramp-use-ssh-controlmaster-options nil) - '(uniquify-buffer-name-style (quote post-forward-angle-brackets) nil (uniquify))) + '(uniquify-buffer-name-style (quote post-forward-angle-brackets) nil (uniquify)) + '(use-package-verbose (quote debug))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 8d8859e..b7ee6df 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -13,10 +13,12 @@ elmo-cache-directory (concat xdg-cache-home "emacs/elmo-cache/") auto-save-list-file-prefix (concat xdg-cache-home "emacs/auto-save-list/saves-") tramp-persistency-file-name (concat xdg-cache-home "emacs/tramp-cache.el") - custom-file (concat user-emacs-directory "custom.el") wl-init-file (concat user-emacs-directory "wl.el") ) +(setq custom-file (concat user-emacs-directory "custom.el")) +(load custom-file 'noerror) + ;;;; The basics that I can't use Emacs without ;;;;;;;;;;;;;;;;;;;;;;; (show-paren-mode 1) (column-number-mode 1) @@ -36,7 +38,6 @@ point-entered minibuffer-avoid-prompt face minibuffer-prompt )) -(load custom-file 'noerror) ;;;; Early settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -299,5 +300,7 @@ sh-script.el is broken." (add-to-list 'auto-mode-alist '("PKGBUILD" . sh-mode)) (add-to-list 'auto-mode-alist '("SRCBUILD" . sh-mode)) +(add-to-list 'auto-mode-alist '("\\.mak\\'" . makefile-gmake-mode)) (add-to-list 'auto-mode-alist '("\\.jad\\'" . java-mode)) + (put 'downcase-region 'disabled nil) diff --git a/.config/maildirproc/att.rc b/.config/maildirproc/att.rc index 79d4469..67335e7 100644 --- a/.config/maildirproc/att.rc +++ b/.config/maildirproc/att.rc @@ -47,7 +47,7 @@ def majordomo_domain(mail, domain): if m: return m.group(1) -def is_to_or_from(mail,address): +def is_to_or_from(mail, address): """ Return true if [mail] is to or from an address that contains [address]. """ @@ -56,7 +56,7 @@ def is_to_or_from(mail,address): or mail["From"].contains(address) or mail["Reply-To"].contains(address) or mail.target.contains(address)) -def is_to_or_from_re(mail,address): +def is_to_or_from_re(mail, address): """ Return true if [mail] is to or from an address that matches the regex [address]. @@ -86,7 +86,7 @@ def bogofilter_spam(mail): # # The core of my filters -def move_ham(mail,folder): +def move_ham(mail, folder): y = datetime.datetime.now().year folder = "FOLDERS.Ham."+str(y)+folder dir = processor.maildir_base+"/"+folder @@ -157,6 +157,7 @@ def my_filters(mail): [ 'lists.fedorahosted.org', 'fedorahosted' ], [ 'lists.arthurdejong.org', 'arthurdejong' ], [ 'lists.stanford.edu', 'stanford' ], + [ 'mailman.stanford.edu', 'stanford' ], [ 'lists.parabola.nu', 'parabola' ], [ 'parabola.nu', 'parabola' ] ]: list = mailman_domain(mail, pair[0]) @@ -185,7 +186,7 @@ def my_filters(mail): move_ham(mail, ".software.parabola") return # .software.POSIX - if is_to_or_from(mail,"austin-group-l@opengroup.org"): + if is_to_or_from(mail, "austin-group-l@opengroup.org"): move_ham(mail, ".software.POSIX") return # .software.TravisCI @@ -215,7 +216,7 @@ def my_filters(mail): "@sourceforge.com", "@thyrsus.com", ]: - if is_to_or_from(mail,address): + if is_to_or_from(mail, address): move_ham(mail, ".software") return # .servers @@ -243,7 +244,7 @@ def my_filters(mail): if mail["From"].matches("@xkcd\.com"): move_ham(mail, ".Social.xkcd") return - if is_to_or_from(mail,"linkedin.com"): + if is_to_or_from(mail, "linkedin.com"): move_ham(mail, ".Social.LinkedIn") return # .BSA @@ -274,8 +275,8 @@ def my_filters(mail): move_ham(mail, ".BSA") return # .FRC - for address in [ "@ni.com", "@usfirst.org" ]: - if is_to_or_from(mail,address): + for address in [ "@ni.com", "@usfirst.org", "@firstinspires.org" ]: + if is_to_or_from(mail, address): move_ham(mail, ".FRC") return # .FRC.829 @@ -326,21 +327,22 @@ def my_filters(mail): if ( False or mail["Subject"].contains("[PASE]") - or is_to_or_from(mail,"Purduealumni@purdue.edu") - or is_to_or_from(mail,"pase@purdue.edu") + or is_to_or_from(mail, "Purduealumni@purdue.edu") + or is_to_or_from(mail, "pase@purdue.edu") ): move_ham(mail, ".Purdue.PASE") return if mail["Subject"].contains("[PLUG]"): move_ham(mail, ".Purdue.PLUG") return - if is_to_or_from(mail,"@cerias.purdue.edu"): + if is_to_or_from(mail, "@cerias.purdue.edu"): move_ham(mail, ".Purdue.CERIAS") return if ( False - or is_to_or_from(mail,"royfu@purdue.edu") - or is_to_or_from(mail,"usmannkhan@purdue.edu") + or is_to_or_from(mail, "purduehackers@gmail.com") + or is_to_or_from(mail, "royfu@purdue.edu") + or is_to_or_from(mail, "usmannkhan@purdue.edu") ): move_ham(mail, ".Purdue.Hackers") return @@ -351,6 +353,17 @@ def my_filters(mail): ): move_ham(mail, ".Purdue.CS") return + if ( + False + or is_to_or_from(mail, "askcco@purdue.edu") + or is_to_or_from_re(mail, "pmx-auto-approve\+.*@purdue\.edu") + or is_to_or_from(mail, "evertrue@purdue.edu") + or is_to_or_from(mail, "college.response@purdue.edu") + or is_to_or_from(mail, "purduepresident@purdue.edu") + or is_to_or_from(mail, "@prf.org") + ): + move_ham(mail, ".Purdue.misc") + return # .misc.* if mail["From"].matches("schwab\.com"): move_ham(mail, ".misc.schwab") @@ -400,6 +413,7 @@ def my_filters(mail): or mail["From"].contains("sales@solutionsinplastic.com") or mail["From"].contains("social@goodwillindy.org") or mail["From"].contains("support@support.digitalocean.com") + or mail["From"].contains("@pardonsnowden.org") ): move_ham(mail, ".misc.Newsletters") return -- cgit v1.1-4-g5e80 From 0283ec58b3f4e179c0d8f57e5fc9ecb6e7750e17 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 11 Feb 2017 18:33:07 -0500 Subject: Backport changes from build64 --- .local/bin/c | 2 ++ .local/bin/config-path | 4 +++- .local/bin/m | 7 +++++++ .local/bin/state-the-time | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 .local/bin/c create mode 100755 .local/bin/m create mode 100755 .local/bin/state-the-time diff --git a/.local/bin/c b/.local/bin/c new file mode 100755 index 0000000..7342845 --- /dev/null +++ b/.local/bin/c @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +exec xdotool click "${1:-1}" diff --git a/.local/bin/config-path b/.local/bin/config-path index 4b7cccb..dcac0e8 100755 --- a/.local/bin/config-path +++ b/.local/bin/config-path @@ -52,6 +52,7 @@ main() { var_init PATH var_init MANPATH var_init LD_LIBRARY_PATH + var_init PKG_CONFIG_PATH var_init RUBYLIB var_init PERL5LIB @@ -60,13 +61,14 @@ main() { var_add PATH "$prefix/bin" "$prefix/sbin" var_add MANPATH "$prefix/share/man" var_add LD_LIBRARY_PATH "$prefix"/lib{,32,64} + var_add PKG_CONFIG_PATH "$prefix"/lib{,32,64}/pkgconfig var_add RUBYLIB "$prefix"/lib{,32,64} var_add PERL5LIB "$prefix"/lib{,32,64}/perl5 done # Finally, print the values lines=() - for var in PATH MANPATH LD_LIBRARY_PATH RUBYLIB PERL5LIB; do + for var in PATH MANPATH LD_LIBRARY_PATH PKG_CONFIG_PATH RUBYLIB PERL5LIB; do lines+=("$(var_done "$var")") done shopt -s extglob diff --git a/.local/bin/m b/.local/bin/m new file mode 100755 index 0000000..9f4b4c6 --- /dev/null +++ b/.local/bin/m @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +if [[ $# -gt 0 ]]; then + exec xdotool mousemove_relative -- "$@" +else + xdotool mousemove_relative -- 1 1 + xdotool mousemove_relative -- -1 -1 +fi diff --git a/.local/bin/state-the-time b/.local/bin/state-the-time new file mode 100755 index 0000000..760b7e5 --- /dev/null +++ b/.local/bin/state-the-time @@ -0,0 +1,3 @@ +#!/bin/bash + +espeak "It's $(date +%_H:%M|sed 's/:00/ oh clock/')" -- cgit v1.1-4-g5e80