From: Dan White Date: Sun, 16 May 2021 18:36:28 +0000 (-0500) Subject: updates X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=fc281563a594c4c0daf5c34154befa434478e89d;p=pubbin.git updates --- diff --git a/TimeSampleHistogram b/TimeSampleHistogram index b32528b..53df283 100755 --- a/TimeSampleHistogram +++ b/TimeSampleHistogram @@ -116,7 +116,7 @@ if isinstance(opt.daysago, int): # handle -d, --days option # if supplied, modify either startdate or enddate accordingly -if opt.days > 0: +if opt.days >= 0: enddate = startdate + dt.timedelta(opt.days) elif opt.days < 0: startdate = enddate + dt.timedelta(opt.days) diff --git a/scan2pdf b/scan2pdf index cde8601..68b2321 100755 --- a/scan2pdf +++ b/scan2pdf @@ -11,16 +11,23 @@ fi INFILE="$1" OUTFILE="$2" +# no second argument if [ "$OUTFILE" = "" ]; then OUTFILE=${INFILE}.pdf fi +# no .pdf for out name, add one +SUFFIX="${OUTFILE##*.}" +if [ "$SUFFIX" != "pdf" ]; then + OUTFILE="${OUTFILE}.pdf" +fi + convert \ -density 300 \ "$INFILE" \ +dither \ - -colors 64 \ + -colors 32 \ -black-threshold 50% \ -fuzz 20% -fill white -opaque white \ -extent 2550x3300 \ diff --git a/timeSampler b/timeSampler index b54236e..37ad58a 100755 --- a/timeSampler +++ b/timeSampler @@ -127,7 +127,9 @@ function sampleTask { echo "$DATE $ACTIVITY" >> $LOGFILE echo "$DATE $ACTIVITY" - echo "$HOSTNAME $DATE $ACTIVITY" >> $BACKUPFILE + cat <> $BACKUPFILE +{"user":"$USER@$HOSTNAME", "time": "$DATE", "activity":"$ACTIVITY"} +EOF }