Skip to content

Instantly share code, notes, and snippets.

@Manouchehri
Manouchehri / gist:e06c1538427b3ee8cbaff36607d6e891
Created March 31, 2022 12:30
List of encoders on M1 Max (macOS 12.3 21E230)
Optional(<__NSArrayM 0x600003c48750>(
{
CodecName = "24-bit RGB";
CodecType = 24;
DisplayName = "24-bit RGB";
EncoderID = "com.apple.videotoolbox.videoencoder.24rgb";
EncoderName = "Apple 24-bit RGB";
PerformanceRating = 0;
},
{
@Manouchehri
Manouchehri / raspberry-pi-zero_as_webcam.md
Created March 31, 2022 11:52 — forked from justinschuldt/raspberry-pi-zero_as_webcam.md
Directions for setting up a RaspberryPi to act as a generic USB webcam

hardware/software

Webcam parts:

  • Raspberry Pi Zero W Rev 1.1
  • Raspberry Pi Camera v2 (8-megapixel)
  • Raspberry Pi High Quality Camera (12.3-megapixel)
  • Raspbian Buster Lite 2020-02-13

Webcam works with:

  • Windows 10
  • Windows 10 "Camera" app
# ffmpeg -h encoder=prores_videotoolbox
Encoder prores_videotoolbox [VideoToolbox ProRes Encoder]:
General capabilities: dr1 delay hardware
Threading capabilities: none
Supported pixel formats: videotoolbox_vld yuv420p nv12 ayuv64le uyvy422 p010le nv16 p210le p216le nv24 p410le p416le bgra
prores_videotoolbox AVOptions:
-profile <int64> E..V....... Profile (from -99 to 5) (default auto)
auto E..V....... Automatically determine based on input format
proxy E..V....... ProRes 422 Proxy
lt E..V....... ProRes 422 LT
Cable Matters USB-C 8K Video Adapter:
Product ID: 0x5442
Vendor ID: 0x0bda (Realtek Semiconductor Corp.)
Version: 3.02
Serial Number: 123456789ABCDEFGH
Speed: Up to 12 Mb/s
Manufacturer: Cable Matters Inc.
Location ID: 0x00100000 / 1
Current Available (mA): 500
brew install git openssh secretive # open a new terminal after
# Grab the path from Secretive's UI
git config --global user.signingkey /Users/YOURNAMEHERE/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/YOURKEYHERE.pub
git config --global gpg.format ssh
git config --global commit.gpgSign true
git config --global tag.gpgSign true
git config --global tag.forceSignAnnotated true
# This is a bit redundant for most attack vectors, but let's keep it to be safe anyway.
dave@armie:~ $ ssh-keygen -vvv -t ecdsa-sk -O no-touch-required -N "" -C "$(date +'%Y%m%d')-google1" -f /tmp/google1
Generating public/private ecdsa-sk key pair.
You may need to touch your authenticator to authorize key generation.
debug3: start_helper: started pid=18011
debug3: ssh_msg_send: type 5
debug3: ssh_msg_recv entering
debug1: start_helper: starting /usr/lib/openssh/ssh-sk-helper
debug1: sshsk_enroll: provider "internal", device "(null)", application "ssh:", userid "(null)", flags 0x00, challenge len 0
debug1: sshsk_enroll: using random challenge
debug1: sk_probe: 1 device(s) detected
@Manouchehri
Manouchehri / centos8-chroot.sh
Created March 15, 2022 15:43 — forked from snixon/centos8-chroot.sh
Build a centos8 AWS AMI in a chroot
#!/bin/bash -ex
# Build a new Centos8 install on EBS volume in a chroot
# Run from RHEL8 or CentOS8 instance - eg: ami-0c322300a1dd5dc79 in us-east-1 (RHEL 8 official image)
# Script expects a second EBS volume, I add them as /dev/sdf in the console
# When the script completes, turn the second EBS volume into your new AMI through the console.
# Adjust the section below to match the device names you're using. Defaults are for an m5.large
# m5 series requires the updated device names
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import json
with open( "RIPE-Atlas-measurement-32396390.json" , "r" ) as myopen:
measurements = json.load(myopen)
good_measurements = []
for measurement in measurements:
if measurement['prb_id'] == 6266:
@Manouchehri
Manouchehri / yesreally.sh
Created January 12, 2022 20:44
Setting up my monitors
xrandr --output HDMI-A-0 --rotate left --rate 143.91 --mode 2560x1440 --mode 2560x1440 --set "max bpc" 10 --output DisplayPort-3 --right-of HDMI-A-0 --rotate left --rate 165.08 --mode 2560x1440 --set "max bpc" 10 --output DisplayPort-4 --right-of DisplayPort-3 --rotate right --rate 165.08 --mode 2560x1440 --set "max bpc" 10 --output DisplayPort-5 --right-of DisplayPort-4 --rotate right --rate 165.08 --mode 2560x1440 --set "max bpc" 10 --output HDMI-A-1 --right-of DisplayPort-5 --rotate right --rate 143.91 --mode 2560x1440 --set "max bpc" 10
find /Volumes/q/Movies/GoPro -type f -iname "*.mp4" -print0 | parallel -0 "mediainfo {} | grep Width | grep -v ' 5 312' && echo {}" | grep -v Width | parallel "mv -v {} /Volumes/q/Movies/GoPro/not5k/{/}"