Skip to content

Instantly share code, notes, and snippets.

View scotdalton's full-sized avatar

Scot Dalton scotdalton

  • Updater
  • New York
View GitHub Profile
@scotdalton
scotdalton / docker.cloud.issue.md
Created August 17, 2017 20:41
Docker Cloud Issue

In Container Linux, Docker Cloud has problems reconnecting to "bring your own Swarms" (BYOS) when Swarm managers restart. The issue seems have something to do with the dockercloud/server-proxy container running on each manager.

A Docker Cloud shows that the Swarm is "unreachable":

UNREACHABLE The swarm is sending heartbeat pings and Docker Cloud is receiving them, but Cloud cannot connect to the swarm.

Things we know (that may or may not be important):

describe 'Route', ->
beforeEach ->
localComponent = "Local Component"
remoteUrl = new URL("http://remote.url")
@localRoute = new Route "/local", component
@remoteRoute = new Route "/remote", remoteUrl
describe 'name', ->
it 'should be the name', ->
expect(@localRoute.name).toEqual "/local"
@scotdalton
scotdalton / awdl_from_aleph.rb
Created September 10, 2014 18:03
Quick and Dirty Script for Getting MARC data from a Primo Search for the AWDL
require 'exlibris-nyu'
# Arbitrarily large page size
page_size = 500
searcher = Exlibris::Primo::Search.new.any_is('AWDL').add_local_location('GEN').
add_local_location('NYU').page_size!(page_size)
# Raise an error if page_size < searcher.size
records = searcher.records
aleph_api_id_hashes = records.collect { |record| record.ilsapiids }
aleph_api_ids = aleph_api_id_hashes.collect do |aleph_api_id_hash|
aleph_api_id_hash.values
<script>
<!--
var debug =0 ;
function LoginPds() {
var institute = "$0200";
if (institute == "") {
institute = "NYU";
}
COLLECTION_MAP = {
"ESRI" => ->(nyucore){
["ESRI"].any do |publisher|
nyucore.publisher.include[publisher]
end.present?
},
"Spatial Data Repository" => ->(nyucore){ nyucore.type == "Geospatial Data" }
}
@collections ||= COLLECTION_MAP.select do |key, matcher|
<holdings>
<holding href="http://alephstage.library.nyu.edu:1891/rest-dlf/record/NYU01002894709/holdings/NYU60000423660">
<leader> cyH a22001695 4500</leader>
<controlfield tag="001">000423660</controlfield>
<controlfield tag="004">NYUb10613845</controlfield>
<controlfield tag="005">20080531115342.0</controlfield>
<controlfield tag="007">hd</controlfield>
<controlfield tag="008">0102210|||||8 |001|||||001022</controlfield>
<datafield tag="010" ind1=" " ind2=" ">
<subfield code="a">cn 76308959</subfield>
module Ichabod
module Datasource
class Base
def self.editable_attr(*editable_attributes)
editable_attributes.each do |editable_attribute|
validate! editable_attribute
...
end
end
@scotdalton
scotdalton / environment.rb
Last active August 29, 2015 14:00
Load scaling_strategy objects in config/environment.rb
# Require all files in lib and its subdirs
Dir["lib/**/*.rb", "app/scaling_strategy/**/*.rb"].each do |path|
require File.join(Rails.root, path)
end
{ simulation:
{ simulation_name: 'mysim',
request_frequency_generator: ['constant', 40],
request_time_generator: ['constant', 40],
num_nodes_in_cluster: 1
}
}
Feature: request options for a Copy in Library
In order to select the appropriate choice
As a user requesting a Copy in Library
I want to see my options
@checked_out
Scenario: A user with request permissions viewing options for a "checked out" holding
Given I am on the GetIt page for a "checked out" holding
And I login as user with request permissions
And I click the request button