+++ /dev/null
-# Sieve filter
-##
-require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags" ];
-
-# Mailinglist Killfile
-if anyof (header :contains "from" "unwanted at example.com",
- header :contains "from" "spammer at example.net",
- header :contains "from" "troll at example.org"){
- discard;
- stop;
-}
-
-if anyof (header :contains "x-spam-flag" "yes",
- allof (header :regex "X-DSPAM-Result" "^(Spam|Virus|Bl[ao]cklisted)$",
- not header :contains "X-DSPAM-Reclassified" "Innocent")){
- # Spam goes into the spam folder
- setflag "\\Seen";
- fileinto :create "spam";
- stop;
-}
-
-# split out the various list forms
-# Mailman & other lists using list-id
-if exists "list-id" {
- if header :regex "list-id" "<([a-z_0-9-]+)[.@]" {
- set :lower "listname" "${1}";
- fileinto :create "${listname}";
- } elsif header :regex "list-id" "^\\s*<?([a-z_0-9-]+)[.@]" {
- set :lower "listname" "${1}";
- fileinto :create "${listname}";
- } else {
- keep;
- }
- stop;}
-# Listar and mailman like
-elsif exists "x-list-id" {
- if header :regex "x-list-id" "<([a-z_0-9-]+)\\\\." {
- set :lower "listname" "${1}";
- fileinto :create "${listname}";
- } else {
- keep;
- }
- stop;}
-# Ezmlm
-elsif exists "mailing-list" {
- if header :regex "mailing-list" "([a-z_0-9-]+)@" {
- set :lower "listname" "${1}";
- fileinto :create "${listname}";
- } else {
- keep;
- }
- stop;}
-# York lists service
-elsif exists "x-mailing-list" {
- if header :regex "x-mailing-list" "^\\s*([a-z_0-9-]+)@?" {
- set :lower "listname" "${1}";
- fileinto :create "${listname}";
- } else {
- keep;
- }
- stop;}
-# Smartlist
-elsif exists "x-loop" {
- if header :regex "x-loop" "^\\s*(a-z_0-9-]+)@?" {
- set :lower "listname" "${1}";
- fileinto :create "${listname}";
- } else {
- keep;
- }
- stop;}
-# poorly identified
-elsif envelope :contains "from" "owner-" {
- if envelope :regex "from" "owner-([a-z_0-9-]+)-outgoing@" {
- set :lower "listname" "${1}";
- fileinto :create "${listname}";
- } elsif envelope :regex "from" "owner-([a-z_0-9-]+)@" {
- set :lower "listname" "${1}";
- fileinto :create "${listname}";
- } elsif header :regex "Sender" "owner-([a-z_0-9-]+)@" {
- set :lower "listname" "${1}";
- fileinto :create "${listname}";
- } else {
- keep;
- }
- stop;}
-# other poorly identified
-elsif envelope :contains "from" "-request" {
- if envelope :regex "from" "([a-z_0-9-]+)-request@" {
- set :lower "listname" "${1}";
- fileinto :create "${listname}";
- } else {
- keep;
- }
- stop;
-}
--- /dev/null
+
+# based on this gdb output:
+# warning: File "/a/opt/emacs-debiantesting/src/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
+# To enable execution of this file add
+# add-auto-load-safe-path /a/opt/emacs-debiantesting/src/.gdbinit
+# line to your configuration file "/home/ian/.gdbinit".
+# To completely disable this security protection add
+# set auto-load safe-path /
+# line to your configuration file "/home/ian/.gdbinit".
+# For more information about this security protection see the
+# "Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
+# info "(gdb)Auto-loading safe path"
+set auto-load safe-path /
dusage="1 5 10 20 30 40 50"
musage="1 5 10 20 30"
-e() { echo "$*"; "$@"; }
+e() { echo "cron: $*"; "$@"; }
fnd="findmnt --types btrfs --noheading"
for x in $($fnd --output "SOURCE" --nofsroot | sort -u); do
mnt=$($fnd --output "TARGET" --first-only --source $x)
[[ $mnt ]] || continue
- echo "Before balance of $mnt"
- e btrfs filesystem df $mnt
- df -H $mnt
+ # for comparing before and after balance.
+ # the log is already fairly verbose, so commented.
+ # e btrfs filesystem df $mnt
+ # e df -H $mnt
if btrfs filesystem df $mnt | grep -q "Data+Metadata"; then
for usage in $dusage; do
- e btrfs balance start -v -dusage=$usage -musage=$usage $mnt
+ e btrfs balance start -dusage=$usage -musage=$usage $mnt
done
else
e btrfs balance start -dusage=0 $mnt
for usage in $dusage; do
- e btrfs balance start -v -dusage=$usage $mnt
+ e btrfs balance start -dusage=$usage $mnt
done
e btrfs balance start -musage=0 $mnt
for usage in $musage; do
- e btrfs balance start -v -musage=$usage $mnt
+ e btrfs balance start -musage=$usage $mnt
done
fi
- echo "After balance of $mnt"
- btrfs filesystem df $mnt
- df -H $mnt
-
+ # e btrfs filesystem df $mnt
+ # e df -H $mnt
date=$(
btrfs scrub status $mnt | \
sed -rn 's/^\s*scrub started at (.*) and finished.*/\1/p'
# it makes the comp lag like shit for a day,
# so I'm going with 90 days.
if (( $date > `date +%s` - 60*60*24*30 )); then
- echo "skiping scrub of $mnt"
+ echo "cron: skiping scrub of $mnt"
continue
fi
fi
- btrfs scrub start -Bd $mnt
+ e btrfs scrub start -Bd $mnt
done
mail_plugins = $mail_plugins sieve
-# ian: added this, based on errors and some googling.
-# Exim says something like "LMTP error after RCPT ... 550 ... User doesn't exist someuser@somedomain"
-# Dovecot verbose log says something like "auth-worker(9048): passwd(someuser@somedomain): unknown user"
+# For a normal setup, we need something like this, which
+# removes the domain part
+# auth_username_format = %Ln
+#
+# or else # Exim says something like
+# "LMTP error after RCPT ... 550 ... User doesn't exist someuser@somedomain"
+# Dovecot verbose log says something like
+# "auth-worker(9048): passwd(someuser@somedomain): unknown user"
# reference: http://wiki.dovecot.org/LMTP/Exim
- auth_username_format = %Ln
+#
+# However, I use this to direct all mail to the same inbox.
+# A more normal way to do this, which I did at first is to have
+# a router in exim almost at the end, eg 950,
+#local_catchall:
+# debug_print = "R: catchall for $local_part@$domain"
+# driver = redirect
+# domains = +local_domains
+# data = ian
+# based on
+# http://blog.alteholz.eu/2015/04/exim4-and-catchall-email-address/
+# with superflous options removed.
+# However, this causes the envelope to be rewritten,
+# which makes filtering into mailboxes a little less robust or more complicated,
+# so I've done it this way instead. it also requires
+# modifying the local router in exim.
+#
+ auth_username_format = ian
}
# for debugging info, uncomment these.
# logs go to syslog, and to /var/log/mail.log
# auth_verbose=yes
-mail_debug=yes
+#mail_debug=yes
--- /dev/null
+
+### router/900_exim4-config_local_user
+#################################
+
+# This router matches local user mailboxes. If the router fails, the error
+# message is "Unknown user".
+
+local_user:
+ debug_print = "R: local_user for $local_part@$domain"
+ driver = accept
+ domains = +local_domains
+# ian: commented this, in conjunction with a dovecot lmtp
+# change so I get mail for all users.
+# check_local_user
+ local_parts = ! root
+ transport = LOCAL_DELIVERY
+ cannot_route_message = Unknown user
+++ /dev/null
-# redirect anything that hasn't been caught yet to me,
-# based on
-# http://blog.alteholz.eu/2015/04/exim4-and-catchall-email-address/
-# that reference includes the lines allow_fail and allow_defer, but
-# afaik, they are completely superfluous and just copied from another
-# router, they apply when the expansion of data contains :defer: or :fail:,
-# but we are just using a string literal.
-local_catchall:
- debug_print = "R: catchall for $local_part@$domain"
- driver = redirect
- domains = +local_domains
- data = ian
--- /dev/null
+export ACME_TINY_WRAPPER_CERT_DIR=/p/c/machine_specific/$HOSTNAME/webservercerts
+export ACME_TINY_PATH="/a/opt/acme-tiny/acme_tiny.py"
+
+if [ -f $HOME/path_add-function ]; then
+ . $HOME/path_add-function
+ path_add /usr/sbin /usr/local/sbin /sbin
+ path_add /a/exe /a/opt/bin $HOME/.cabal/bin
+
+ if [ -r /etc/alternatives/java_sdk ]; then
+ export JAVA_HOME=/etc/alternatives/java_sdk
+ path_add /etc/alternatives/java_sdk
+ fi
+fi
+
+export EDITOR="emacsclient"
+# this makes emacsclient file/-c start a server instance if none is running,
+# instead of some alternate editor logic
+export ALTERNATE_EDITOR=""
+
+
+# makes subsequent syscalls to localtime use cached timezone,
+# so basically restart the comp if you change time zones,
+# and avoid a few syscalls, which makes a tiny tiny perf difference.
+# I also set this in
+# /a/c/filesystem/etc/systemd/system.conf.d/tz.conf
+# https://blog.packagecloud.io/eng/2017/02/21/set-environment-variable-save-thousands-of-system-calls/
+export TZ=:/etc/localtime
+
+# ubuntu starts gpg agent automatically with /etc/X11/Xsession.d/90gpg-agent.
+# fedora doesn't, which left me to figure this out, and google was no help.
+# fedora documentation is often quite bad :(
+# This is mostly copied from that file.
+# Main difference is that we eval the result of starting gpg-agent,
+# while that file executes it through xsession specific var.
+# Also make sourcing the pidfile make more sense.
+# End result should be the same afaik.
+# for gpg-agent to work when calling gpg from the command line,
+# we need an environment variable that is setup via the eval.
+# which is why we do this upon login, so it can propogate
+# It is also written to the file $HOME/.gnupg/gpg-agent-info-$(hostname)
+# I'm not aware if that is ever used, but just fyi.
+# I also added the bit about xmessaging the stderr,
+# because I'd like to know if the command fails
+if [ -f /etc/fedora-release ]; then
+ : ${GNUPGHOME=$HOME/.gnupg}
+
+ GPGAGENT=/usr/bin/gpg-agent
+ PID_FILE="$GNUPGHOME/gpg-agent-info-$(hostname)"
+
+ if ! $GPGAGENT 2>/dev/null; then
+ temp="$(mktemp)"
+ eval "$($GPGAGENT --homedir /p/do-not-delete --daemon --sh --write-env-file=$PID_FILE 2>$temp)"
+ temperr="$(<"$temp")"
+ [ -n "$temperr" ] && xmessage "gpg-agent stderr: $temperr"
+ elif [ -r "$PID_FILE" ]; then
+ . "$PID_FILE"
+ export GPG_AGENT_INFO
+ fi
+fi
+
+# ubuntu has 002 for non-system users, debian has 022. 002 makes groups
+# be rw instead of r. One security concern is where some unixes put
+# every user in a same group, so if you copy files there with exact
+# perms, that is probably not what you want. I don't use a system like
+# that. I don't care much either way, but the ubuntu one seems a bit
+# more user friendly.
+if (( EUID >= 1000 )); then
+ umask 002
+fi
--- /dev/null
+[Manager]
+DefaultEnvironment=TZ=:/etc/localtime
+# also set in profile.d/environment.sh with explanation there
+
import XMonad
--import XMonad.Config.Gnome
[ ((modm, xK_q), io (exitWith ExitSuccess)) -- %! Quit xmonad
, ((modm, xK_2), spawn "pavucontrol")
- , ((modm, xK_3), spawn "firefox")
+ , ((modm, xK_3), spawn "firefox -no-remote -P sfw")
+ , ((modm, xK_4), spawn "firefox")
- , ((modm, xK_4), spawn "input-setup")
+ , ((modm, xK_5), spawn "input-setup")
-- we would really want to keep track of which workspace is darkened,
-- and change things depending on where that workspace is
--- /dev/null
+# Sieve filter
+# note: main is just a random name, since dovecot required a name
+##
+require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags", "include" ];
+
+# many examples out there check for "X-Spam-Status" "^Yes", but we do
+# this in exim, which doesn't add that by default. We could modify it's
+# config to add $spam_action to a header, like other headers, but simply
+# using an integer threshold here is simpler: the default threshold for
+# spamassassin is 5, so we have 5 plus symbols here.
+if header :regex "x-spam_bar" "^\\+{5}" {
+ fileinto :create "Junk";
+ stop;
+}
+
+include :personal "personal";
+
+
+# note, i originally used something like this to filter mailing lists
+# http://www.dovecot.org/list/dovecot/2014-September/097846.html
+# However, I found that there were a lot of special cases
+# where I did not want them filtered, like small mailing lists, etc,
+# so I prefer to keep a list of lists that I want filed into folders.
+# However, it was useful as an example for constructing that code.