Skip to content

Instantly share code, notes, and snippets.

View benschw's full-sized avatar

Ben Schwartz benschw

View GitHub Profile
@benschw
benschw / gist:9762196
Created March 25, 2014 13:49
how to rip a dvd
==Get Utilities==
sudo apt-get install mplayer mencoder mpeg4ip-utils mpeg4ip-server subtitleripper ogmtools mkvtoolnix
==Prepare==
===Detect Cropping===
mplayer dvd://1 -frames 4 -vf cropdetect -sb 50000000 -nosound -vo null 2>/dev/null | grep CROP
[CROP] Crop area: X: 8..719 Y: 0..479 (-vf crop=704:480:12:0).
[CROP] Crop area: X: 7..719 Y: 0..479 (-vf crop=704:480:12:0).
*Skip first ~50mb, this is the title screen and is often a different size
@benschw
benschw / gist:9762183
Created March 25, 2014 13:49
Build multithreaded mplayer
Build multithreaded mplayer so HD x264 videos won't crap out
==Dependancies==
$ sudo apt-get install build-essential checkinstall
===x264===

Player

Change audio / subtitles in mplayer

  • Press V to toggle the subs on and off
  • Press J to cycle languages
  • Press # to cycle the audio

Encoder

Join two avi files in mencoder

config.vm.provision "shell" do |s|
s.inline = "VAR1 is $1 and VAR2 is $2"
s.args = "#{ENV['VAR1']}, #{ENV['VAR2']}"
end
@benschw
benschw / commit-guidelines.md
Last active January 4, 2016 03:19
fork of angular's commit guidelines

Git Commit Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the AngularJS change log.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

@benschw
benschw / heat-cfn-user_data.txt
Created January 21, 2014 16:26
clout init user_data to add heat-cfntools to a base image; script to apply it
#cloud-config
ssh_import_id: [steve-stevebaker]
apt_sources:
- source: "ppa:steve-stevebaker/heat-cfntools"
runcmd:
- [ apt-get, heat-cfntools ]
@benschw
benschw / deluge-install.md
Created January 5, 2014 15:23
deluge setup

install daemon, webui, etc

$ sudo aptitude install deluge deluged deluge-web

run it

$ sudo service deluged start
$ screen -fa -d -m -S deluge-web deluge-web
@benschw
benschw / gist:8017402
Created December 18, 2013 04:46
remove Ghosted docker containers

to remove a container that docker doesn't know isn't running:

  • take note of the container ID
  • service stop docker
  • modify the config.json file in /var/lib/docker/containers/$CONTAINER_ID to have "Running":false
  • service start docker
  • docker rm $CONTAINER_ID

Unfortunately, this makes all the other containers turn into ghosts, so you can only do it when there's only a single container. Plus it's really hacky.

@benschw
benschw / gist:7980697
Created December 16, 2013 00:46
socat docker ambassador
The svendowideit/ambassador Dockerfile
The svendowideit/ambassador image is a small busybox image with socat built in. When you start the container, it uses a small sed script to parse out the (possibly multiple) link environment variables to set up the port forwarding. On the remote host, you need to set the variable using the -e command line option.
-expose 1234 -e REDIS_PORT_1234_TCP=tcp://192.168.1.52:6379 will forward the local 1234 port to the remote IP and port - in this case 192.168.1.52:6379.
#
#
# first you need to build the docker-ut image using ./contrib/mkimage-unittest.sh
# then
@benschw
benschw / golang-install.sh
Last active December 30, 2015 19:19
install golang 1.1
sudo apt-get install python-software-properties # 12.04
sudo add-apt-repository ppa:duh/golang
sudo apt-get update
sudo apt-get install golang
$ mkdir $HOME/go
bashrc