A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

See hex dump of file on Linux or Mac

hexdump -C [file]

or

cat [file] | xxd

Errors in crontab

When your clever crontab entry doesn't work:


/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'

/bin/sh: -c: line 1: syntax error: unexpected end of file


You might need to escape some characters, like the percent sign: \%


Also consider that the backslash may not have the desired effect if it's inside double quotes.

Allow different users to access MySQL

GRANT ALL PRIVILEGES ON *.* TO 'username'@'hostname';

The single quotes around username and hostname are required.

Vim 'unset' command

Instead of an "unset" command, vi prefixes the option with "no".

So to turn off visible tabs and newlines, use:

:set nolist

Find files in workspace that perforce doesn't know about

for file in `find . -type f`; do p4 diff -f ./$file; done | grep "not on client" | sed 's/on client/in depot/'

But the sed part doesn't work (wrong stream?)