Skip to content

Instantly share code, notes, and snippets.

@jonasjancarik
Last active January 10, 2020 07:02
Show Gist options
  • Save jonasjancarik/c924b3bc22fbee93db4c981361570f3e to your computer and use it in GitHub Desktop.
Save jonasjancarik/c924b3bc22fbee93db4c981361570f3e to your computer and use it in GitHub Desktop.
Bash/cmd/PS one-liners and other helpful stuff

Add BOM to CSV files (to open UTF-8 CSVs correctly in Excel):

sed -i '1s/^\(\xef\xbb\xbf\)\?/\xef\xbb\xbf/' *.csv

To check if a file contains UTF-8 BOM at header:

# hexdump -n 3 -C 2.txt
00000000 ef bb bf

ef bb bf // YES

Convert PNGs to JPGs:

mogrify -format jpg -quality 90 *.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment