Skip to content

Instantly share code, notes, and snippets.

View ulfmagnetics's full-sized avatar

John Berry ulfmagnetics

  • Ulf Magnetics, LLC
  • Pittsburgh, PA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ulfmagnetics on github.
  • I am ulfmagnetics (https://keybase.io/ulfmagnetics) on keybase.
  • I have a public key ASBp4wbMU93Cej08iLp2Bema7ptmIuw3a-YTv0n6-Vzr4Qo

To claim this, I am signing this object:

@ulfmagnetics
ulfmagnetics / input.yml
Created June 11, 2013 18:27
The Smartling API does not accept the string 'other' as a section header. It strips the header out altogether, breaking i18n for strings in that section (and sometimes resulting in an unparseable file.)
en:
other:
bar: Baz
@ulfmagnetics
ulfmagnetics / output.log
Created May 16, 2013 05:53
new error on bpt staging
Started POST "/sections/32/results" for 98.210.196.162 at 2013-05-15 22:52:42 -0700
Processing by TestResultsController#create as */*
Parameters: {"results"=>{"error_count"=>"0", "data"=>{"version"=>"ef418dcf1c7d032fd08e5b4b2d95837ff5bef9cf"}, "score"=>"3", "datumArray"=>{"0"=>{"unit"=>"problems", "name"=>"Correct", "value"=>"3"}, "1"=>{"unit"=>"problems", "name"=>"Incorrect", "value"=>"0"}}}, "id"=>"32"}
TestRun Load (0.4ms) SELECT `test_runs`.* FROM `test_runs` WHERE `test_runs`.`id` = 34337 LIMIT 1
BrainpowerTest Load (0.2ms) SELECT `brainpower_tests`.* FROM `brainpower_tests` WHERE `brainpower_tests`.`id` = 4 LIMIT 1
TestStyle Load (0.2ms) SELECT `test_styles`.* FROM `test_styles` WHERE `test_styles`.`id` = 1 LIMIT 1
TestSection Load (0.3ms) SELECT `test_sections`.* FROM `test_sections` WHERE `test_sections`.`swf` IN ('wordy_equations_v2', 'span_board_v2', 'reaction_v2', 'dva_v2', 'grammatical_reasoning_v2', 'signup')
(0.1ms) BEGIN
CACHE (0.0ms) SELECT `test_runs`.* FROM `test_runs` W
@ulfmagnetics
ulfmagnetics / gist:4162753
Created November 28, 2012 17:35
node platform_version in chef
chef > node.platform_version =~ /^5/
=> 0
chef > node.platform_version =~ /^6/
=> nil
chef > node.platform_version =~ /^5/
=> 0
chef > node.platform_version
=> "5.8"
chef > node.platform_version.to_i
=> 5
traceroute to rpm.newrelic.com (204.93.223.152), 64 hops max, 52 byte packets
1 10.11.0.1 (10.11.0.1) 0.362 ms 0.190 ms 0.194 ms
2 216.55.29.109 (216.55.29.109) 3.281 ms 3.105 ms 3.384 ms
3 vb1500.rar3.sanjose-ca.us.xo.net (216.156.0.137) 8.630 ms 13.762 ms 11.913 ms
4 * 207.88.14.226.ptr.us.xo.net (207.88.14.226) 8.806 ms 7.084 ms
5 te4-2-10g.ar2.sjc2.gblx.net (64.208.110.113) 316.247 ms 126.434 ms 319.060 ms
6 * * *
7 * * *
@ulfmagnetics
ulfmagnetics / copy_ebs_ami.bash
Created March 16, 2012 00:30
Copy an EC2 EBS AMI from us-west-1 to us-east-1
#!/bin/bash
# Copied in its entirety from instructions by Eric Hammond (@esh) at http://alestic.com/2010/10/ec2-ami-copy
# Thanks for a very useful post!
# Some additional notes for myself:
# - Be sure to configure the target instance's firewall to allow port 22 access from the source_ip (or from 0.0.0.0/0)
# - Be sure that ssh-agent is running and that the identity file for the imported keypair has been added to it with ssh-add
# -----------
@ulfmagnetics
ulfmagnetics / pinger.rb
Created March 15, 2012 06:32
Simple site pinging script in ruby
URL = "http://www.lumosity.com"
MATCH_STRING = "Start Training"
INTERVAL = 30
DEBUG = false
def log(msg)
puts "[#{Time.now}] #{msg}"
end
def log_response(response)
@ulfmagnetics
ulfmagnetics / gist:2040692
Created March 15, 2012 00:27
Chef on EC2
# -- assuming homebrew is up and running already
$ brew install ec2-api-tools
# -- get root X509 credentials from the AWS Security Credentials page
# -- place pk and cert pem files in $HOME/.ec2
# -- add the following into $HOME/.bash_profile:
# export REGION='us-west-1'
# export EC2_KEYPAIR="$HOME/.ssh/ec2-$REGION.pem"
@ulfmagnetics
ulfmagnetics / joyent-smartos.erb
Created February 6, 2012 18:42 — forked from benjaminws/joyent-smartos.erb
joyent-smartos.erb
# shove this in ~/.chef/bootstrap/joyent-smartos.erb
# run knife bootstrap <hostname> -d joyent-smartos
bash -c '
if [ ! -f /opt/local/bin/chef-client ]; then
cd /tmp
pkgin -y install gcc-compiler gcc-runtime gcc-tools-0 ruby19 scmgit-base scmgit-docs gmake
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz
tar -xzf rubygems-1.8.10.tgz
cd rubygems-1.8.10