Skip to content

Instantly share code, notes, and snippets.

View benschw's full-sized avatar

Ben Schwartz benschw

View GitHub Profile
@benschw
benschw / Dockerfile
Last active October 1, 2018 18:30
MySQL Docker Container
FROM ubuntu
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get -y install mysql-client mysql-server
@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
@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 / 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 / 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 / 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 / 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:

config.vm.provision "shell" do |s|
s.inline = "VAR1 is $1 and VAR2 is $2"
s.args = "#{ENV['VAR1']}, #{ENV['VAR2']}"
end

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

@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===