diff --git a/crontab-suggest b/crontab-suggest new file mode 100755 index 0000000..c45bf00 --- /dev/null +++ b/crontab-suggest @@ -0,0 +1,17 @@ +#!/bin/bash +# suggest a random time for a cronjob + +set -u +set -e + +hour=$((($RANDOM*24)/32768)) +minute=$((($RANDOM*60)/32768)) +dow="*" + +if [ $# -gt 0 ]; then + if [ "$1" == "-w" ]; then + dow=$((($RANDOM*7)/32768)) + fi +fi + +printf "%02i %02i * * %s\n" "$minute" "$hour" "$dow" diff --git a/find-junk b/find-junk index f714cf0..4416799 100755 --- a/find-junk +++ b/find-junk @@ -14,7 +14,8 @@ M = 1024*1024 def junk_dirs(): """Return directories which potentially contain junk""" - for d in ['~/tmp', '~/.local/share/Trash', '~/rpmbuild', '~/RPM']: + for d in ['~/tmp', '~/.local/share/Trash', '~/rpmbuild', '~/RPM', + '~/.cache/tracker']: d = os.path.expanduser(d) if os.path.exists(d): yield d diff --git a/gpg-sync-keys b/gpg-sync-keys new file mode 100755 index 0000000..89eb3fc --- /dev/null +++ b/gpg-sync-keys @@ -0,0 +1,23 @@ +#!/bin/sh +# sync gpg public keys between localhost and the specified hosts +# +# gpg-sync-keys host1 [host2 ...] +# + +#GPG="gpg -q --batch" +GPG=gpg + +hosts=$@ + +for host in $hosts; do + echo "Importing from $host ..." + ssh -C $host $GPG --export | $GPG --import +done + +#echo "Refreshing keys ..." +#$GPG --refresh-keys + +for host in $hosts; do + echo "Exporting to $host ..." + $GPG --export | ssh -C $host $GPG --import +done