[user]
- name = Ian Kelling
- email = ian@iankelling.org
+name = Ian Kelling
+email = iank@fsf.org
[alias]
- co = checkout
- s = status
- ci = commit
- lol = log --graph --decorate --pretty=oneline --abbrev-commit --all
+# Always use the git lg alias instead of git log. It's too easy to get
+# confused by not seeing branches in git log output.
+lg = log --graph --decorate
+co = checkout
+s = status
+ci = commit
+lol = log --graph --decorate --pretty=oneline --abbrev-commit --all
+
[core]
- excludesfile = /home/ian/.gitignore_global
+excludesfile = ~/.gitignore_global
[github]
- user = ian-kelling
- token = d2dc0c5c6fef5378cc896a617e53c1a9
+user = ian-kelling
+token = d2dc0c5c6fef5378cc896a617e53c1a9
[credential]
- helper = cache
+helper = cache
- # new option, but not available yet on debian wheezy
- # [push]
+# new option, but not available yet on debian wheezy
+# [push]
# default = simple
# based on ghc advice,
# https://ghc.haskell.org/trac/ghc/wiki/Building/GettingTheSources
[diff]
- ignoreSubmodules = dirty
- tool = meld
+ignoreSubmodules = dirty
+tool = meld
[gitreview]
- username = iank
- remote = origin
+username = iank
+remote = origin
# this is for newer git version. Doesn't work for ubuntu 12.04's version
#[push]
# default = simple
[color]
- ui = auto
- status = auto
- branch = auto
- interactive = auto
- diff = auto
+ui = auto
+status = auto
+branch = auto
+interactive = auto
+diff = auto
# for hooks. http://stackoverflow.com/questions/2293498/git-commit-hooks-global-settings
[init]
- templatedir = ~/.git_template
+templatedir = ~/.git_template
[difftool]
- tool = meld
- prompt = false
+tool = meld
+prompt = false
[format]
# This seemed like a good idea, but it broke interactive rebase, so disabled.
# for format-patch, use --base=auto. This means we need to do
# or git checkout -b my-branch origin/whatever
# autoSetupMerge = always
- # git pull always does rebase by default
- autoSetupRebase = always
+# git pull always does rebase by default
+autoSetupRebase = always
+[push]
+default = simple
+# file generated when emacs has a file open
\#*\#
-/GPATH
-/GRTAGS
-/GTAGS
-*.~undo-tree~
+# files generated from gnu global
+GPATH
+GRTAGS
+GTAGS
+# file generated when vi has a file open
+*.swp
# automatically installed/preinstalled apps
fdroid_pkgs=(
at.bitfire.davdroid
+ com.alaskalinuxuser.justnotes
+ com.artifex.mupdfdemo
com.fsck.k9
com.ichi2.anki
+ com.jmstudios.redmoon
com.notecryptpro
com.nutomic.syncthingandroid
com.termux
+ com.zoffcc.applications.zanavi
+ cz.martykan.forecastie
de.danoeh.antennapod
de.marmaro.krt.ffupdater
im.vector.alpha # riot
+ info.papdt.blackblub
me.ccrama.redditslide
+ me.tripsit.tripmobile
net.gaast.giggity
net.osmand.plus
+ net.sourceforge.opencamera
org.dmfs.tasks # caldav tasks thing
org.fdroid.fdroid
+ org.isoron.uhabits
+ org.kde.kdeconnect_tp
org.quantumbadger.redreader
- org.secuso.privacyfriendlyweather
org.smssecure.smssecure
org.fedorahosted.freeotp
- com.ghostsq.commander
- me.tripsit.tripmobile
- # https://forum.xda-developers.com/android/software-hacking/wip-selinux-capable-superuser-t3216394
- me.phh.superuser
)
+# https://forum.xda-developers.com/android/software-hacking/wip-selinux-capable-superuser-t3216394
+# for maru,
+#me.phh.superuser
+
fdup() {
local -A installed updated
local p
done
}
+firefox-default-profile() {
+ key=Default value=1 section=$1
+ file=/p/c/subdir_files/.mozilla/firefox/profiles.ini
+ sed -ri "/^ *$key/d" "$file"
+ sed -ri "/ *\[$section\]/,/^ *\[[^]]+\]/{/^\s*$key[[:space:]=]/d};/ *\[$section\]/a $key=$value" "$file"
+}
+fdhome() { #firefox default home profile
+ firefox-default-profile Profile0
+}
+
+fdwork() {
+ firefox-default-profile Profile4
+}
+
ff() {
if type -P firefox &>/dev/null; then
firefox "$@"
grep -P --binary-files=text "$@" ${HISTFILE:-~/.bash_history} | tail -n 80;
}
+ks() { # history search
+ grep -P --binary-files=text "$@" ${HISTFILE:-~/.bash_history} | uniq;
+}
+
make-targets() {
# show make targets, via http://stackoverflow.com/questions/3063507/list-goals-targets-in-gnu-make
c "$1"
}
+mkt() { # mkdir and touch file
+ local path="$1"
+ mkdir -p "$(dirname "$path")"
+ touch "$path"
+}
+
mkdir() { command mkdir -p "$@"; }
+otp() {
+ echo "oathtool --totp -b"
+ oathtool --totp -b "$@"
+}
+
pithos() {
cd /
export PYTHONPATH=/a/opt/Pithosfly
done
}
+ping8() { ping 8.8.8.8; }
+
pub() {
rld /a/h/_site/ li:/var/www/iankelling.org/html
}
# initial setup of rss2email:
# r2e new r2e@iankelling.org
# that initializes files, and sets default email.
- # Would have been simpler to just leave it off since i\'m not
- # using the default email. Symlinks won\'t work, so we use binds.
- # mkdir /p/c/binds/.config/
- # mv ~/.config/rss2email.cfg /p/c/binds/.config/
- # mkdir /p/c/binds/.local/share/
- # mv ~/.local/share/rss2email.json /p/c/binds/.local/share/
- # conflink
+ # symlink to the config doesn't work, so I copied it to /p/c
+ # and then use cli option to specify explicit path.
+ # Only option changed from default config is to set
+ # force-from = True
+ #
+ # or else for a few feeds, the from address is set by the feed, and
+ # if I fail delivery, then I send a bounce message to that from
+ # address, which makes me be a spammer.
+
r2e add $1 "$2" $1@r2e.iankelling.org
# get up to date and don't send old entries now:
r2e run --no-send $1
fi
}
+rmstrips() {
+ ssh fencepost head -n 300 /gd/gnuorg/EventAndTravelInfo/rms-current-trips.txt
+}
+
s() {
# background
# I use a function because otherwise we can't use in a script,
shellcheck -e 2086,2046,2068,2006,2119 "$@"
}
+skaraoke() {
+ local tmp out
+ in="$1"
+ out=${2:-${1%.*}.sh}
+ tmp=$(mktemp -d)
+ script -t -c "mpv --no-config --no-resume-playback --no-terminal --no-audio-display '$1'" $tmp/typescript 2>$tmp/timing
+ # todo, the current sleep seems pretty good, but it
+ # would be nice to have an empirical measurement, or
+ # some better wait to sync up.
+ #
+ # note: --loop-file=no prevents it from hanging if you have that
+ # set to inf the mpv config.
+ # --loop=no prevents it from exit code 3 due to stdin if you
+ # had it set to inf in mpv config.
+ #
+ # args go to mpv, for example --volume=80, 50%
+ cat >$out <<EOFOUTER
+#!/bin/bash
+trap "trap - TERM && kill 0" INT TERM ERR; set -e
+( sleep .2; scriptreplay <( cat <<'EOF'
+$(cat $tmp/timing)
+EOF
+) <( cat <<'EOF'
+$(cat $tmp/typescript)
+EOF
+))&
+base64 -d - <<'EOF'| mpv --loop=no --loop-file=no --no-terminal --no-audio-display "\$@" -
+$(base64 "$1")
+EOF
+kill 0
+EOFOUTER
+ rm -r $tmp
+ chmod +x $out
+}
slog() {
# log with script. timing is $1.t and script is $1.s
scriptreplay "$1.t" "$1.s"
}
+spend() {
+ s systemctl suspend
+}
+
sr() {
# sudo redo. be aware, this command may not work right on strange distros or earlier software
if [[ $# == 0 ]]; then
fi
done
[[ ! ${args[@]} ]] || trash-put "${args[@]}"
- else
- rm -rf "$@"
- fi
+ else
+ rm -rf "$@"
+fi
}
# MSG_ID is in /var/log/exim4/mainlog, looks like 1ccdnD-0001nh-EN
}
-# use -eW to actually modify mailbox
+# to test sieve, use below command. make modifications, then copy to live file, use -eW to actually modify mailbox
+# cp /p/c/subdir_files/sieve/personal{test,}.sieve; testsievelist -eW INBOX
+#
+# Another option is to use sieve-test SCRIPT MAIL_FILE. note,
+# sieve-test doesn't know about envelopes, I'm not sure if sieve-filter does.
+
+# sieve with output filter. arg is mailbox, like INBOX.
+# This depends on dovecot conf, notably mail_location in /etc/dovecot/conf.d/10-mail.conf
+#
testsievelist() {
- sieve-filter ~/sieve/main.sieve "$@" >/a/tmp/slog 2> >(tail) && sed -rn '/^Performed actions:/{n;n;p}' /a/tmp/slog | sort -u
+ sieve-filter ~/sieve/maintest.sieve "$@" >/tmp/testsieve.log 2> >(tail) && sed -rn '/^Performed actions:/{n;n;p}' /tmp/testsieve.log | sort -u
}
+# plain sieve
testsieve() {
sieve-filter ~/sieve/main.sieve "$@"
}
}
tx() { # toggle set -x, and the prompt so it doesn't spam
- if [[ $- == *x* ]]; then
- set +x
- PROMPT_COMMAND=prompt_command
- else
- unset PROMPT_COMMAND
- PS1="\w \$ "
- set -x
- fi
+ if [[ $- == *x* ]]; then
+ set +x
+ PROMPT_COMMAND=prompt_command
+ else
+ unset PROMPT_COMMAND
+ PS1="\w \$ "
+ set -x
+ fi
}
psnetns() {
m s nsenter -t $(pgrep -f "/usr/sbin/openvpn --suppress-timestamps --nobind --config /etc/openvpn/client/client.conf") -n -m "$@"
}
vpnf() {
- vpncmd gksudo -u ian firefox &r
+ vpncmd gksudo -u ian "firefox -no-remote -P firefox-main-profile" &r
}
vpnbash() {
vpncmd bash
vm-set-listen $1 127.0.0.1
}
+
vpn() {
- s systemctl start openvpn@client&
- journalctl --unit=openvpn@client -f -n0
+ [[ $1 ]] || { echo need arg; return 1; }
+ journalctl --unit=openvpn-client@$1 -f -n0 &
+ s systemctl start openvpn-client@$1
}
-
vpnoff() {
- s systemctl stop openvpn@client
+ [[ $1 ]] || { echo need arg; return 1; }
+ s systemctl stop openvpn-client@$1
}
}
-whatismyip() { curl ipecho.net/plain ; echo; }
+wtr() { curl wttr.in/boston; }
+xl() {
+ # this succeeds even if gnome-screensaver isn't running.
+ gnome-screensaver-command --exit &>/dev/null
+ if ! pidof xscreensaver; then
+ xscreensaver &
+ # 1 was not long enough
+ sleep 3
+ fi
+ xscreensaver-command -lock
+}
#############################
######### misc stuff ########
#############################
+# from curl cheat.sh/:bash_completion
+_cheatsh_complete_curl()
+{
+ local cur prev opts
+ _get_comp_words_by_ref -n : cur
+
+ COMPREPLY=()
+ #cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ opts="$(curl -s cheat.sh/:list | sed s@^@cheat.sh/@)"
+
+ if [[ ${cur} == cheat.sh/* ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ __ltrim_colon_completions "$cur"
+ return 0
+ fi
+}
+complete -F _cheatsh_complete_curl curl
+
+
if [[ $- == *i* ]]; then
# commands to run when bash exits normally
trap "hl" EXIT
--- /dev/null
+Package: firefox
+Pin: release a=unstable
+Pin-Priority: 500
--- /dev/null
+# note, this needs to be disabled to print elsewhere.
+ServerName printserver0.office.fsf.org
SHELL=/bin/bash
-*/10 * * * * ian /a/exe/rootsshsync
+*/10 * * * * ian /a/exe/rootsshsync 2>&1 | /usr/local/bin/log-once -15
--- /dev/null
+blacklist pcspkr
+blacklist snd_pcsp
# 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
+# more user friendly, and copying files between them is a pita with
+# different umasks.
+if test "$(id -u)" -ge 1000; then
umask 002
fi
+++ /dev/null
-[Unit]
-# this unit is configured to start and stop whenever openvpn-client@mail.service
-# does
-Description=Routing for email vpn
-After=network.target
-BindsTo=openvpn-client@mail.service
-After=openvpn-client@mail.service
-
-[Service]
-Type=oneshot
-ExecStart=/a/bin/distro-setup/mail-route start
-ExecStop=/a/bin/distro-setup/mail-route stop
-RemainAfterExit=yes
-
-[Install]
-RequiredBy=openvpn-client@mail.service
--- /dev/null
+require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags", "include" ];
+
+if anyof (
+ address :is "from" "sysadmin@gnu.org",
+ address :is "to" "sysadmin-nonrt@gnu.org",
+ address :is "from" "sysadmin-comment@gnu.org"
+ ) {
+ fileinto :create "sysadmin";
+ stop;
+ }
+elsif anyof (
+ header :contains "list-id" "<office-commits.gnu.org>",
+ header :is "Return-path" "<rtbounces@gnu.org>"
+ ) {
+fileinto :create "rtcc";
+ stop;
+}
+
+if anyof (
+ header :contains "list-id" "<debian-security-announce.lists.debian.org>",
+ header :contains "list-id" "<ubuntu-security-announce.lists.ubuntu.com>"
+ ) {
+ fileinto :create "sec";
+ stop;
+ }
+
+if anyof (
+ header :regex "subject" "mailing list memberships reminder",
+ address :is "to" "rtbounces@gnu.org",
+ address :is "to" "faxmaster@fsf.org",
+ address :is "from" "FaxMaster@fsf.org"
+ ) {
+ fileinto :create "log";
+ stop;
+ }
+# Return-path: <rtbounces@gnu.org>
+
+if allof (
+ address :is "from" "mailman-owner@zope.org",
+ header :is "subject" "zope.org mailing list memberships reminder"
+ ) {
+ discard;
+ stop;
+ }
+
+if anyof (
+ header :contains "list-id" "<activists_masspirates.org.lists.mayfirst.org>"
+ ) {
+ fileinto :create "pirate-party";
+ stop;
+ }
$ORIGIN .
$TTL 60 ; 1 minute
-iank.pw IN SOA iank.pw. admin.iank.pw. (
+iank.life IN SOA iank.life. admin.iank.life. (
25 ; serial
604800 ; refresh (1 week)
86400 ; retry (1 day)
)
NS n1.iankelling.org.
NS n2.iankelling.org.
-$TTL 86400 ; 1 day
- A 67.170.73.44
+ A 73.249.108.7
-zone "iank.pw" {
+zone "iank.life" {
type master;
-file "/etc/bind/bind-writable/db.iank.pw";
+file "/etc/bind/bind-writable/db.iank.life";
update-policy {
// allow host to update themselves with a key having their own name
- grant iank.pw. name iank.pw. A TXT;
- grant iank.pw. name *.iank.pw. A TXT;
+ grant iank.life. name iank.life. A TXT;
+ grant iank.life. name *.iank.life. A TXT;
};
};
-include "/etc/bind/key.iank.pw";
+include "/etc/bind/key.iank.life";
# stored for 3 days, 2 months, and unlimited respectively
SHELL=/bin/bash
0 4 * * * ian x=$(/usr/local/bin/logq /a/exe/small-backup --retry daily 2M); [[ $? != 0 ]] && echo "$x"
-0 3 * * sun ian echo weekly backup results:; /a/exe/small-backup --retry weekly -batch -prefer ~/.mpv -silent 2>&1 | /usr/local/bin/log-once unison-mpv
+0 3 * * sun ian echo weekly backup results:; /a/exe/small-backup --retry weekly
*/5 * * * * ian /a/bin/distro-setup/dynamic-ip-update.sh 2>&1 | /usr/local/bin/log-once -15
*/10 * * * * ian /a/exe/small-backup 10minutes 3D 2>&1 | /usr/local/bin/log-once small-backup-10min
# put things we don't want to send mail about below this:
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<smartplaylist type="songs">
+ <name>sad</name>
+ <match>all</match>
+ <rule field="genre" operator="is">
+ <value>sad</value>
+ </rule>
+ <rule field="userrating" operator="greaterthan">
+ <value>7</value>
+ </rule>
+</smartplaylist>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<smartplaylist type="songs">
+ <name>sad5</name>
+ <match>all</match>
+ <rule field="genre" operator="contains">
+ <value>sad</value>
+ </rule>
+ <rule field="userrating" operator="greaterthan">
+ <value>9</value>
+ </rule>
+</smartplaylist>
#loop=inf
+
+
+#loop-file=inf
+loop-file=no
+shuffle
+#volume=50
+save-position-on-quit
+
+# use --profile d
+[d]
loop-file=inf
shuffle
-volume=50
\ No newline at end of file
colorset6_opacity=99
colorset6_key=F6
background=none
-font=Ubuntu Mono,monospace 12
+font=Ubuntu Mono,monospace 13
show_always_first_tab=No
scrollbar=true
resize_grip=true
# standard short key ids are easy to collide
# https://security.stackexchange.com/questions/84280/short-openpgp-key-ids-are-insecure-how-to-configure-gnupg-to-use-long-key-ids-i
# https://evil32.com/
-#keyid-format 0xlong
+# another option is 0xshort
+keyid-format 0xlong
-# however, not using for now, since I just want to
-# identify the keys i have, not remote keys.
-keyid-format 0xshort
+# iank@fsf.org
+default-key B125F60B7B287FF6A2B7DF8F170AF0E2954295DF
\ No newline at end of file
+++ /dev/null
-# Write your default config options here!
-save-position-on-quit
import XMonad.Hooks.EwmhDesktops
import XMonad.Config.Xfce
import XMonad.Hooks.ManageDocks
+import XMonad.Layout.NoFrillsDecoration
import qualified XMonad.StackSet as W
import qualified Data.Map as M
-- /usr/share/xmonad/xmonad.hs on fedora has integration with gnome etc. but I
-- had lots of problems with gnome integration.
+myL = noFrillsDeco shrinkText def (layoutHook def)
main = xmonad $ defaults
+--main = xmonad def { layoutHook = myL } $ defaults
defaults = desktopConfig
[ ((modm, xK_q), io (exitWith ExitSuccess)) -- %! Quit xmonad
, ((modm, xK_2), spawn "pavucontrol")
- , ((modm, xK_3), spawn "firefox -no-remote -P sfw")
- , ((modm, xK_4), spawn "firefox")
-
- , ((modm, xK_5), spawn "input-setup")
+-- , ((modm, xK_3), spawn "firefox -no-remote -P sfw")
+-- todo: clicking links in other applications won't open in
+-- a firefox opened with -no-remote, so we have to hardcode a
+-- primary firefox profile here. I'd rather have a command which
+-- sets which is the pimary for opening links. It could alter a file,
+-- and we could launch firefox with a wrapper script which looks at that file.
+ , ((modm, xK_3), spawn "firefox -P sfw")
+ , ((modm, xK_4), spawn "firefox -no-remote -P firefox-main-profile")
+
+ , ((modm, xK_5), spawn "/a/exe/input-setup l")
+ , ((modm, xK_1), spawn "/a/exe/input-setup k")
-- 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 "personaltest";
+
+
+# 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.