Skip to content

Instantly share code, notes, and snippets.

@brookemckim
brookemckim / chef_error.txt
Created May 12, 2011 20:48
Chef::Exceptions::PrivateKeyMissing
[Thu, 12 May 2011 16:46:45 -0400] WARN: Failed to read the private key /etc/chef/client.pem: #<Errno::ENOENT: No such file or directory - /etc/chef/client.pem>
[Thu, 12 May 2011 16:46:45 -0400] ERROR: Running exception handlers
[Thu, 12 May 2011 16:46:45 -0400] ERROR: Exception handlers complete
[Thu, 12 May 2011 16:46:45 -0400] FATAL: Stacktrace dumped to /tmp/chef-stacktrace.out
[Thu, 12 May 2011 16:46:45 -0400] FATAL: Chef::Exceptions::PrivateKeyMissing: I cannot read /etc/chef/client.pem, which you told me to use to sign requests!
@brookemckim
brookemckim / wowza_error.log
Created May 26, 2011 14:06
Wowza Error Log
WARN server comment 2011-05-26 09:29:14 - - - 31.366 - - - - - - - - LiveStreamPacketizerSmoothStreaming.handlePacket[lomalinda/_definst_/3-1]: Fragment duration greater than suggested range of 1-4 seconds. Adjust keyframe interval accordingly: Fragment durations: [4.9,4.9,4.9]
WARN server comment 2011-05-26 09:29:14 - - - 31.367 - - - - - - - - LiveStreamPacketizerSmoothStreaming.handlePacket[lomalinda/_definst_/3-2]: Fragment duration greater than suggested range of 1-4 seconds. Adjust keyframe interval accordingly: Fragment durations: [4.9,4.9,4.9]
WARN server comment 2011-05-26 09:29:14 - - - 31.367 - - - - - - - - LiveStreamPacketizerSmoothStreaming.handlePacket[lomalinda/_definst_/3-3]: Fragment duration greater than suggested range of 1-4 seconds. Adjust key
@brookemckim
brookemckim / mongo.rb
Created June 6, 2011 00:38
MongoDB Initializer
require 'yaml'
config = YAML.load_file(File.expand_path(File.join(SINATRA_ROOT, 'config', 'mongo.yaml')))
db = config[ENV['RACK_ENV'].downcase]
uri = "mongodb://#{db['username']}:#{db['password']}@#{db['host']}:#{db['port']}/#{db['database']}"
DB = Mongo::Connection.from_uri(uri).db(db['database'])
@brookemckim
brookemckim / hls
Created June 8, 2011 19:05
Roku Recommended FFMPEG h264 Preset
ffmpeg -i <inputFile> -f mpegts -acodec libfaac -vcodec libx264 \ -vpre roku -crf 15 -threads 0 ~/OneTransportStreamFile3200.ts
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Pragma" content="no-cache">
<SCRIPT language="javascript">
window.self.focus()
</SCRIPT>
<title>RSS_Weather02_newcrawl</title>
@brookemckim
brookemckim / builder.rb
Created July 13, 2011 17:54
Build XML from template w/ Nokogiri
template = File.read('/path/to/template')
builder = Nokogiri::XML::Builder.new do |xml|
eval File.read(template)
end
builder.to_xml
@brookemckim
brookemckim / environment.rb
Created August 10, 2011 18:52
Fix for rubygems < 1.3.6 & older verions of rails
if Gem::VERSION >= "1.3.6"
module Rails
class GemDependency
def requirement
r = super
(r == Gem::Requirement.default) ? nil : r
end
end
end
end
@brookemckim
brookemckim / event.rb
Created August 15, 2011 20:54
duration_as_hhmm
def duration_as_hhmm
seconds = adjusted_duration
hours = (seconds / 3600).to_i
minutes = (seconds - (hours * 3600)) / 60
# hhmm
"#{'%02d' % hours}#{'%02d' % minutes % 60}"
end
d-i partman-auto-lvm/guided_size string max
d-i partman-auto/expert_recipe string \
boot-root :: \
500 50 500 ext4 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /boot } \
. \
@brookemckim
brookemckim / changer.rb
Created September 15, 2011 20:08
Swapping multi-bitrate HLS playlists with a single sub-playlist
require 'nokogiri'
require 'open-uri'
require 'httparty'
require 'pathname'
class CategoryItem
attr_accessor :title, :description, :feed, :element
def initialize(node)
@element = node