Skip to content

Instantly share code, notes, and snippets.

@heaversm
Last active January 3, 2021 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heaversm/902197ef15ca8022ae7da2c1afe20830 to your computer and use it in GitHub Desktop.
Save heaversm/902197ef15ca8022ae7da2c1afe20830 to your computer and use it in GitHub Desktop.
Terminal commands, workflows, and utilities
#force remove in powershell and unix
rm -rf [directory]
rm -r -fo [directory]
# download a blob url for a video
#Use the HLS Downloader Google Chrome extension to get the link to the M3U playlist
#Copy that url into the script below
youtube-dl --all-subs -f mp4 -o "file-name-to-save-as.mp4" "[M3U_List_URL]"
# - - -
# run ngrok with host header for vuejs / react apps
ngrok http 8080 -host-header="localhost:8080"
# - - -
# create an alias to open a program
vim ~/.bash_profile
#in bash_profile:
[alias_name] = 'open /path/to/app.app'
#save and exit
source ~/.bash_profile
[alias_name]
# - - -
# - - -
#ZIP A FOLDER / FILE
apt-get install zip
zip -r any_name.zip folder_to_zip
# - - -
#convert all images to a new format with quality options
magick mogrify -format jpg *.* -quality 70
#batch resize images to a specific width, keep aspect
mogrify -resize 960 *.png
#target width and height but keep aspect:
mogrify -resize 960x528! *.png
#batch resize images to a specific width, keep aspect
mogrify -resize 960 *.png
#Serve files over proxy network
ngrok http "file:///C:\Users\mheav\[FOLDER]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment