Skip to content

Instantly share code, notes, and snippets.

View shorock's full-sized avatar

Tom Shorock shorock

View GitHub Profile
@shorock
shorock / sample.sh
Last active January 5, 2019 02:23
drush and jq hack
#!/bin/bash
# Danger, if you don't do this and 'drush status' fails for some other reason, the pipeline exits 0
# and thus tries to site-install again
set -o pipelinefail
is_drupal_installed() {
cd /app/web
drush status --pipe | jq -e '.bootstrap == "Successful"' > /dev/null
}
@shorock
shorock / gist:f71a6bc39b30d20d53cf223c76df7f59
Created October 5, 2017 15:58
Working with Curl/JQ extract from Solr
curl -g "localhost:8983/solr/statistics/select?q=time:[2017-09-01T00:00:00Z+TO+2017-10-01T00:00:00Z]&sort=time+asc&rows=10000&start=30000&wt=json" | jq '.response | [.docs[]|del(._version_)] ' | nice gzip -c > september3.json.gz
@shorock
shorock / clear_version.sh
Created March 23, 2017 21:57
Cut out the _version_ column in solr dumps
for f in `ls *csv`
do
mv $f "$f.bak"
csvcut -C _version_ "$f.bak" > $f
rm "$f.bak"
done
@shorock
shorock / as-debug.patch
Created February 22, 2017 05:02
Fiddling with ArchivesSpace using RubyMine debugger
diff --git a/build/build.xml b/build/build.xml
index 4a10c9b..4cb131e 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -326,7 +326,7 @@
<env key="GEM_PATH" value="" />
<env key="BUNDLE_PATH" value="${gem_home}" />
<env key="ASPACE_INTEGRATION" value="${aspace.integration}" />
- <arg line="--1.9 script/rails s Puma --port=${aspace.frontend.port}" />
+ <arg line="--1.9 /home/tom/.rvm/gems/jruby-1.7.22@as/bin/rdebug-ide --rubymine-protocol-extensions --host 0.0.0.0 --port 1234 -- script/rails s Puma --port=${aspace.frontend.port}" />

Keybase proof

I hereby claim:

  • I am shorock on github.
  • I am tshorock (https://keybase.io/tshorock) on keybase.
  • I have a public key whose fingerprint is EA22 AA62 F415 6157 A08D 613F 24C2 BA3D E99B 4BAC

To claim this, I am signing this object: