Skip to content

Instantly share code, notes, and snippets.

@jpollack
jpollack / xwincap.sh
Created October 14, 2021 01:46
Simple low resource command line window recorder.
#!/bin/bash
[ -z "$1" ] && echo "Usage: $0 <output>" && exit
echo "Click the window you wish to record."
w=( $(xwininfo 2>/dev/null | grep -E "Width|Height|Absolute" | cut -d : -f 2) )
echo "Press 'q' when finished!"
ffmpeg -hide_banner -y -v quiet -stats -f x11grab -framerate 30 -video_size ${w[2]}x${w[3]} -i ${DISPLAY}.0+${w[0]},${w[1]} \
-c:v libx264 -preset ultrafast -crf 30 "$1"
@jpollack
jpollack / play-wdcb.sh
Last active September 15, 2021 11:01
play-wdcb.sh
#!/bin/bash
# For when you want to listen to jazz with minimal CPU footprint
# Requires the packages: procps, curl, html2text, mpg321, grep
# Love the simplicity
_atexit() {
kill -TERM $mpgpid
kill -TERM $disppid
}
@jpollack
jpollack / Dockerfile-wmc
Last active August 9, 2021 21:55
Dockerfile for WWW::Mechanize::Chrome
# To build:
# $ docker build -t perl-wmc <Dockerfile-wmc
#
# To run:
# $ docker run -v $(pwd):/wd --network=host -it --rm perl-wmc <perl script>
#
FROM debian:stable-slim AS base
RUN \