Skip to content

Instantly share code, notes, and snippets.

@robbkidd
robbkidd / Gemfile
Last active June 15, 2023 22:52
A More Courteous Unicorn Worker Assassin
source 'https://rubygems.org'
gem 'unicorn'
gem 'rack-timeout'
gem 'sinatra'
gem 'opentelemetry-sdk'
gem 'opentelemetry-exporter-otlp'
gem 'opentelemetry-instrumentation-all'
@robbkidd
robbkidd / 01_direnv_path_to_bliss.md
Last active November 16, 2016 06:50
Use `direnv` to control your environments.

brew install direnv ruby-install chruby

Currently have Ruby switching and declaring Chef DK use only in directories that you specify.

Recommend adding .direnv/ to your Ruby projects' .gitignore

Massive nods to schisamo for the Chef DK piece! And to Steve Tooke for most of the Ruby solution.

@robbkidd
robbkidd / 1_plan.sh
Last active September 21, 2016 15:53
mapcrafter Habitat package
pkg_name=mapcrafter
pkg_description="High Performance Minecraft Map Renderer."
pkg_version=2.3.1
pkg_maintainer="Robb Kidd <robb@thekidds.org>"
pkg_license=('GPL-3.0')
pkg_description="Mapcrafter is a high performance Minecraft map renderer written in C++. It renders Minecraft worlds to a bunch of images which are viewable in any webbrowser using Leaflet.js."
pkg_upstream_url="https://github.com/mapcrafter/mapcrafter"
pkg_source=https://github.com/mapcrafter/mapcrafter/archive/v.${pkg_version}.tar.gz
pkg_shasum=b88e53ccffc00f83717f2e686dbed047b95f011187af2b7a23ba7f5cd3537679
pkg_dirname=mapcrafter-v.2.3.1
@robbkidd
robbkidd / keybase.md
Created July 19, 2016 20:19
Keybase proof

Keybase proof

I hereby claim:

  • I am robbkidd on github.
  • I am robbkidd (https://keybase.io/robbkidd) on keybase.
  • I have a public key ASBXpoLJWxBHOr3gewFk_nMP6V68snMk8-Kk9vNKSVIRZwo

To claim this, I am signing this object:

web [2013-02-12T17:35:11+00:00] INFO: *** Chef 10.20.0 ***
web [2013-02-12T17:35:11+00:00] INFO: [inet6] no default interface, picking the first ipaddress
web [2013-02-12T17:35:11+00:00] INFO: Client key /etc/chef/client.pem is not present - registering
web [2013-02-12T17:35:12+00:00] INFO: HTTP Request Returned 404 Not Found: Cannot load node web
web [2013-02-12T17:35:12+00:00] INFO: Setting the run_list to ["role[chef-client]"] from JSON
web
web ================================================================================
web Error expanding the run_list:
web ================================================================================
web
@robbkidd
robbkidd / README.md
Last active December 11, 2015 00:19
Multiple NICs in a Vagrant machine

With this Vagrantfile, you will have a Vagrant VM with three NICs. Vagrant uses eth0 for NAT'ing the guest to the outside world. (I do not know a way to override this. Vagrant is very unhappy with eth0 being the NAT interface.) eth1 and eth2 will be on separate virtual subnets available only between the host and the guest.

@robbkidd
robbkidd / gist:3764326
Created September 21, 2012 22:37
Escaping things
#include <stdio.h>
#include <string>
#include <string.h>
int main() {
std::string str = "ab:cd:ef";
const char *psz = str.c_str();
for (;;)
{
@robbkidd
robbkidd / safe_rename.log
Created July 28, 2012 17:30
Renaming a Postgres sequence used by multiple tables.
testy=# CREATE SEQUENCE common_fruit_id_seq;
CREATE SEQUENCE
testy=#
testy=# CREATE TABLE apples (
testy(# id INT4 DEFAULT nextval('common_fruit_id_seq') NOT NULL,
testy(# price NUMERIC
testy(# );
CREATE TABLE
testy=#
testy=# CREATE TABLE oranges (
@robbkidd
robbkidd / check_table_and_sequence_names.rb
Created July 27, 2012 21:52
Quick method to display the names of your PostgreSQL tables and their pkeys and sequences.
def check_table_and_sequence_names
connection = ActiveRecord::Base.connection
if connection.adapter_name == "PostgreSQL"
table_names = connection.tables.keep_if { |t| t !~ /schema_migrations/ }
table_names.map { |t| [t, connection.pk_and_sequence_for(t)].flatten }
end
end
check_table_and_sequence_names
# => [["tablename", "primarykeyname", "sequencename"]]
@robbkidd
robbkidd / gist:1085842
Created July 16, 2011 00:35
Rubinius fails to run bundle
» ruby -v
rubinius 2.0.0dev (1.8.7 4b04a866 yyyy-mm-dd JI) [i686-pc-linux-gnu]
» gem install bundler
Fetching: bundler-1.0.15.gem (100%)
Successfully installed bundler-1.0.15
1 gem installed
Installing ri documentation for bundler-1.0.15...
Installing RDoc documentation for bundler-1.0.15...