summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xclear-debpkg-genfile3
-rw-r--r--git-author-rewrite.sh17
-rwxr-xr-xmail-sync32
-rwxr-xr-xsign-remote33
4 files changed, 84 insertions, 1 deletions
diff --git a/clear-debpkg-genfile b/clear-debpkg-genfile
index 8f4df9c..4be8c61 100755
--- a/clear-debpkg-genfile
+++ b/clear-debpkg-genfile
@@ -7,4 +7,5 @@ set -e
PWD=$(pwd)
find $PWD -maxdepth 1 \( -name "*.gz" -o -name "*.xz" -o -name "*.bz2"\
-o -name "*.changes" -o -name "*.dsc" -o -name "*.build" \
- -o -name "*.deb" -o -name "*.udeb" \) -exec rm -vf {} \;
+ -o -name "*.deb" -o -name "*.udeb" -o -name "*.buildinfo" \
+ -o -name "*.upload" \) -exec rm -vf {} \;
diff --git a/git-author-rewrite.sh b/git-author-rewrite.sh
new file mode 100644
index 0000000..39513e4
--- /dev/null
+++ b/git-author-rewrite.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+git filter-branch --env-filter '
+#OLD_EMAIL="vasudeva.kamath@in.abb.com"
+#CORRECT_NAME="Your Correct Name"
+#CORRECT_EMAIL="your-correct-email@example.com"
+if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
+then
+ export GIT_COMMITTER_NAME="$CORRECT_NAME"
+ export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
+fi
+if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
+then
+ export GIT_AUTHOR_NAME="$CORRECT_NAME"
+ export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
+fi
+' --tag-name-filter cat -- --branches --tags
diff --git a/mail-sync b/mail-sync
new file mode 100755
index 0000000..d9819fe
--- /dev/null
+++ b/mail-sync
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+#MAILSYNC=$(pgrep mail-sync)
+MBSYNC=$(pgrep mbsync)
+NOTMUCH=$(pgrep notmuch)
+
+if [ -n "$MBSYNC" -o -n "$NOTMUCH" ]; then
+ echo "Already running one instance of mail-sync. Exiting..."
+ exit 0
+fi
+
+echo "Deleting messages tagged as *deleted*"
+notmuch search --format=text0 --output=files tag:deleted |xargs -0 --no-run-if-empty rm -v
+
+echo "Moving spam to Spam folder"
+notmuch search --format=text0 --output=files tag:Spam and to:vasudev@copyninja.info | xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur
+notmuch search --format=text0 --output=files tag:Spam and to:vasudev-debian@copyninja.info | xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur
+
+
+MDIR="vasudev-copyninja.info vasudev-debian Gmail-1"
+mbsync -Va
+notmuch new
+
+for mdir in $MDIR; do
+ echo "Processing $mdir"
+ for fdir in $(ls -d /home/vasudev/Mail/$mdir/*); do
+ if [ $(basename $fdir) != "INBOX" ]; then
+ echo "Tagging for $(basename $fdir)"
+ notmuch tag +$(basename $fdir) -inbox -- folder:$mdir/$(basename $fdir)
+ fi
+ done
+done
diff --git a/sign-remote b/sign-remote
new file mode 100755
index 0000000..f49af78
--- /dev/null
+++ b/sign-remote
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# Copyright © 2009 Stefano Zacchiroli <zack@upsilon.cc>
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+if [ -z "$1" ] ; then
+ echo "Usage: sign-remote HOSTNAME:PATH"
+ exit 2
+fi
+url="$1"
+host=$(echo "$url" | cut -f 1 -d':')
+path=$(echo "$url" | cut -f 2 -d':')
+base=$(dirname "$path")
+if [ -z "$host" -o -z "$path" ] ; then
+ echo "Malformed remote \"URL\", must follow the \"HOSTNAME:PATH\" convention."
+ exit 2
+fi
+
+tmp=`mktemp`
+sig="$tmp.gpg"
+trap "rm -f $tmp $sig" EXIT
+
+echo "I: retrieving file to sign from remote host ..."
+scp "$url" $tmp
+echo "I: signing ..."
+gpg --detach-sign --batch -o $sig $tmp
+echo "I: sending back signature ..."
+scp $sig "$host":"$path.gpg"
+echo "I: remote signing done."