Skip to content

Instantly share code, notes, and snippets.

@thejatmik
thejatmik / xargsing.md
Last active September 2, 2025 11:35
xargs

List & filter file by extension, then do something with it's name

$ ls|grep png | xargs -I % sh -c 'basename % .png' | xargs -I % sh -c 'echo convert %.png -resize 64x64 %64.png'

resize but ignore aspect ratio

ls | grep png | xargs -I % sh -c 'basename % .png' | xargs -I % sh -c 'echo convert %.png -resize 1242x2688\! %_resize.png'
@thejatmik
thejatmik / setup docker msql oneline on 6565.md
Last active June 20, 2023 08:20
setup docker postgis oneline on 5454
$ docker volume create msql_data

$ docker run --name=msql-bootcamp -d -e MYSQL_ROOT_PASSWORD=uzumymw -e MYSQL_DATABASE=course-app -p 6565:3306 -v msql_data:/var/lib/mysql --restart=always mysql:latest
@thejatmik
thejatmik / ffmpeging.md
Last active January 28, 2025 08:46
ffmpeg

Split video into parts with 2min duration each

ffmpeg -i in.mp4 -map 0 -segment_time 00:02:00 -f segment -reset_timestamps 1 -c copy out_%02d.mp4

Trim video with on timestamp

ffmpeg -ss 00:00:20 -to 00:02:28 -i in.mp4 -c copy out.mp4