cheatsheet
#in-place edit, but don’t change JAG commented lines.
perl -p -i -e ’s#fubar#foobar#g unless !(/jag/ and /^#/)’ myfile.txt
#hex dump
od -Ax -tx1z -v myfile.txt
#get rid of silly ^M characters
cat myfile.txt | tr -d ‘\013′
#Unicode to ascii
#apparently, harder than it looks on the command line.
# from the dos command line:
type unicode_file.txt > ascii_file.txt
#in unix, try (serious broken cheating)
cat unicode_file.txt | tr -d ‘\000′ > ascii_file.txt
#uni2ascii might have been the right thing, if I could get it to work right.
#other stuff
#web-size pics, with caption
convert -resize @480000 -normalize -quality 45 -font Arial -fill lightgreen -pointsize 30 -draw \”text 5,26 ‘%t’\” -pointsize 18 -draw \”text 5,41 ‘%[EXIF:ISOSpeedRatings] %[EXIF:ExposureTime]’\” infile.jpg outfile.jpg