Merge branch 'master' of waschsauger:git/dirty-helpers

This commit is contained in:
neingeist 2015-07-20 20:38:15 +02:00
commit f7ab634d8b
3 changed files with 42 additions and 1 deletions

17
crontab-suggest Executable file
View file

@ -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"

View file

@ -14,7 +14,8 @@ M = 1024*1024
def junk_dirs(): def junk_dirs():
"""Return directories which potentially contain junk""" """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) d = os.path.expanduser(d)
if os.path.exists(d): if os.path.exists(d):
yield d yield d

23
gpg-sync-keys Executable file
View file

@ -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