Skip to content

Instantly share code, notes, and snippets.

View antonfisher's full-sized avatar

Anton Fisher antonfisher

View GitHub Profile
@antonfisher
antonfisher / s3-test-s3cmd.sh
Created September 12, 2019 21:12
Simple S3 test using s3cmd client
#!/usr/bin/env bash
# setup:
# $ mkdir -p /tmp/s3 && cd /tmp/s3
# $ ~/js/nexenta/nef/test.sh 2>&1 | grep --color -E "^\+.+$|$"
set -x;
#set -e;
HOST="1.1.1.1:9000"
ffmpeg\
-i in.mp4\
-an\
-vf "setpts=PTS/3,transpose=2,transpose=2"\
-r 30\
-vcodec libx264\
-stats\
out.mp4
# color
@antonfisher
antonfisher / resize-images-greater-then-width.sh
Created July 10, 2020 06:18
Resize all found images greater then some width
#!/usr/bin/env bash
MAX_WIDTH=800
echo "Looking for images..."
find . -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" |
while read name; do
width=$(identify -format "%w" "$name")
if [ "$width" -gt "$MAX_WIDTH" ]; then
@antonfisher
antonfisher / resize-and-compress-images.sh
Last active August 29, 2020 23:51
Resize (PNG, JPG) and compress (PNG) images recursively in the run folder if greater than MAX_WIDTH
#!/usr/bin/env bash
#
# Requirements:
# apt install imagemagick pngquant
#
# Usage:
# resize-and-compress-images.sh MAX_WIDTH
#
@antonfisher
antonfisher / rpi-zero-headless-setup.sh
Last active December 6, 2020 03:25
Raspberry Pi Headless Setup
# on host:
# write an os image to the sd card:
# https://www.raspberrypi.org/documentation/installation/installing-images/README.md
# setup wifi (in boot):
# https://www.raspberrypi.org/documentation/configuration/wireless/headless.md
vim wpa_supplicant.conf
#ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
#update_config=1
@antonfisher
antonfisher / rpi-zero-motioneyeos-setup.sh
Created November 23, 2020 23:10
Install motioneyeos on Raspberry Pi Zero
# on host
# follow https://github.com/ccrisan/motioneyeos/wiki/Installation
# download "motioneyeos-raspberrypi-20200606.img.xz" release from:
# https://github.com/ccrisan/motioneyeos/releases
# setup script
wget https://raw.githubusercontent.com/ccrisan/motioneyeos/master/writeimage.sh
chmod +x writeimage.sh
@antonfisher
antonfisher / stripes.go
Last active April 18, 2024 06:47
Utility to add transparent horizontal stripes to an image.
//
// Add transparent horizontal stripes to an image.
//
// Usage:
// go run stripes.go image.png 6 12 420
// | | | |
// | | | `- top and bottom padding
// | | `---- space between stripes
// | `------ stripes width
// `---------------- original file name or path