Skip to content

Instantly share code, notes, and snippets.

@ShannonScott
ShannonScott / readme.md
Last active May 6, 2024 06:15
[Transcode h265] Use ffmpeg to transcode a video to h.265 / hvc1 which will play natively on a Mac (and Linux). #tags: video, python, ffmpeg
@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 / 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
@ShannonScott
ShannonScott / Python Copy Text to Clipboard (Linux).md
Created October 11, 2019 22:14
[Python Copy Text to Clipboard] Copy Text to the Linux / X Clipboard. #tags: linux, python

Copy Text to the Linux / X Clipboard

from subprocess import Popen, PIPE

def copy_clipboard(msg):
    ''' Copy `msg` to the clipboard '''
    with Popen(['xclip','-selection', 'clipboard'], stdin=PIPE) as pipe:
        pipe.communicate(input=msg.encode('utf-8'))
@ShannonScott
ShannonScott / readme.md
Last active June 4, 2023 20:35
[Moving efficiently in the CLI] Key-combination reference for movement in the shell. #tags: mac, linux, bash
@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 / Install Anaconda Environment for Jupyter.md
Last active September 2, 2021 22:24
[Install Anaconda Environment for Jupyter] Make a conda environment available in Jupyter #tags: jupyter, python, anaconda
@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