This came up yet again today (I already had this tip in my own personal version of PHPBB I keep around for things I doubt anyone else is interested in - or am embarrassed to admit I don't have in my wetware automatically) when I read of a "bug" in wget that stores passwords you maybe weren't expecting it to.
This was news to me as I've never used it in a situation where one was asked of me - or included in some copypasta example to get some little toy for supporting, say, NGINX or Perl. So I go RTFM and just about hurl my cookies looking for how you'd even put in a password. It's there, to be sure, but finding it, that's another thing, I didn't want to spend all day.
So this little gem - complete with no error checking at all...makes a pdf file out of a man page in whatever directory your terminal is in, and then you can use any pdf reader to look at it in a nicer font and have it be searchable - it took less time to get this script into my laptop from a reference here and run it to find "password" than I'd already spent trying and failing to find it in the man page as normally accessed. So, here it is. If you want to add error checking...be my guest and please post back with the better version. All this does is assume that if there are two arguments, one of them is the "man page section number". And no other checking is done.... It'll probably just fail if you mess up the command line. I hope.
I put this in my /home/doug/bin directory so it'll be on the path, and of course, you have to chmod +x this to make it runnable. I call mine man2pdf.
- Code: Select all
#!/bin/bash
#man2pdf script
# $# is number of args
# echo "arg1 is $1 arg 2 is $2"
# fairly cheesy existence test and assume
# args are reasonable - no error checking
if [ $2 ]
then
FILE=($2.ps)
else
FILE=($1.ps)
fi
echo "file: $FILE"
man -t $1 $2 >> $FILE
ps2pdf $FILE
rm $FILE
For example, man2pdf 5 crontab works and will make crontab.pdf in the current directory. Leaving out the number also works for the default manpage section.
Now, I could really use a way to transport posts from one PHPBB instance to another - I do like having my local copy for backup if nothing else, and well, things like code blocks or attachments don't' just copy paste over.