Skip to content

Instantly share code, notes, and snippets.

View cornexo's full-sized avatar

Jeff Cornejo cornexo

View GitHub Profile
Verifying that +cornexo is my openname (Bitcoin username). https://onename.com/cornexo
@cornexo
cornexo / gist:9493285
Created March 11, 2014 19:31
keybase.md
### Keybase proof
I hereby claim:
* I am cornexo on github.
* I am cornexo (https://keybase.io/cornexo) on keybase.
* I have a public key whose fingerprint is 2692 31DB AD94 0E38 92EB 650C E1E4 0BD2 C6F1 8B72
To claim this, I am signing this object:
@cornexo
cornexo / ripvideo.sh
Created February 7, 2013 21:40
encode video using HandbrakeCLI. Usage: ripvideo.sh 20120109 where the 20120109 is the folder inside of the work folder where VIDEO_TS lives.
#! /bin/bash
workfolder=/path/to/sourcefiles
outputfolder=/path/to/outputfiles
/Applications/HandbrakeCLI --input $workfolder/$1 --title 1 --output $outputfolder/$1.mp4 --format mp4 --markers --encoder x264 --encopts ref=1:weightp=1:subq=2:rc-lookahead=10:trellis=0:8x8dct=0:ref=1:subme=2:me=dia:analyse=none:trellis=0:no-fast-pskip=0:8x8dct=0:weightb=0 --vb 800 --loose-anamorphic --audio 1 --aencoder copy:aac
@cornexo
cornexo / copyvideo.sh
Created February 7, 2013 21:15
copy dvd files onto harddrive for faster procesing. usage: copyvideo.sh s20120109 where s20120109 is the destination foldername. This is Mac OSX specific.
#! /bin/bash
workfolder=/path/to/sourcefiles
if [ -d "/Volumes/DVD_VIDEO_RECORDER/" ]; then
mkdir -p $workfolder/$1
cp -vR /Volumes/DVD_VIDEO_RECORDER/* $workfolder/$1/
drutil eject
else
echo "DVD not mounted"
@cornexo
cornexo / gist:4734152
Last active December 12, 2015 07:08
concatenate mp4 files together. usage: concat.sh s20120109 where s20120109-1.mp4, s20120109-2.mp4, s20120109-3.mp4, ... s20120109-N.mp4 are separate mp4 source files. the output will reside in file s20120109.mp4
#! /bin/bash
workfolder=/path/to/sourcefiles
cd ${workfolder}
counter=1
for workfile in $1-*.mp4;
do
ffmpeg -y -i $workfile -c copy -bsf:v h264_mp4toannexb -f mpegts $workfile.ts
if [ "$counter" -eq "1" ]
then
concatstring="concat:$workfile.ts"
message =<<-EOF
Usage:
ruby hd.rb DISK_NAME [options]
Options:
[--mount] # Mounts hard drive in /Volumes/EXT_HD
[--umount] # Umounts hard drive in /Volumes/EXT_HD
@cornexo
cornexo / gist:4453333
Created January 4, 2013 15:15
kill zombie processes
kill -s SIGCHLD <ppid>
@cornexo
cornexo / gist:4428241
Created January 1, 2013 15:58
count number of times lines occurs
cat *.txt | sort | uniq -c | sort -nr