Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
USERNAME=your_username
PASSWORD=your_password
PLATFORM=linux # 'linux' | 'android'
# Android: install termux, termux-widgets + termux-api, + pkg install termux-api curl
# Linux: install curl, libnotify-bin
@m2-farzan
m2-farzan / main.m
Last active December 23, 2021 11:00
Full-state State Observer
close all
% SIMULATION
m = 1;
I = 0.1677;
R = 0.02;
h = 0.02;
g = 9.81;
@m2-farzan
m2-farzan / extract-slides.sh
Last active September 26, 2021 08:13
Extract slides from a presentation video by comparing the PSNR of consecutive difference of down-sampled frames against a threshold
#!/bin/bash
set -e
# Usage: ./extract-slides.sh mylecture.mp4
# Config variables
SIMILARITY_THRESHOLD=25 # A slide change is assumed iff frames PSNR similarity falls below this value
FRAME_PERIOD=30 # [Seconds] Duration between sampling times
CONVERT_TO_PDF=0 # Set to 1 to make pdf. Might cause errors if imagemagick is not configured properly. See https://askubuntu.com/questions/1081895/trouble-with-batch-conversion-of-png-to-pdf-using-convert
PDF_FILE="${1%.*}-slides.pdf" # Only used if CONVERT_TO_PDF is 1