Skip to content

Instantly share code, notes, and snippets.

View amccarty's full-sized avatar

Alan McCarty amccarty

View GitHub Profile
@amccarty
amccarty / application_controller.rb
Created July 14, 2016 20:23
Custom Ruby Logging
# app/controllers/application_controller.rb
# Add the following lines:
CUSTOM_LOGGER.info("info from custom logger")
CUSTOM_LOGGER.debug("debug from custom logger")
CUSTOM_LOGGER.error("error from custom logger")
@amccarty
amccarty / gist:1f73c6a1a00a5ef9daf0e39781e45e28
Created July 15, 2016 12:38
Allow CORS (cross-origin resource sharing) in apache
Header set Access-Control-Allow-Origin "*"
@amccarty
amccarty / gist:bacf645a576b5fa6f6b3dc6dd607665f
Created July 15, 2016 17:07 — forked from madis/gist:4650014
Testing CORS OPTIONS request with curl
curl \
--verbose \
--request OPTIONS \
http://localhost:3001/api/configuration/visitor \
--header 'Origin: http://localhost:9292' \
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \
--header 'Access-Control-Request-Method: GET'
# http://nils-blum-oeste.net/cors-api-with-oauth2-authentication-using-rails-and-angularjs/#.UQJeLkp4ZyE
@amccarty
amccarty / CORS config for jetty
Created July 15, 2016 17:09
CORS config for jetty
# /path/to/server/solr-webapp/webapp/WEB-INF/web.xml
<filter>
<filter-name>cross-origin</filter-name>
<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
<init-param>
<param-name>allowedOrigins</param-name>
<param-value>http://localhost*</param-value>
</init-param>
<init-param>
@amccarty
amccarty / gist:70d4a08efe34680235cf2a6822f2b885
Created July 18, 2016 19:38
Git refspec for a single branch's pull requests
# where 'dev' is the branch:
+refs/pull/*:refs/remotes/origin/pr/* +refs/heads/dev:refs/remotes/origin/dev
@amccarty
amccarty / config.txt
Created August 16, 2016 20:51
Configure solr 6.1 and external zookeeper ensemble
solr 6.1 and zookeeper
1. install solr via puppet
2. stop solr
3. install zookeeper
cd /cul/share
sudo wget http://apache.claz.org/zookeeper/stable/
zookeeper-3.4.8.tar.gz
@amccarty
amccarty / catalina.out
Created September 8, 2016 19:39
Fedora 4.5.1 parent/child issue
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Sep 08, 2016 3:38:25 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Sep 08, 2016 3:38:25 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 560 ms
Sep 08, 2016 3:38:25 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 08, 2016 3:38:25 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Sep 08, 2016 3:38:25 PM org.apache.catalina.startup.HostConfig deployWAR
@amccarty
amccarty / catalina.out
Created September 9, 2016 13:22
Fedora 4.5.1 parent/child issue (post DB repair attempt)
Sep 09, 2016 9:17:49 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Sep 09, 2016 9:17:49 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /cul/app/tomcat/sf-lib-dig-020.serverfarm.cornell.edu/webapps/fedora.war
Sep 09, 2016 9:18:00 AM org.apache.catalina.core.ApplicationContext log
INFO: Spring WebApplicationInitializers detected on classpath: [org.glassfish.jersey.server.spring.SpringWebApplicationInitializer@69e58aeb]
Sep 09, 2016 9:18:00 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
09:18:00.362 [localhost-startStop-1] INFO o.s.web.context.ContextLoader - Root WebApplicationContext: initialization started
09:18:00.447 [localhost-startStop-1] DEBUG o.s.w.c.s.StandardServletEnvironment - Adding [servletConfigInitParams] PropertySource with lowest search precedence
@amccarty
amccarty / catalina.out
Created September 27, 2016 19:35
FCRepo 4.5.1 Can't create transaction.log
INFO 19:20:06.525 (ModeShapeRepositoryFactoryBean) Using repo config (classpath): file:/cul/app/tomcat/aws-110-046.internal.library.cornell.edu/webapps/fedora/WEB-INF/classes/config/minimal-default/repository.json
INFO 19:20:06.533 (DefaultPropertiesLoader) Loading properties
INFO 19:20:06.534 (DefaultPropertiesLoader) com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.default.objectStoreDir = /cul/data/fedora/com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.default.objectStoreDir
INFO 19:20:06.534 (DefaultPropertiesLoader) com.arjuna.ats.arjuna.objectstore.objectStoreDir = /cul/data/fedora/com.arjuna.ats.arjuna.objectstore.objectStoreDir
INFO 19:20:06.534 (DefaultPropertiesLoader) fcrepo.ispn.cache = /cul/data/fedora/fcrepo.ispn.cache
INFO 19:20:06.534 (DefaultPropertiesLoader) fcrepo.ispn.binary.cache = /cul/data/fedora/fcrepo.ispn.binary.cache
INFO 19:20:06.534 (DefaultPropertiesLoader) fcrepo.binary.directory = /cul/data/fedora/fcrepo.binary.directory
INFO 19:20:06.535 (DefaultPropertiesLoader
@amccarty
amccarty / gist:2148ff269b3f62f1fcf0748ab9811f63
Created September 30, 2016 15:02
apache redirect http to https
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule !/status https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</IfModule>