Skip to content

Instantly share code, notes, and snippets.

View invalidusrname's full-sized avatar
🤷‍♀️

Matt invalidusrname

🤷‍♀️
View GitHub Profile
$ heroku console
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
Error: uninitialized constant Heroku::Command::Run::RestClient (NameError)
Backtrace: /usr/local/heroku/lib/heroku/command/run.rb:89:in `rescue in console'
/usr/local/heroku/lib/heroku/command/run.rb:83:in `console'
/usr/local/heroku/lib/heroku/command.rb:207:in `run'
/usr/local/heroku/lib/heroku/cli.rb:28:in `start'
@invalidusrname
invalidusrname / capistrano.rb
Last active April 3, 2019 21:00
sidekiq capistrano
require 'bundler/capistrano'
require 'capistrano/ext/multistage'
require 'sidekiq/capistrano'
#require 'airbrake/capistrano'
set :application, "pdf_maker_app"
set :port, 22
set :user, 'deploy'
set :use_sudo, false
set :ssh_options, { :forward_agent => true }
@invalidusrname
invalidusrname / emberjs-2012-urls.txt
Last active April 3, 2019 21:00
seattle emberjs (Dec 2012) urls
http://www.youtube.com/watch?v=4Ed_o3_59ME
http://www.youtube.com/watch?v=aBvOXnTG5Ag
http://www.youtube.com/watch?v=_6yMxU-_ARs
http://www.youtube.com/watch?v=TTy1pbXdKJg
@invalidusrname
invalidusrname / timesheet.bash
Last active April 3, 2019 21:00
I use this for generating timesheets. Handy for consulting folks as well
#!/bin/bash
set -e
work_dirs="$DEV_BOX/apps $DEV_BOX/gems"
email=`git config user.email`
start_date="last week"
end_date="today"
timesheet=$PWD/timesheet.txt
touch $timesheet
@invalidusrname
invalidusrname / scotland-ruby-fetch.sh
Last active April 3, 2019 21:01
Grabs all scottish ruby conference 2012 video urls
curl -s http://programme.scottishrubyconference.com/schedule | grep "video_link" | awk -F\" '{print $2}' | sort | while read url; do curl -s "http://programme.scottishrubyconference.com$url" | grep "video/mp4" | cut -d "'" -f 2 >> /tmp/sr-vids.txt; done; cat /tmp/sr-vids.txt | uniq
@invalidusrname
invalidusrname / run_worker.rb
Last active April 3, 2019 20:26
Resque task to start workers
require 'resque/tasks'
def run_worker(queue, count = 1)
puts "Starting #{count} worker(s) with QUEUE: #{queue}"
ops = {:pgroup => true, :err => [(Rails.root + "log/resque_err.log").to_s, "a"],
:out => [(Rails.root + "log/resque_stdout.log").to_s, "a"]}
env_vars = {"QUEUE" => queue.to_s}
count.times {
## Using Kernel.spawn and Process.detach because regular system() call would
## cause the processes to quit when capistrano finishes
@invalidusrname
invalidusrname / puppet_sync_issue.log
Last active April 3, 2019 20:24
Puppet server time out of sync
root@app1:/etc/puppet# puppet agent --server=puppet.tk --test --noop --verbose --debug
debug: Using cached certificate for app1.tk
err: Could not retrieve catalog from remote server: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed. This is often because the time is out of sync on the server or client
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
debug: Value of 'preferred_serialization_format' (pson) is invalid for report, using default (yaml)
debug: report supports formats: b64_zlib_yaml raw yaml; using yaml
err: Could not send report: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed. This is often because the time is out of sync on the server or client
@invalidusrname
invalidusrname / Puppetfile
Last active April 3, 2019 20:23
some dev packages with puppet
class dev_essentials {
package { [
"apache2-threaded-dev",
"build-essential",
"curl",
"git",
"git-core",
"libcurl4-gnutls-dev",
"libreadline-dev",
"libsqlite3-dev",
$ bundle
Fetching gem metadata from http://rubygems.org/......
Fetching gem metadata from http://rubygems.org/..
Using rake (0.9.2.2)
Installing ZenTest (4.8.2)
Gem::InstallError: ZenTest requires RubyGems version ~> 1.8. Try 'gem update --system' to update RubyGems itself.
An error occured while installing ZenTest (4.8.2), and Bundler cannot continue.
Make sure that `gem install ZenTest -v '4.8.2'` succeeds before bundling.
$ gem -v
@invalidusrname
invalidusrname / Vagrantfile
Last active April 3, 2019 20:58
Connecting between VMs with vagrant
config.vm.define :puppet do |app_config|
app_config.vm.customize ["modifyvm", :id, "--name", "puppet", "--memory", "512"]
app_config.vm.box = "precise_with_puppet"
app_config.hosts.name = 'puppet'
app_config.vm.host_name = 'puppet'
app_config.vm.forward_port 22, 2222, :auto => true
app_config.vm.forward_port 80, 4561
app_config.vm.network :hostonly, "33.13.13.01"
app_config.vm.provision :shell do |shell|
shell.path = "../puppet_master_setup.sh"