Skip to content

Instantly share code, notes, and snippets.

View jbuchbinder's full-sized avatar

Jeff Buchbinder jbuchbinder

View GitHub Profile
@jbuchbinder
jbuchbinder / fpm-openssl.sh
Created June 7, 2016 15:58
FPM OpenSSL build
#!/bin/bash
# fpm-openssl - @jbuchbinder
# Build script for recent openssl builds using FPM on EL7. Untar the release and run this script to build
# your RPM. Requires:
# - RPMS: ruby-devel make gcc rpm-build
# - GEMS: fpm
./config && make depend && make all && make install INSTALL_PREFIX=/tmp/openssl
fpm -s dir -t rpm -n openssl-recent \
@jbuchbinder
jbuchbinder / discovery-livestream.sh
Last active March 19, 2017 20:15
Download discovery TV public access content
#!/bin/bash
# discovery-livestream.sh - @jbuchbinder
#
# Download date-stamped content from Channel 22
STAMP=$( date +%Y%m%d-%H%M )
rtmpdump \
-v \
-r 'rtmp://discovervideo.mpl.miisolutions.net/DiscoverVideo-live-29/_definst_/' \
@jbuchbinder
jbuchbinder / phantom-load.js
Created April 1, 2016 14:03
PhantomJS page load timer
// @jbuchbinder
//
// Execute with:
// phantomjs --ssl-protocol=TLSv1 phantom-load.js URL
"use strict";
var page = require('webpage').create(),
system = require('system'),
address;
@jbuchbinder
jbuchbinder / resourcetiming.js
Created April 1, 2016 13:36 — forked from oloynet/resourcetiming.js
Catch all the resource load times with casperjs
var casper = require("casper").create({
//loadImages: false,
//logLevel: 'debug',
verbose: true
});
var utils = require('utils');
/* ----- test parameters ----- */
@jbuchbinder
jbuchbinder / notes-to-pdf.sh
Created February 8, 2016 14:39
Use markdown-pdf to convert meeting notes/minutes in Markdown into nicely formatted PDF documents.
#!/bin/bash
#
# notes-to-pdf.sh
# @jbuchbinder
#
# Use markdown-pdf to convert meeting notes/minutes in Markdown into nicely formatted
# PDF documents. Formatting:
#
# # Title
# ## Subtitle
@jbuchbinder
jbuchbinder / concat-mts-files.sh
Created February 8, 2016 14:19
Concatenate MTS AVCHD files under Linux
#!/bin/bash
## Solution from: http://stackoverflow.com/questions/26150533/join-avchd-mts-files-on-linux
## ffmpeg -i "concat:00000.MTS|00001.MTS|00002.MTS" -c copy output.m2ts
## File with .m2ts extension, etc
OUT="$1"; shift
## Format : "concat:00000.MTS|00001.MTS|00002.MTS"
IN="concat:$1"; shift
@jbuchbinder
jbuchbinder / contact-sheets.sh
Last active November 27, 2017 16:13
Create contact sheets from CR2 and JPG photos
#!/bin/bash
# Create 7x6 contact sheets
# @jbuchbinder
#
# Dependencies:
# - dcraw
# - imagemagick
SIZE=500
@jbuchbinder
jbuchbinder / coffee.go
Created December 17, 2015 13:54
Coffee.
package main
import "vendor/coffee"
func main() {
cup, err := coffee.NewCoffee()
if err != nil {
panic()
}
for {
@jbuchbinder
jbuchbinder / normalizing-video-volume.sh
Created November 13, 2015 01:13
Normalizing video volume
VIDEO_FILE=$1
VIDEO_FILE_FIXED=${VIDEO_FILE%.*}-fixed.${VIDEO_FILE##*.}
avconv -i $VIDEO_FILE -c:a pcm_s16le -vn audio.wav
normalize-audio audio.wav
avconv -i $VIDEO_FILE -i audio.wav -map 0:0 -map 1:0 -c:v copy -c:a libvo_aacenc $VIDEO_FILE_FIXED
@jbuchbinder
jbuchbinder / GoPro-Timelapse.sh
Last active October 12, 2015 19:04
GoPro timelapse assembly
## Assemble timelapse into AVI
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:autoaspect:vqscale=3 \
-vf scale=1920:1080 -mf type=jpeg:fps=23.97 'mf://*.JPG' \
-o out.avi
## Convert to MP4
HandBrakeCLI -Z Normal -O4 -i out.avi -o out.mp4
## Concatenate into a single file
MP4Box -cat out1.mp4 -cat out2.mp4 -new out-combined.mp4