Skip to content

Instantly share code, notes, and snippets.

Staying home

Chris Adams acdha

Staying home
View GitHub Profile
acdha / optimize-solr
Last active Feb 27, 2016
Crude but effective cron watchdog for Apache Solr
View optimize-solr
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 / 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
Additional timing information will be displayed to easily distinguish between requests
made before DOMContentLoaded or the full load event.
acdha /
Last active Jan 15, 2016
🔒 Use pywikibot to rewrite links to use HTTPS
acdha / WDL links on Wikipedia which are HTTPS ready
Last active Jan 13, 2016
Links to from the top 36 Wikipedia properties
View WDL links on Wikipedia which are HTTPS ready
acdha / iiif-ar.po
Last active Dec 18, 2015
Translations for “IIIF Manifest” used on 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"
#!/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 / 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 (0 remaining)
💻 DOMContentLoaded 0.145s
💻 load 0.489s
… done!
Opening (0 remaining)
💻 DOMContentLoaded 0.079s
💻 load 0.362s
… done!
View URLs loading insecure resources.txt
View Sample mixed content crawl
You can’t perform that action at this time.