Skip to content

Instantly share code, notes, and snippets.

View amccarty's full-sized avatar

Alan McCarty amccarty

View GitHub Profile
@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 / 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 / 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: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 / gist:1f73c6a1a00a5ef9daf0e39781e45e28
Created July 15, 2016 12:38
Allow CORS (cross-origin resource sharing) in apache
Header set Access-Control-Allow-Origin "*"
@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 / drop.sh
Created July 13, 2016 02:58
Drop ALL mongo DBs (no prompt, no backup, just go)
#!/bin/bash
mongo --quiet --eval 'db.getMongo().getDBNames().forEach(function(i){db.getSiblingDB(i).dropDatabase()})'
@amccarty
amccarty / gist:86aa3873d9baa40c7482
Created March 10, 2016 20:48
Amazon RDS uft8 encoding
aws rds create-db-parameter-group --db-parameter-group-name mysql-utf8 --db-parameter-group-family mysql5.6 --description "MySQL 5.6 configured for UTF-8"
aws rds modify-db-parameter-group --db-parameter-group-name mysql-utf8 \
--parameters="ParameterName=character_set_server, ParameterValue=utf8, ApplyMethod=immediate" \
--parameters="ParameterName=character_set_client, ParameterValue=utf8, ApplyMethod=immediate" \
--parameters="ParameterName=character_set_results, ParameterValue=utf8, ApplyMethod=immediate" \
--parameters="ParameterName=collation_server, ParameterValue=utf8_unicode_ci, ApplyMethod=immediate" \
--parameters="ParameterName=collation_connection, ParameterValue=utf8_unicode_ci, ApplyMethod=immediate"
# Apply to an existing instance (followed by a reboot):
@amccarty
amccarty / foo
Created November 24, 2015 01:26
foo
==> /opt/wakari/wakari-server/var/log/wakari/worker.log <==
20618 | 2015-11-23 20:24:42.388 ERROR: Job 5653bbe1dbe4b150364da2d8 exited with exception:
Job Log:
| Starting Job 5653bbe1dbe4b150364da2d8
| Created Provisioner: Provisioner
| * Actor: wakari
| * Owner: wakari
| * Project: PDT2
| Posting data to u'http://10.250.19.114:8080/api/start-project'
BRAND: Anaconda Server
CDN: /static
LDAP:
BIND_AUTH: password
BIND_DN: cn=Manager,dc=testcio,dc=com
OPTIONS: {OPT_X_TLS_CERTFILE: /etc/ssl/certs/openldap.testcio.com.crt, OPT_X_TLS_DEMAND: true,
OPT_X_TLS_NEVER: true}
URI: ldaps://openldap.testcio.com
USER_SEARCH: {base: 'dc=testcio,dc=com', filter: uid=%(username)s}
LOGGING: