diff --git a/gitdiffdir/gitdiffdir b/gitdiffdir/gitdiffdir index 1f4e67e..c6cdd92 100755 --- a/gitdiffdir/gitdiffdir +++ b/gitdiffdir/gitdiffdir @@ -10,7 +10,7 @@ gitdiffdir - git diff, but between two dirs in different repositories =head1 SYNOPSIS -B [I] I I +B [I] I [I] =head1 DESCRIPTION @@ -25,6 +25,8 @@ files but on two dirs in different repositories. B passes options to B. Default: B<-Naur> +I defaults to . + =head1 EXAMPLES Diff dirs with the same name: @@ -93,7 +95,7 @@ if [ ${#diff_options[@]} -eq 0 ]; then fi dirA="${others[0]}" -dirB="${others[1]}" +dirB="${others[1]:-.}" # Remove all trailing slashes while [[ "$dirA" == */ ]]; do diff --git a/gitedit/gitedit b/gitedit/gitedit new file mode 100755 index 0000000..0488a52 --- /dev/null +++ b/gitedit/gitedit @@ -0,0 +1,72 @@ +#!/bin/bash + +: <<=cut +=pod + +=head1 NAME + +gitedit - Edit git log + + +=head1 SYNOPSIS + +gitedit [number of commits] + + +=head1 DESCRIPTION + +B edits the last n commits. + +It simply runs: + + rebase -i HEAD~n + +=head1 EXAMPLE + +Edit the past 10 commits. + + gitedit + +Edit the past 50 commits. + + gitedit 50 + +=head1 AUTHOR + +Copyright (C) 2024 Ole Tange, +http://ole.tange.dk and Free Software Foundation, Inc. + + +=head1 LICENSE + +Copyright (C) 2012 Free Software Foundation, Inc. + +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. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + +=head1 DEPENDENCIES + +B uses B. + + +=head1 SEE ALSO + +B + + +=cut + +n=${1-10} + +git rebase -i HEAD~"$n" diff --git a/goodpasswd/goodpasswd b/goodpasswd/goodpasswd index be5e1c9..eb5de09 100755 --- a/goodpasswd/goodpasswd +++ b/goodpasswd/goodpasswd @@ -35,13 +35,14 @@ B generates access codes that: =head2 Characters considered too close These character couples are too similar either in different fonts or -in a bad copy and are thus forbidden: B8 cC g9 6G kK lI l1 oO O0 pP sS uU vV xX zZ Z2 ,. :; `' S5 +in a bad copy and are thus forbidden: +B8 cC g9 G6 kK lI l1 oO O0 pP sS S5 uU vV xX zZ Z2 ,. :; `' These characters cause problems in URLs: @/: These characters cause problems in shell: ! " # $ & ( ) [ ] { } ? | < > \ * = -These characters cause problems in SQL (wildcard): % +These characters cause problems in SQL: % (wildcard) + (login) These characters are hard to type: ^ ~ ¨ ¤ § ½ æ ø å Æ Ø Å @@ -49,24 +50,25 @@ These characters are hard to type: ^ ~ ¨ ¤ § ½ æ ø å Æ Ø Å Never use the same chars twice in a row: e.g. -- is bad. -Do not start with '-' or '+' as that looks like an (long) option +Do not start with '-' as that looks like an (long) option =head1 EXAMPLE -B will give output similar to FJiY7j+7DQ-D. +B will give output similar to iTtNRf3MYdMb+rNhYniY. =cut -# # US-kbd: ~!@#$%^&*()_+ [] {} ;'\ :"| < > ,./ <>? # DK-kbd: §!"#¤%&/()=?` å" Å^ æø' ÆØ* < > ,.- ;:_ # Common: ! # % < > ,. my $pw; -my @chars=split //, 'abdefhijmnqrtyADEFHJLMNQRTY347+-'; +# 31-1 possibilities = ~4.9 bit entropy +# 20 chars = 98 bit +my @chars=split //, 'abdefhijmnqrtyADEFHJLMNQRTY347-'; do { $pw = ""; - for (1..12) { + for (1..20) { $pw .= $chars[rand $#chars+1] } } while (($pw =~ /^[+-]/ or $pw =~ /(.)\1/) or diff --git a/pdfman/pdfman b/pdfman/pdfman index 3bd1c01..a562602 100755 --- a/pdfman/pdfman +++ b/pdfman/pdfman @@ -66,8 +66,7 @@ B =cut -dir=/tmp/pdfman-`echo $USER "$@" | md5sum|cut -d ' ' -f 1` -pdf="$dir/$@" +pdf=$(mktemp) viewer=$PDFVIEWER if which okular >/dev/null; then @@ -84,8 +83,7 @@ cleanup() { if [ "$noclean" == 1 ] ; then true else - rm $pdf - rmdir $dir + rm "$pdf" fi } @@ -105,16 +103,6 @@ pdfviewer() { trap control_c SIGINT -if [ -d "$dir" ] ; then - # PDF-viewer already running for this $pdf - # Assume it will re-read new file and do the cleanup - noclean=1 - noview=1 -else - mkdir "$dir" -fi - - man -w "$@" | parallel 'zcat {} || cat {}' 2>/dev/null | # Convert ˆ to ^ diff --git a/teetime/teetime b/teetime/teetime index dad3481..419319e 100755 --- a/teetime/teetime +++ b/teetime/teetime @@ -55,7 +55,6 @@ Wait at most I seconds. =back - =head1 EXAMPLES (sleep 0.5; echo After 0.5s; sleep 1.5; echo After 2s) | @@ -219,6 +218,7 @@ sub min(@) { sub readfile { # Input is in .tt-format my $file = shift; + my $fh; if($file eq "-") { $fh = *STDIN;