Skip to content

Instantly share code, notes, and snippets.

View jbuchbinder's full-sized avatar

Jeff Buchbinder jbuchbinder

View GitHub Profile
@jbuchbinder
jbuchbinder / 2016_Boston_48_Hour_Project_Delivery_Prep.md
Last active May 15, 2016 19:59
2016 Boston 48 Hour Project Deliverable Prep

2016 Boston 48 Hour Project Delivery Prep

DVD (SD)

avconv -i "AllIn.HD.mov" -qscale 1 -aq 1 -threads 4 -target film-dvd AllIn.SD.mpg
VIDEO_FORMAT=NTSC dvdauthor -o ALLIN -t AllIn.SD.mpg
VIDEO_FORMAT=NTSC dvdauthor -o ALLIN -T
mkisofs -v -dvd-video -o ALLIN-SD.iso ALLIN
@jbuchbinder
jbuchbinder / thumbs-from-photos.sh
Created April 11, 2015 04:42
Generate directory of thumbnails from CR2 raw images
#!/bin/bash
# thumbs-from-photos.sh
# @jbuchbinder
mkdir -p thumbs
for R in *.CR2; do
J=${R//.CR2}.thumb.jpg
echo "$R -> $J"
dcraw -e $R
mv $J thumbs/
@jbuchbinder
jbuchbinder / CVE-2015-0204-checker.sh
Created March 12, 2015 13:35
CVE-2015-0204 FREAK SSL Vulnerability Checker
#!/bin/bash
echo "CVE-2015-0204 FREAK SSL Vulerability Checker"
for S in $*; do
X=$(openssl s_client -cipher EXPORT -connect $S:443 < /dev/null 2>/dev/null | grep SSL-Session | wc -l)
if [ $X -ne 0 ]; then
echo "$S : VULNERABLE"
else
echo "$S : [ OK ]"
@jbuchbinder
jbuchbinder / watermark.sh
Created December 14, 2014 18:39
Watermark a series of pictures using ImageMagick's "composite" utility
#!/bin/bash
# watermark.sh - @jbuchbinder
# Watermark all JPEG images specified on the command line
WATERMARK=~/Pictures/mywatermark.png
for i in "$@"; do
j="${i//.jpg}_watermarked.jpg"
echo "$i -> $j"
composite -compose atop -gravity southeast -background none "${WATERMARK}" "$i" "$j"

Gradle refresh fragment

Forces refreshing of Gradle dependencies on every build.

configurations.all {
    // check for updates every build
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
package main
import (
"fmt"
"net/http"
"os"
)
func Upload(w http.ResponseWriter, req *http.Request) {
mr, err := req.MultipartReader()
@jbuchbinder
jbuchbinder / 5dmk3-rated-pics.sh
Last active July 12, 2016 18:19
Snippet for showing all 1-star rated pictures from a Canon 5Dmk3 and enabling priority 1 for them in rawstudio
#!/bin/bash
# Snippet for showing all 1-star rated pictures from a Canon 5Dmk3 and
# enabling priority 1 for them in rawstudio. @jbuchbinder
for I in *.CR2; do
if [ `exiv2 pr -p a -u $I 2>&1 | grep 'Xmp.xmp.Rating' | awk '{ print $4 }'` == "1" ]; then
echo -n $I
J=".rawstudio/$I.cache.xml"
if [ -f "$J" ]; then
@jbuchbinder
jbuchbinder / 00-haproxy-build-on-openbsd.sh
Last active May 3, 2016 14:28
haproxy 1.5.6 / 1.6.1 (+ssl) build on openbsd
###
### HAPROXY 1.5.6 + SSL BUILD ON OPENBSD
###
# Requires gmake package to be installed
pkg_add gmake
# Grab openssl package and install in /usr/local/ssl
wget --no-check-certificate -c https://www.openssl.org/source/openssl-1.0.1i.tar.gz
tar zvxf openssl-1.0.1i.tar.gz
Patch for not using relative URLs for admin forms. This allows proxied instances
of the stats admin interface to continue to function, as the default FORM
action is to submit to the current URL.
Submitter: Jeff Buchbinder
diff --git a/src/dumpstats.c b/src/dumpstats.c
index 3855e09..d1527ea 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@jbuchbinder
jbuchbinder / ML-sound-recorder-patch.diff
Created August 7, 2014 01:25
Magic Lantern sound recorder patch
--- a/src/all_features.h Thu Aug 07 00:44:10 2014 +0300
+++ b/src/all_features.h Wed Aug 06 21:10:33 2014 -0400
@@ -40,8 +40,10 @@
#ifdef CONFIG_BEEP
#define FEATURE_BEEP
#endif
- //~ #define FEATURE_WAV_RECORDING
- //~ #define FEATURE_VOICE_TAGS
+
+/* Reenable this - @jbuchbinder */