Skip to content

Instantly share code, notes, and snippets.

View mcallaway's full-sized avatar

Matt Callaway mcallaway

  • Bayer Crop Science
  • Saint Louis
View GitHub Profile
@mcallaway
mcallaway / gist:356b72e8cae8abde0508
Last active August 29, 2015 14:07
Modifying to_yaml for hash
class Hash
# Replacing the to_yaml function so it'll serialize hashes sorted (by their keys)
# Original function is in /usr/lib/ruby/1.8/yaml/rubytypes.rb
def to_yaml( opts = {} )
YAML::quick_emit( object_id, opts ) do |out|
out.map( taguri, to_yaml_style ) do |map|
sort.each do |k, v| # <-- here's my addition (the 'sort')
map.add( k, v )
end
end
@mcallaway
mcallaway / gist:8d10ff88c6aa0e234edb
Created February 12, 2015 17:23
etcd failing to come back up after reboot
Feb 12 16:12:49 apipe-deis1.gsc.wustl.edu systemd[1]: Started etcd.
Feb 12 16:12:49 apipe-deis1.gsc.wustl.edu etcd[1373]: [etcd] Feb 12 16:12:49.123 INFO | Discovery via https://discovery.etcd.io using prefix /62775a30e41136ff07cb712c310ba30d.
Feb 12 16:12:49 apipe-deis1.gsc.wustl.edu etcd[1373]: [etcd] Feb 12 16:12:49.509 INFO | Discovery found peers [http://10.0.28.53:7001 http://10.0.28.57:7001 http://10.0.28.54:7001 http://10.0.28.55:7001 http://10.0.28.57:7001 http://10.0.28.54:7001 http://10.0.28.55:7001 http://10.0.28.56:7001 http://10.0.28.55:7001 http://10.0.28.56:7001 http://10.0.28.57:7001 http://10.0.28.53:7001 http://10.0.28.54:7001 http://10.0.28.56:7001]
Feb 12 16:12:49 apipe-deis1.gsc.wustl.edu etcd[1373]: [etcd] Feb 12 16:12:49.509 INFO | Discovery fetched back peer list: [10.0.28.53:7001 10.0.28.57:7001 10.0.28.54:7001 10.0.28.55:7001 10.0.28.57:7001 10.0.28.54:7001 10.0.28.55:7001 10.0.28.56:7001 10.0.28.55:7001 10.0.28.56:7001 10.0.28.57:7001 10.0.28.53:7001 10.0.28.54:7001
@mcallaway
mcallaway / gist:55d8b01f68db086424cc
Created February 12, 2015 17:24
storage fails to come up? race?
Feb 12 17:00:35 apipe-deis1.gsc.wustl.edu systemd[1]: deis-store-daemon.service: main process exited, code=exited, status=1/FAILURE
Feb 12 17:00:35 apipe-deis1.gsc.wustl.edu dockerd[946]: time="2015-02-12T17:00:35Z" level="info" msg="GET /v1.16/containers/e250e431cb8acf4d79b316721320832ce0df4860f4c51ada3423da02f03773d0/json"
Feb 12 17:00:35 apipe-deis1.gsc.wustl.edu dockerd[946]: time="2015-02-12T17:00:35Z" level="info" msg="+job container_inspect(e250e431cb8acf4d79b316721320832ce0df4860f4c51ada3423da02f03773d0)"
Feb 12 17:00:35 apipe-deis1.gsc.wustl.edu dockerd[946]: time="2015-02-12T17:00:35Z" level="info" msg="-job container_inspect(e250e431cb8acf4d79b316721320832ce0df4860f4c51ada3423da02f03773d0) = OK (0)"
Feb 12 17:00:35 apipe-deis1.gsc.wustl.edu dockerd[946]: time="2015-02-12T17:00:35Z" level="info" msg="DELETE /v1.16/containers/e250e431cb8acf4d79b316721320832ce0df4860f4c51ada3423da02f03773d0?v=1"
Feb 12 17:00:35 apipe-deis1.gsc.wustl.edu dockerd[946]: time="2015-02-12T17:00:35Z" level="info" msg="+job
@mcallaway
mcallaway / gist:72db68a130fe49b02418
Created March 3, 2015 18:11
packagelock provider
Puppet::Type.type(:packagelock).provide(:yum) do
desc "YUM package locking support; uses the versionlock plugin.
This plugin should be installed and enabled for this to work.
RHEL5 and derivatives have a very sparse version of the plugin
without the 'versionlock' subcommand, requiring us to edit
the versionlock.list file directly."
LOCKCONF = '/etc/yum/pluginconf.d/versionlock.conf'
LOCKLIST = '/etc/yum/pluginconf.d/versionlock.list'
@mcallaway
mcallaway / gist:4fe969aace75c11735ea
Created March 3, 2015 18:13
type definition for packagelock (trial)
Puppet::Type.newtype(:packagelock) do
desc <<-EOT
Lock a package to the specific version installed. This resource
type supplements the package resource type, to lock a package
to the version that is installed with the corresponding package
resource.
# DO NOT autorequire, we want the ability to lock *before* the package.
#
@mcallaway
mcallaway / gist:f21068454a959b798806
Created April 13, 2015 16:01
joinx fails to build on trusty
mcallawa@mcallawa-trusty:~/git/joinx/build$ make
Scanning dependencies of target boost-1.56
[ 0%] Creating directories for 'boost-1.56'
[ 1%] Performing download step (DIR copy) for 'boost-1.56'
[ 1%] No patch step for 'boost-1.56'
[ 2%] No update step for 'boost-1.56'
[ 3%] Performing configure step for 'boost-1.56'
Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
Detecting Python version... 2.7
Detecting Python root... /usr
```
... more ...
2015-04-13 13:26:10-0500 mcallawa-trusty: 2015/04/13 13:26:10 Genome::InstrumentData::AlignmentResult::Bwa id(TEST: >>tojaeyah5.10-929ec81<< bwa 0.5.9 [-t 4 -q 5::] on 6173R/4-TAGCTT (2851949190) for H_HY-03023 (2725316319) against NCBI-human-build36 (101947881) (88399148E20A11E49DE785073F0CD76F)): Oh no! Caught an exception while in the critical point where the BAM pipe was open: Failed to generate intermediate result!ERROR RUNNING COMMAND. Exit code 1 from: /opt/plenv/.plenv/versions/5.10.1/bin/perl5.10.1 -I /gscuser/mcallawa/git/genome/lib/perl/Genome/Site/TGI/SiteLib -e 'use above "Genome"; Genome::InstrumentData::IntermediateAlignmentResult->get_or_create(aligner_index_id => "f3df7303bda74e638982fedfc0774226", aligner_name => "bwa", aligner_params => "-t1 -q 5", aligner_version => "0.5.9", flagstat_file => "", input_file => "/tmp/211.tmpdir/gm-genome_sys-2015-04-13_13_26_02--k5f4/anonymous0/2851949190-sanger-fastq-0.fastq", input_pass => "1", instrument_data_id => "2851949190", instrum
@mcallaway
mcallaway / gist:3820057
Created October 2, 2012 15:21
rspec failing on puppetlabs-stdlib
here's bundle exec gem list:
bundler (1.2.1)
diff-lcs (1.1.3)
facter (1.6.12)
metaclass (0.0.1)
mocha (0.10.5)
puppet (2.7.19)
puppet-lint (0.3.1)
puppetlabs_spec_helper (0.3.0)
1 #!/usr/bin/env ruby
2
3 require 'rubygems'
4 require 'ruote'
5 require 'ruote/storage/fs_storage'
6 require 'amqp'
7 require 'ruote-amqp'
8
9 AMQP.settings[:user] = 'guest'
10 AMQP.settings[:pass] = 'guest'
{ "definition": "Ruote.process_definition :name => 'lol really?' do\nconcurrence do\ngrid_submit :command => '/bin/sleep', :arg => ['20']\nend\ngrid_submit :command => '/bin/sleep', :arg => ['20']\nend\n", "variables": "", "fields":""}