Skip to content

Instantly share code, notes, and snippets.

Robb Kidd robbkidd

Block or report user

Report or block robbkidd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@robbkidd
robbkidd / 1_plan.sh
Last active Sep 21, 2016
mapcrafter Habitat package
View 1_plan.sh
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
View keybase.md

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:

@robbkidd
robbkidd / 01_direnv_path_to_bliss.md
Last active Nov 16, 2016
Use `direnv` to control your environments.
View 01_direnv_path_to_bliss.md

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 / blargle.rb
Created Dec 11, 2014
RSpec in Your Ruby
View blargle.rb
require 'rspec'
class HiThere
def blarg
"hi there"
end
end
describe HiThere do
it 'says hi' do
@robbkidd
robbkidd / gist:12f4ddfc8007529a9b84
Created Dec 10, 2014
Ugly Way to Get Chef to Install an RPM from a URL
View gist:12f4ddfc8007529a9b84
where_the_cool_packages_at = {}
where_the_cool_packages_at << { :package => "awesomeness.rpm", # this will be used as the downloaded filename
:url => "https://awesomesauce.example.com/download/this/awesomeness.rpm" # where to get it
}
where_the_cool_packages_at << { :package => "otherthing.rpm",
:url => "https://someotherthing.example.com/download/the/otherthing.rpm"
}
where_the_cool_packages_at.each do |package, url|
# download the thing from `url` and put it in Chef's file cache
View chef-client.log
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 Dec 11, 2015
Multiple NICs in a Vagrant machine
View README.md

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.

View gist:3764326
#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 Jul 28, 2012
Renaming a Postgres sequence used by multiple tables.
View safe_rename.log
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 Jul 27, 2012
Quick method to display the names of your PostgreSQL tables and their pkeys and sequences.
View check_table_and_sequence_names.rb
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"]]
You can’t perform that action at this time.