Skip to content

Instantly share code, notes, and snippets.

@ShannonScott
ShannonScott / rpi_sd_card_backup.md
Last active July 7, 2020 22:59
[RPi SD Card Backup] Backup the SD card from a Raspberry Pi from a Mac. #tags: mac, raspberrypi

Backup SD card to Mac

List devices

diskutil list

Copy SD card to Mac

@ShannonScott
ShannonScott / aws_notes.md
Created April 28, 2020 21:25
[AWS Notes] Notes on AWS. #tags: aws
@ShannonScott
ShannonScott / MacOS Software Raid Notes.md
Last active April 23, 2020 14:57
[MacOS Software Raid Notes] Notes on using software RAID on a Mac. #tags: mac

Check RAID health

diskutil appleRAID list

Get disk status

diskutil info disk0
@ShannonScott
ShannonScott / nvidia_gpu_list.sh
Last active June 4, 2023 20:32
[List NVDIA GPUs] Bash array of GPUs in a system. #tags: nvidia, gpu, bash
#!/bin/bash
# Get a list of GPUs in a system
#
# Useful nvidia-smi Queries
# https://nvidia.custhelp.com/app/answers/detail/a_id/3751/~/useful-nvidia-smi-queries
# Get GPU names as a bach array, replace spaces with underscores
gpu_names=($(nvidia-smi --query-gpu=gpu_name --format=csv,noheader | tr -s ' ' '_'))
for name in "${gpu_names[@]}"
@ShannonScott
ShannonScott / rpi_setup.md
Last active December 24, 2019 16:48
[Raspberry Pi Setup Notes] Notes on setting up a headless Raspberry Pi for astrophotography. #tags: raspberrypi, astronomy
@ShannonScott
ShannonScott / Notes on using ffmpeg or ffprobe.md
Last active April 23, 2024 05:05
[FFMPEG / FFPROBE Notes] Notes on using ffmpeg or ffprobe. #tags: ffmpeg, notes, video

Notes on using FFMPEG and FFPROBE

Count frames in a video

Get reported number of frames

Get the reported and actual number of frames in a video.

Note: I recently found a video that reported having 2985 frames, but actually only had 29 frames, which were all keyframes.

@ShannonScott
ShannonScott / boost_choral_bass_part.md
Last active November 29, 2019 18:38
[Choral Bass Section Boost] Boost the choral bass section in an MP3 file. #tags: audio, ffmpeg

Boost the choral bass part on all MP3s in a folder

Boost the frequencies within +/- one octave of 200 Hz

BOOST=6
for filename in *.mp3; do
	ffmpeg -i $filename -af "equalizer=f=200:width_type=o:width=1:g=${BOOST}" "${filename%.*}.bassboost+${BOOST}db.mp3"
done
@ShannonScott
ShannonScott / bash_notes.md
Last active February 24, 2020 21:57
[Bash Notes] General notes on using and scripting Bash. #tags: bash, notes

Bash Notes

General notes on using and scripting Bash.

Argument parsing

Here's a nice article on the topic of argument parsing in Bash: Bash: Argument Parsing

From the article:

@ShannonScott
ShannonScott / crop_video.md
Last active February 25, 2020 15:56
[FFMPEG Crop video] Crop an MP4 video with FFMPEG. #tags: video, ffmpeg

Crop video

ffmpeg -i input.mp4 -vf "crop=500:300:0:0" -c:v libx264 -crf 0 -c:a copy output.mp4

Where the crop option is of the form: w:h:x:y.

Links

@ShannonScott
ShannonScott / Video Screen Capture with GStreamer.md
Created October 30, 2019 16:28
[Video Screen Capture with GStreamer] Capture a Linux desktop window video with gsteramer. #tags: gstreamer, linux, xwindows, video

Capture a video of a given X Window with gstreamer.

X Window ID

Get the target window ID with the following:

xwininfo