Skip to content

Instantly share code, notes, and snippets.

@yulgit1
yulgit1 / gist:abcdfc930004e29bb4c3
Last active August 29, 2015 14:21
mvn:run fcrepo4
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/ermadmix/intellij/fcrepo4/fcrepo-webapp -Xmx512m -Dmaven.home=/Users/ermadmix/Applications/apache-maven-3.3.1 -Dclassworlds.conf=/Users/ermadmix/Applications/apache-maven-3.3.1/bin/m2.conf -Didea.launcher.port=7532 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 14.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Users/ermadmix/Applications/apache-maven-3.3.1/boot/plexus-classworlds-2.5.2.jar:/Applications/IntelliJ IDEA 14.app/Contents/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=14.0.3 jetty:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Fedora Repository Deployable Web Application 4.1.2-SNAPSHOT
[INFO] ------------------------------------------------------
@yulgit1
yulgit1 / gist:8058a23404265f5695bd
Last active August 29, 2015 14:21
logging prod slowness
USERSESSION:QDMu5Qd3dh9wMUpE-oyrxGSoZgk
add/refresh session_id for cas/aeon user
CURRENT_USER:#<User id: 8088449, email: "[email protected]", encrypted_password: "$2a$10$IHy/eubsyENUJTISqNJ57ehHeYP9xUVllVaTy7t3F1iB...", res
et_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 64, current_sign_in_at: "2015-05-19 14:34:26", last_sig
n_in_at: "2015-05-19 14:16:01", current_sign_in_ip: "130.132.80.210", last_sign_in_ip: "130.132.80.210", created_at: "2015-03-26 17:45:59", updated_a
t: "2015-05-19 14:34:27", guest: false, session_id: "7xMBUGA0JsHM2poabji3s6QH8qo">
Rendered catalog/_facet_limit.html.erb (2.3ms)
Rendered catalog/_facet_limit.html.erb (3.6ms)
Rendered catalog/_facet_limit.html.erb (1.5ms)
Rendered catalog/_facets.html.erb (10.3ms)
@yulgit1
yulgit1 / gist:a9e435d1bbdb00caa501
Created July 2, 2015 16:01
too large solr query (500) idconverter
[INFO] [talledLocalContainer] 2015-07-02 11:59:30,273 | DEBUG | TransformService | transform >> solr call: http://diego2.library.yale.edu:8083/solr/collection1/select?q=loc_rec_num_ssim%3A%22ms.mssa.1981%2Fref12925%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref549%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref55%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref550%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref551%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref552%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref553%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref554%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref555%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref556%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref557%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref558%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref559%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref56%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref560%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref561%22+OR+loc_rec_num_ssim%3A%22mssa.ms.2004%2Fref562%22+OR+loc_
self.solr_search_params_logic = [:default_solr_parameters , :add_query_to_solr, :add_filter_conditions, :add_search_within, :add_facet_fq_to_solr, :add_facetting_to_solr, :add_solr_fields_to_query, :add_paging_to_solr, :add_sorting_to_solr ]
@yulgit1
yulgit1 / gist:5f72f160183cdda2337f
Created September 6, 2015 23:37
application_controller_spec
[ermadmix@libdev controllers]$ more application_controller_spec.rb
require 'spec_helper'
describe ApplicationController do
describe "accessing ip_whitelist.yml" do
it "should have a number of ip addresses" do
ip_whitelist = YAML.load_file(Rails.root.join('spec','templates','ip_whitelist.yml'))
ips = ip_whitelist.fetch("whitelist")
expect(ips.size).to equal(3)
end
end
5305:E, [2015-10-15T17:25:24.877999 #12914] ERROR -- : GenericFilesController::create rescued Ldp::BadRequest
5585:E, [2015-10-15T17:25:48.683189 #13223] ERROR -- : Error extracting content from 8623hx72q: #<Net::HTTPBadResponse: wrong status line: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">">
[ermadmix@scholarsphere1 log]$ more +5305 production.log
E, [2015-10-15T17:25:24.877999 #12914] ERROR -- : GenericFilesController::create rescued Ldp::BadRequest
87a0a8c317f1e7mode:namespaces-info:fedora/fedora-system:def/model#
/usr/local/rvm/gems/ruby-2.2.0@sufia/gems/ldp-0.4.1/lib/ldp/client/methods.rb:121:in `block in check_for_errors'
/usr/local/rvm/gems/ruby-2.2.0@sufia/gems/ldp-0.4.1/lib/ldp/client/methods.rb:119:in `tap'
/usr/local/rvm/gems/ruby-2.2.0@sufia/gems/ldp-0.4.1/lib/ldp/client/methods.rb:119:in `check_for_errors'
/usr/local/rvm/gems/ruby-2.2.0@sufia/gems/ldp-0.4.1/lib/ldp/client/methods.rb:98:in `block in put'
/usr/local/rvm/gems/ruby-2.2.0@sufia/gems/activesupport-4.2.3/lib/active_s
@yulgit1
yulgit1 / gist:151a6ca464f7056d80c1
Last active October 29, 2015 21:29
omniauth callback
Started GET "/users/auth/sso/callback?code=b407a47b786b02747f8cfad08cb87d8f&session_state=3iuCC0yr7yfq4UAPgCINNZu0vMHJD-KZ4GHLTCO8P0Y.6dc1802c68615bbf965506b4dce83d65" for 130.132.80.210 at 2015-10-29 10:47:23 -0400
Cannot render console from 130.132.80.210! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
I, [2015-10-29T10:47:23.152827 #31434] INFO -- omniauth: (sso) Callback phase initiated.
AbstractController::ActionNotFound (The action 'sso' could not be found for Devise::OmniauthCallbacksController):
actionpack (4.2.3) lib/abstract_controller/base.rb:132:in `process'
actionview (4.2.3) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.3) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.3) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.3) lib/action_controller/metal.rb:237:in `block in action'
[ermadmix@libdev4 geo_concerns]$ RUN_AT_EXIT_HOOKS=true TERM_CHILD=1 QUEUE=* rake environment resque:work
rake aborted!
NameError: uninitialized constant CurationConcerns::GenericFileBehavior
/home/ermadmix/geo_concerns/geo_concerns/app/models/concerns/external_metadata_file_behavior.rb:5:in `<module:ExternalMetadataFileBehavior>'
/home/ermadmix/geo_concerns/geo_concerns/app/models/concerns/external_metadata_file_behavior.rb:2:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.2.1@pcdm-geo-models/gems/railties-4.2.3/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'
/usr/local/rvm/gems/ruby-2.2.1@pcdm-geo-models/gems/railties-4.2.3/lib/rails/engine.rb:471:in `each'
/usr/local/rvm/gems/ruby-2.2.1@pcdm-geo-models/gems/railties-4.2.3/lib/rails/engine.rb:471:in `block in eager_load!'
/usr/local/rvm/gems/ruby-2.2.1@pcdm-geo-models/gems/railties-4.2.3/lib/rails/engine.rb:469:in `each'
/usr/local/rvm/gems/ruby-2.2.1@pcdm-geo-models/gems/railties-4.2.3/lib/rails/engine.rb:469:in `eager_load!'
@yulgit1
yulgit1 / gist:429f504b38e515d2725a
Last active November 17, 2015 21:03
undo commit and rebase
git checkout extract-metadata2
git reset --hard HEAD^
git checkout master
git pull <upstream> master
git checkout extract-metadata2
git rebase master
<fix conflicts> if any
git push --force <origin>
where
[ermadmix@libdev search-frontend]$ rake db:migrate
Warning: NLS_LANG is not set. fallback to US7ASCII.
== UndoServices: migrating ===================================================
-- add_column(:services, :uid, :string)
-> 0.0030s
-- remove_column(:services, :subject_id, :string)
-> 0.4165s
-- remove_column(:services, :preferred_username, :string)
-> 0.0367s
== UndoServices: migrated (0.4571s) ==========================================