Skip to content

Instantly share code, notes, and snippets.

@nrk
nrk / command.txt
Created April 2, 2012 19:19
Using ffprobe to get info from a file in a nice JSON format
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json"
@hisener
hisener / convert-subtitle.sh
Created August 3, 2016 14:47
Convert subtitles' encoding to UTF-8
#!/bin/bash
OIFS="$IFS"
IFS=$'\n'
find ./ -name "*.srt" -type f |
while read file
do
if ! [[ `file -bi "$file"` =~ utf-8$ ]]
then
@TheFrostlixen
TheFrostlixen / batch_ren.py
Last active May 17, 2021 10:37
Python script to batch rename files via regex
import glob, os
# point path to directory containing the shows
# load episode titles into `ep.txt`
path = r"I:\Videos\show"
new_filenames = []
with open(path + '\\ep.txt', 'r') as f:
for line in f:
new_filenames.append(line)
@mafar
mafar / mux-to-mkv.py
Last active June 17, 2022 23:41
Remux subtitles into MKV container without any quality loss using ffmpeg or mkvmerge with python
import subprocess
import os
import re
import pycountry
class RemuxingFilestoMKV:
"""
This python script combines videos and their subtitles into mkv container without loosing quality.
@steven2358
steven2358 / ffmpeg.md
Last active July 17, 2026 09:13
FFmpeg cheat sheet
According to all known laws of aviation, there is no way a bee should be able to fly.
Its wings are too small to get its fat little body off the ground.
The bee, of course, flies anyway because bees don't care what humans think is impossible.
Yellow, black. Yellow, black. Yellow, black. Yellow, black.
Ooh, black and yellow!
Let's shake it up a little.
Barry! Breakfast is ready!
Coming!
Hang on a second.
Hello?
#!/usr/bin/env python
import sys
import json
import datetime
# Feed me with output of:
# ffprobe -f lavfi -i movie=INPUT.mov,ocr -show_entries frame=pkt_dts_time:frame_tags=lavfi.ocr.text -of json
input= sys.argv[1]
id = 0
old_time = '00:00:00,000'
@XLNCs
XLNCs / AdobeFixAMD
Last active December 24, 2025 03:51
To fix adobe products crashes on AMD hackintosh
MOVED HERE:
https://gist.github.com/naveenkrdy/26760ac5135deed6d0bb8902f6ceb6bd
@phortuin
phortuin / signing-git-commits.md
Last active July 11, 2026 18:34
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
@nunofgs
nunofgs / README.md
Last active May 1, 2026 08:03
Use any RTSP camera with Prusa Connect

I use a cheap Tapo C100 webcam to monitor my 3D prints. It supports RTSP.

Screenshot 2023-07-17 at 23 26 34

Instructions

  1. Go to the Cameras section at https://connect.prusa3d.com
  2. Add a new camera.
  3. Click the QR code link
  4. Click "Start Camera"