Skip to content

Instantly share code, notes, and snippets.

@jmorahan
jmorahan / saved-stories.sh
Created February 9, 2015 18:29
NewsBlur saved stories download
#!/bin/bash
# Log in. Substitute your own username and password here.
echo "Logging in..."
curl --cookie-jar cookies -d username=somebody -d password='secret' https://www.newsblur.com/api/login >/dev/null
PAGE=0
while
# Download the next page of saved stories.
PAGE=$(($PAGE + 1))
@jmorahan
jmorahan / .htaccess
Last active August 4, 2018 19:47
HSTS with Apache
<IfModule mod_headers.c>
# Remove any previously set header from the 'onsuccess' table.
Header unset Strict-Transport-Security
# Set the header in the 'always' table for HTTPS requests, replacing any previous header.
Header always set Strict-Transport-Security "max-age=31536000; includeSubdomains" env=HTTPS
# For HTTP requests, the header should not be sent.
Header always unset Strict-Transport-Security env=!HTTPS
</IfModule>
#!/bin/bash
## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]>
## License: GNU General Public License v2, v3
#
# Lockable script boilerplate
### HEADER ###
LOCKFILE="/var/lock/$(basename "$0")"
@jmorahan
jmorahan / default-params.sh
Created April 27, 2017 11:28
bash script default parameters variable
#!/bin/bash
declare -a DEFAULTS PARAMS
DEFAULTS=(foo bar "baz quux")
PARAMS=("${@:-${DEFAULTS[@]}}")
printf "%s\n" "${PARAMS[@]}"
@jmorahan
jmorahan / gist:8c709918b3c8914868065e9ec5fbb3c2
Created September 22, 2017 13:28
ctools collapsible-div
<div class="ctools-collapsible-container ctools-collapsed">
<h2 class="ctools-collapsible-handle">Click here</h2>
<div class="ctools-collapsible-content">This appears</div>
</div>

Keybase proof

I hereby claim:

  • I am jmorahan on github.
  • I am jmorahan (https://keybase.io/jmorahan) on keybase.
  • I have a public key ASBOMQn5gEffBy6pt1b1nu2ZbUdqj-osJBEXGKj8LeLJGAo

To claim this, I am signing this object:

@jmorahan
jmorahan / gist:7c96267ad095e2e1c2853b4b8436a48c
Last active September 9, 2024 18:41
OCSP response received at ~ 18:34 GMT, 9 Sep 2024
$ openssl s_client -connect static.gnome.org:443 -servername static.gnome.org -status </dev/null
CONNECTED(00000003)
depth=2 C = US, O = Internet Security Research Group, CN = ISRG Root X1
verify return:1
depth=1 C = US, O = Let's Encrypt, CN = E6
verify return:1
depth=0 CN = 1009550802.rsc.cdn77.org
verify return:1
OCSP response:
======================================