Skip to content

Instantly share code, notes, and snippets.

@dmerrick
dmerrick / raid.md
Last active December 21, 2015 06:39

Background: I have a 2TB Apple Time Capsule that I've been using to store my media. I use BitTorrent a lot, through private trackers exclusively, and I use a Netherlands-based seedbox. Recently my seedbox was upgraded from 400GB storage to 1.35TB, and I that made me download a lot more (movies and season packs of TV shows, mainly).

I filled my Time Capsule pretty fast and went looking for the next step. I decided to get a RAID array and did a few weeks of research. I didn't want to have to spend a lot of time setting up the RAID, so I looked at the sexpensive options like Drobo and ReadyNAS. I really wanted to use ZFS because that's the new hotness, but even with the easy-to-use options, it seemed like more work than I really wanted to put in.

I ended up settling on the [Synology DS1813+](http://www.synology.com/products/product.php?product_name=DS1813%2B&lan

#!/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}
(