From 16e7f32c4aa313cb99591730479875862fbe58f2 Mon Sep 17 00:00:00 2001 From: Andrew Zah Date: Fri, 18 Oct 2019 01:00:57 -0400 Subject: [PATCH] update --- .offlineimaprc | 61 ++++++++++++++++++++++++++++++++++++ .ssh-config | 14 +++++++++ config/nvim/init.vim | 1 + scripts/mailrun.sh | 28 +++++++++++++++++ zsh/aliases.zsh | 1 + zsh/path-exports-options.zsh | 3 ++ 6 files changed, 108 insertions(+) create mode 100644 .offlineimaprc create mode 100644 .ssh-config create mode 100755 scripts/mailrun.sh diff --git a/.offlineimaprc b/.offlineimaprc new file mode 100644 index 0000000..f8c1226 --- /dev/null +++ b/.offlineimaprc @@ -0,0 +1,61 @@ +[general] +# List of accounts to be synced, separated by a comma. +accounts = zah_andrewzah,gmail,junk_andrewzah + +[Account gmail] +localrepository = gmail-local +remoterepository = gmail-remote + +[Account zah_andrewzah] +localrepository = zah_andrewzah-local +remoterepository = zah_andrewzah-remote + +[Account junk_andrewzah] +localrepository = junk_andrewzah-local +remoterepository = junk_andrewzah-remote + +[Repository gmail-local] +type = Maildir +localfolders = /mnt/mail/gmail + +[Repository gmail-remote] +type = Gmail +sslcacertfile = /usr/local/share/certs/ca-root-nss.crt +remoteuser = zah.andrew@gmail.com +remotepassfile = /config/creds/gmail.pass +maxconnections = 1 +readonly = true +nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts', + '[Gmail]/Sent Mail': 'sent', + '[Gmail]/Starred': 'flagged', + '[Gmail]/Important': 'important', + '[Gmail]/Spam': 'spam', + '[Gmail]/Trash': 'trash', + '[Gmail]/All Mail': 'archive', + }.get(folder, folder) + +[Repository zah_andrewzah-local] +type = Maildir +localfolders = /mnt/mail/zah_andrewzah + +[Repository zah_andrewzah-remote] +type = IMAP +sslcacertfile = /usr/local/share/certs/ca-root-nss.crt +remotehost = mail.gandi.net +remoteuser = zah@andrewzah.com +remotepassfile = /config/creds/zah_andrewzah.pass +maxconnections = 1 +readonly = true + +[Repository junk_andrewzah-local] +type = Maildir +localfolders = /mnt/mail/junk_andrewzah + +[Repository junk_andrewzah-remote] +type = IMAP +sslcacertfile = /usr/local/share/certs/ca-root-nss.crt +remotehost = mail.gandi.net +remoteuser = junk@andrewzah.com +maxconnections = 1 +readonly = true +remotepassfile = /config/creds/junk_andrewzah.pass diff --git a/.ssh-config b/.ssh-config new file mode 100644 index 0000000..0e24d40 --- /dev/null +++ b/.ssh-config @@ -0,0 +1,14 @@ +Host freenas.local + HostName 192.168.1.13 + +Host andrewzah.com + User deploy + Port 2223 + +Host * + Cipher aes128-ctr + +Host * + ControlPath ~/.ssh/%C.sock + ControlMaster auto + ControlPersist 10m diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 1ecfdce..c6c4a98 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -41,6 +41,7 @@ Plug 'radenling/vim-dispatch-neovim' Plug 'scrooloose/nerdcommenter' Plug 'tpope/vim-dispatch' Plug 'tpope/vim-fugitive' +Plug 'vim-scripts/VisIncr' "Plug 'w0rp/ale' "" og theme diff --git a/scripts/mailrun.sh b/scripts/mailrun.sh new file mode 100755 index 0000000..abe1db9 --- /dev/null +++ b/scripts/mailrun.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Check every ten seconds if the process identified as $1 is still +# running. After 5 checks (~60 seconds), kill it. Return non-zero to +# indicate something was killed. +monitor() { + local pid=$1 i=0 + + while ps $pid &>/dev/null; do + if (( i++ > 5 )); then + echo "Max checks reached. Sending SIGKILL to ${pid}..." >&2 + kill -9 $pid; return 1 + fi + + sleep 10 + done + + return 0 +} + +read -r pid < ~/.offlineimap/pid + +if ps $pid &>/dev/null; then + echo "Process $pid already running. Exiting..." >&2 + exit 1 +fi + +offlineimap -c /config/.offlineimaprc -o -u quiet & monitor $! diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index 5f8a6cd..3b07213 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -25,3 +25,4 @@ alias cdr='~/Work/repos' alias cda='~/Work/repos/cyber/cyber-server/api-server' alias cdp='~/Programming' +alias cdw='~/Website' diff --git a/zsh/path-exports-options.zsh b/zsh/path-exports-options.zsh index 3e336a7..b00a97e 100644 --- a/zsh/path-exports-options.zsh +++ b/zsh/path-exports-options.zsh @@ -18,6 +18,9 @@ export GOROOT=/usr/local/go export GOPATH=$HOME/go export PATH=$GOROOT/bin:$GOPATH/bin:$PATH +# anaconda +export PATH=/home/andrew/anaconda3/bin:$PATH + # nix source ~/.nix-profile/etc/profile.d/nix.sh -- 2.45.2