Skip to content

Instantly share code, notes, and snippets.

🏡
Staying home

Chris Adams acdha

🏡
Staying home
View GitHub Profile
@acdha
acdha / optimize-solr
Last active Feb 27, 2016
Crude but effective cron watchdog for Apache Solr
View optimize-solr
#!/bin/bash
set -eu
exec >/dev/null
sleep $((120 + ($RANDOM % 1800)))
curl -s http://localhost:8986/solr/{ar,en,es,fr,pt,ru,zh}/update -H 'Content-Type: text/xml' --data-binary '<commit waitSearcher="true"/>'
curl -s http://localhost:8986/solr/{ar,en,es,fr,pt,ru,zh}/update -H "Content-Type: text/xml" --data-binary '<optimize/>'
@acdha
acdha / check-akamai-status.js
Last active Feb 12, 2017
Load a page using PhantomJS and log Akamai CDN cache diagnostic information for every requested resource
View check-akamai-status.js
#!/usr/bin/env phantomjs --disk-cache=false
/*
Load one or more URLs requesting Akamai CDN diagnostic information for every resource
and list resources which are configured not to be cached:
phantomjs check-akamai-status.js https://www.microsoft.com/ http://www.state.gov https://www.wdl.org/en/
Additional timing information will be displayed to easily distinguish between requests
made before DOMContentLoaded or the full load event.
*/
@acdha
acdha / rewrite-wdl-links.sh
Last active Jan 15, 2016
🔒 Use pywikibot replace.py to rewrite WDL.org links to use HTTPS
View rewrite-wdl-links.sh
@acdha
acdha / WDL links on Wikipedia which are HTTPS ready
Last active Jan 13, 2016
Links to wdl.org from the top 36 Wikipedia properties
View WDL links on Wikipedia which are HTTPS ready
@acdha
acdha / iiif-ar.po
Last active Dec 18, 2015
Translations for “IIIF Manifest” used on www.wdl.org contributed back to the IIIF community
View iiif-ar.po
"POT-Creation-Date: 2015-12-09 15:27+0000\n"
"PO-Revision-Date: 2015-11-26 00:54+0000\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
msgid "IIIF Manifest"
View argparse-test.py
#!/usr/bin/env python3
# encoding: utf-8
"""Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
@acdha
acdha / gist:fcf02c1c6adb127ba557
Created Nov 27, 2015
Dropbox 3.10.11 crash on OS X 10.11.1 while importing device photos
View gist:fcf02c1c6adb127ba557
11/27/15 1:22:46.215 PM Dropbox[26351]: Dropbox(26351,0xa3778000) malloc: *** mach_vm_map(size=4198400) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
11/27/15 1:22:46.253 PM Dropbox[26351]: 70 Dropbox 0x00001868 start + 40
69 Dropbox 0x0000193d start + 253
68 Dropbox 0x00002093 main + 1427
67 Dropbox 0x00004264 main + 10084
66 Python 0x046db158 PyRun_SimpleFile + 40
65 Python 0x046d9753 PyRun_SimpleFileExFlags + 755
64 Python 0x046b2ee7 PyEval_EvalCode + 87
View non-redirecting-urls.log
Opening https://authorities.loc.gov/ (0 remaining)
💻 DOMContentLoaded 0.145s
💻 load 0.489s
✅ https://authorities.loc.gov/
… done!
Opening https://catalog.loc.gov/ (0 remaining)
💻 DOMContentLoaded 0.079s
💻 load 0.362s
✅ https://catalog.loc.gov/
… done!
View URLs loading insecure resources.txt
http://catalog2.loc.gov/cgi-bin/Pwebrecon.cgi?DB=local&BBID=18724967&v3=1
http://catalog2.loc.gov/cgi-bin/Pwebrecon.cgi?DB=local&PAGE=First
http://chroniclingamerica.loc.gov/
http://findingaids.loc.gov/
http://read.gov/
http://www.copyright.gov/
http://www.loc.gov/
http://www.loc.gov/about/office-of-the-inspector-general/
http://www.loc.gov/accessibility/
http://www.loc.gov/accessibility/web-site-accessibility/
View Sample mixed content crawl
Crawling https://www.usa.gov/
✅ https://www.usa.gov/
Crawling https://www.read.gov/cfb/
❌ https://www.read.gov/cfb/
Crawling https://www.read.gov/
❌ https://www.read.gov/
Crawling https://www.loc.gov/websites/
✅ https://www.loc.gov/websites/
Crawling https://www.loc.gov/vets/
✅ https://www.loc.gov/vets/
You can’t perform that action at this time.