commit ab39a286040d4b6169a0fbaaa366884da0db7738
parent d7c745f447eb6e6f76852536f38719efe25f3426
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 18 Oct 2018 15:10:40 +0200
Update various scripts
Diffstat:
4 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/links/.imapfilter/adamsgaard.lua b/links/.imapfilter/adamsgaard.lua
@@ -163,10 +163,10 @@ results = account.INBOX:contain_subject('Byvejr: ') * account.INBOX:is_older(1)
results:delete_messages()
-- Scholar alerts --
-results = account.INBOX:contain_from('scholaralerts-noreply@google.com')
-results:move_messages(account['academic-alerts'])
+-- results = account.INBOX:contain_from('scholaralerts-noreply@google.com')
+-- results:move_messages(account['academic-alerts'])
-- Github --
-results = account.INBOX:contain_from('notifications@github.com')
-results:move_messages(account['github'])
+-- results = account.INBOX:contain_from('notifications@github.com')
+-- results:move_messages(account['github'])
diff --git a/links/.mutt/muttrc b/links/.mutt/muttrc
@@ -222,8 +222,8 @@ macro index,pager S "<enter-command>unset wait_key<enter>\
<save-message>=adamsgaard/Spam<enter>" "mark as spam"
# sync all accounts
-macro index O "<enter-command>unset wait_key<enter><shell-escape>tmux split-window -p 25 \"offlineimap -qf INBOX\"; tmux select-pane -l<enter><enter-command>set wait_key<enter>"
-macro index <Esc>O "<enter-command>unset wait_key<enter><shell-escape>tmux split-window -p 25 \"offlineimap\"; tmux select-pane -l<enter><enter-command>set wait_key<enter>"
+macro index <Esc>O "<enter-command>unset wait_key<enter><shell-escape>tmux split-window -p 25 \"offlineimap -qf INBOX\"; tmux select-pane -l<enter><enter-command>set wait_key<enter>"
+macro index O "<enter-command>unset wait_key<enter><shell-escape>tmux split-window -p 25 \"offlineimap\"; tmux select-pane -l<enter><enter-command>set wait_key<enter>"
# sync current inbox
folder-hook adamsgaard 'macro index o "<enter-command>unset wait_key<enter><shell-escape>tmux split-window -p 25 \"offlineimap -a adamsgaard -qf INBOX\"; tmux select-pane -l<enter><enter-command>set wait_key<enter>"'
@@ -242,7 +242,7 @@ folder-hook gmail 'macro index <Esc>o "<enter-command>unset wait_key<enter><shel
folder-hook geomail 'macro index <Esc>o "<enter-command>unset wait_key<enter><shell-escape>tmux split-window -p 25 \"offlineimap -a geomail\"; tmux select-pane -l<enter><enter-command>set wait_key<enter>"'
macro index K "<enter-command>unset wait_key<enter>\
-<shell-escape>kill -9 $(ps aux|grep offlineimap|grep python|awk ' {print $2} ')<enter>" "kill all offlineimap processes"
+<shell-escape>killall -9 offlineimap<enter>" "kill all offlineimap processes"
macro index U "<limit>all\n" "show all messages (undo limit)"
diff --git a/links/bin/newsboat-sync b/links/bin/newsboat-sync
@@ -2,11 +2,13 @@
set -e
function info {
- echo "$(tput setaf 2)$*$(tput sgr0)"
+ echo -en "$(tput setaf 2)$*$(tput sgr0)"
}
-info "Downloading newest cache"
+info "Downloading newest cache..."
rsync -aq -e 'ssh -q' ad@idkfa.ucsd.edu:~/.newsboat/cache.db ~/.newsboat/cache.db
+info "done.\\n"
newsboat
-info "Uploading local cache"
+info "Uploading local cache..."
rsync -aq -e 'ssh -q' ~/.newsboat/cache.db ad@idkfa.ucsd.edu:~/.newsboat/cache.db
+info "done.\\n"
diff --git a/links/bin/uu b/links/bin/uu
@@ -7,9 +7,9 @@ announce() {
announce "Updating package manager lists and installed packages"
if [ "$(uname)" = "Linux" ]; then
sudo apt-get update && \
- sudo apt-get upgrade && \
- sudo apt-get dist-upgrade && \
- sudo apt-get autoremove && \
+ sudo apt-get -y upgrade && \
+ sudo apt-get -y dist-upgrade && \
+ sudo apt-get -y autoremove && \
sudo apt-get clean
elif [ "$(uname)" = "Darwin" ]; then
@@ -47,3 +47,8 @@ if [ -d ~/.vim/vim-plugs ]; then
announce "Upgrading vim packages"
vim +PlugUpgrade +PlugUpdate +qall
fi
+
+if [ "$1" = 'all' ]; then
+ ssh andersdc@adamsgaard.dk -t '~/bin/uu'
+ ssh ad@idkfa.ucsd.edu -t '~/bin/uu'
+fi