Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# take a directory of images and combine them into a movie
# create an editable list of frames for the movie
ls -1v | grep JPG > files.txt
# 1080p at 24 fps
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=21600000 -o timelapse.1080p.24fps.avi -mf type=jpeg:fps=24 mf://@files.txt -vf scale=1920:1080
# 4K at 60 fps
>> a = [2, 1, 3]
=> [2, 1, 3]
>> a.sort
=> [1, 2, 3]
>> a
=> [2, 1, 3]
>> a.sort!
=> [1, 2, 3]
>> a
=> [1, 2, 3]
# HOW TO USE TUNNELS TO ACCESS THE LAB MACHINES
# from your laptop:
# create a new tmux session:
tmux new -s tunnels
# open tunnel for HTTP:
ssh -L 4567:<IP OF LAB MACHINE>:80 <IP OF HOST ON LAB WIFI>
# create new window in tmux
# open tunnel for SSH:
ssh -L 2222:<IP OF LAB MACHINE>:22 <IP OF HOST ON LAB WIFI>
@dmerrick
dmerrick / runlist.md
Last active October 27, 2022 11:17
How Dana sets up a brand new Mac
@dmerrick
dmerrick / lights_app.rb
Last active December 14, 2015 00:39
LightsApp
#!/usr/bin/env ruby
require 'httparty'
require 'digest/md5'
require 'json'
class LightsApp
def initialize(app_name, api_url)
@name = app_name
dmerrick@vagrant:~$ psql -U postgres
psql (9.1)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
@dmerrick
dmerrick / stream_favorites_combiner.rb
Created October 5, 2012 18:19
team liquid streams
#!/usr/bin/env ruby
require 'pp'
old_list = [
"AcerMMA",
"Artosis",
"Blizzard Stream",
"Day[9].tv",
"Destiny",
"Dragon",
#!/usr/bin/env ruby -w
require 'open-uri'
require 'digest/md5'
require 'fileutils'
# this script creates a gif from NASA's high-res images of the sun
# the goal is to capture the transit of Venus in gif form
# it is expected that this will be run on OS X
# the following are required:
bash -c '
# removed installation, presumably Chef is installed on existing nodes
# adapted by Dana from the migration linked to from this document:
# http://wiki.opscode.com/display/chef/Migrating+to+Hosted+Chef+from+an+Open+Source+Chef+Server+implementation
mv /etc/chef/client.pem{,.old_chef_server}
mv /etc/chef/validation.pem{,.old_chef_server}
(
#!/bin/bash
set -x # print every command before it runs
set -e # exit if any command fails
mkdir -p /tmp/katama_chef/
git checkout katama_chef
cp -r cookbooks/$1 /tmp/katama_chef/
mkdir -p /tmp/hc_production/