Skip to content

Instantly share code, notes, and snippets.

View rnhurt's full-sized avatar

Richard Hurt rnhurt

View GitHub Profile
/var/lib/gems/1.9.1/gems/crack-0.1.8/lib/crack/xml.rb:53: [BUG] Segmentation fault
ruby 1.9.1p378 (2010-01-10 revision 26273) [i486-linux]
-- control frame ----------
c:0067 p:0029 s:0280 b:0279 l:002380 d:002380 METHOD /var/lib/gems/1.9.1/gems/crack-0.1.8/lib/crack/xml.rb:53
c:0066 p:---- s:0273 b:0273 l:000272 d:000272 FINISH
c:0065 p:---- s:0271 b:0271 l:000270 d:000270 CFUNC :new
c:0064 p:0188 s:0266 b:0265 l:000264 d:000264 METHOD /var/lib/gems/1.9.1/gems/crack-0.1.8/lib/crack/xml.rb:201
c:0063 p:0026 s:0257 b:0257 l:000256 d:000256 METHOD /var/lib/gems/1.9.1/gems/httparty-0.6.1/lib/httparty/parser.rb:112
c:0062 p:0018 s:0254 b:0254 l:000253 d:000253 METHOD /var/lib/gems/1.9.1/gems/httparty-0.6.1/lib/httparty/parser.rb:136
Picking up proper coding practices that promote maintainability,
security, simplicity, resiliency, etc. in any language requires time and experience
Incomplete documentation
User-provided comments in the online documentation are frequently inaccurate. Arguably, this actually hinders one's ability to learn how to write proper PHP
encourages the mixing of business logic, database calls and presentation code.
inconsistent naming of functions
@rnhurt
rnhurt / dynamodb.rake
Created October 29, 2012 16:32
Rake task to manage DynamoDB tables
namespace :dynamodb do
desc "Create DynamoDB tables"
task :create => :environment do
puts "Creating tables in the #{Rails.env} environment..."
Rails.application.eager_load! # Force the loading of modules
prefix = AWS::Record.table_prefix # Table name prefix
tables = AWS::DynamoDB.new.tables # Create an AWS connection
@rnhurt
rnhurt / OpsWorks Example
Last active August 29, 2015 14:04
(Ab)using Chef in AWS OpsWorks.
# this will include the standard OpsWorks 'deploy' recipe
include_recipe 'deploy'
# now you can do things like this
node[:deploy].each do |application, deploy|
deploy = node[:deploy][application]
package "GraphicsMagick" do
action :install
options "-y"
@rnhurt
rnhurt / keybase.md
Created September 15, 2014 18:33
Keybase proof

Keybase proof

I hereby claim:

  • I am rnhurt on github.
  • I am rnhurt (https://keybase.io/rnhurt) on keybase.
  • I have a public key whose fingerprint is EA31 9067 B93B 8703 9402 A5A1 013F 8C4C 2A7B 4F03

To claim this, I am signing this object:

@rnhurt
rnhurt / gist:d0966fbb2e54b0464534
Last active August 29, 2015 14:16
AWS CloudFormation sample
"Size" : {
"Fn::If" : [
"CreateLargeSize",
{"Ref" : "100"},
{"Ref" : "10"}
]}
@rnhurt
rnhurt / gist:fc9bc796c22a4414c736
Created March 30, 2015 14:01
Jenkins Windows Slave Error
<===[JENKINS REMOTING CAPACITY]===>Slave.jar version: 2.50
This is a Windows slave
Slave successfully connected and online
ERROR: Connection terminated
java.io.IOException: Connection aborted: org.jenkinsci.remoting.nio.NioChannelHub$MonoNioTransport@168daa85[name=Windows]
at org.jenkinsci.remoting.nio.NioChannelHub$NioTransport.abort(NioChannelHub.java:208)
at org.jenkinsci.remoting.nio.NioChannelHub.run(NioChannelHub.java:628)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
@rnhurt
rnhurt / global.json
Last active August 29, 2015 14:18
Cloud Formation Templates
{
"IPAddresses": {
"Home" : ["1.2.3.4/32"],
"Home" : ["5.6.7.8/32"]
},
"Regions" : [
{
"Id" : "us-east-1",
"Name" : "USEast1",
@rnhurt
rnhurt / stage.hbs
Last active August 29, 2015 14:18
Cloud Formation Templates
"EnvType" : "stage",
"EnvRegions" : [
{
"Id" : "us-east-1",
"Name" : "USEast1",
"VPCId" : "vpc-456qwe",
"CacheSubnetGroupName" : "vpc-s-1"
},
{
@rnhurt
rnhurt / base-instance.hbs
Created April 3, 2015 02:26
Cloud Formation Templates
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Project: {{ProjectName}}.",
"Mappings" : {
{{#each Mappings}}{{{this}}}
{{/each}}
},
"Conditions" : {