Skip to content

Instantly share code, notes, and snippets.

@kpping
kpping / poster_from_video.sh
Created December 11, 2018 04:15
Create PNG image (poster) from video
#!/usr/bin/env bash
FILE_VIDEO="video.mp4" # in
FILE_PNG="poster.png" # out
ffmpeg -i $FILE_VIDEO -ss 00:00:01.000 -vframes 1 $FILE_PNG
@kpping
kpping / png_to_jpg.sh
Last active December 11, 2018 04:11
Convert PNG to reduced quality JPG
#!/usr/bin/env bash
QUALITY=60 # 0 - 100
FILE_PNG="image.jpg" # in
FILE_JPG="image.png" # out
convert -strip -interlace Plane -quality $QUALITY $FILE_PNG $FILE_JPG
@kpping
kpping / gitconfig.sh
Last active December 11, 2018 04:03
Setup Git
#!/usr/bin/env bash
git config --global user.name "Krittanan Pingclasai"
git config --global user.email kp@kpping.me
git config --global core.editor emacs
git config --global alias.tree "log --graph --pretty=oneline --abbrev-commit"
touch ~/.gitignore_global && git config --global core.excludesfile ~/.gitignore_global
@kpping
kpping / rmnodemodules.sh
Last active December 11, 2018 04:01
remove `node_modules` recursively start from current directory
#!/usr/bin/env bash
find . -name node_modules -type f -delete -print
@kpping
kpping / rmdsstore.sh
Last active December 11, 2018 04:02
remove `.DS_store` recursively from current directory
#!/usr/bin/env bash
find . -name .DS_Store -type f -delete -print