Skip to content

Instantly share code, notes, and snippets.

View konklone's full-sized avatar

Eric Mill konklone

View GitHub Profile
@konklone
konklone / ssl-redirect.html
Last active January 2, 2024 15:09
Force a quick redirect to HTTPS on Github Pages for your domain (and only your domain)
<script>
var host = "YOURDOMAIN.github.io";
if ((host == window.location.host) && (window.location.protocol != "https:"))
window.location.protocol = "https";
</script>
@konklone
konklone / ssl.rules
Last active August 8, 2023 08:39
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@konklone
konklone / Makefile
Created October 10, 2014 14:19
building openssl with FIPS
#
all: test
openssl-fips-2.0.8.tar.gz:
wget http://www.openssl.org/source/openssl-fips-2.0.8.tar.gz
openssl-1.0.1i.tar.gz:
wget http://www.openssl.org/source/openssl-1.0.1i.tar.gz
@konklone
konklone / icpsr_to_bioguide.rb
Created January 19, 2012 20:32
Matching up ICPSR IDs to Bioguide IDs using Charles Stewart's data, and the Sunlight Labs Congress API.
# house-icpsr.csv and senate-icpsr.csv are made by converting the XLS files found here to CSV:
# http://web.mit.edu/17.251/www/data_page.html#2
# Specifically, these files that list information and IDs for members from the 103rd to 112th Congress:
# http://web.mit.edu/cstewart/www/data/house_members_103-112-1.xls
# http://web.mit.edu/cstewart/www/data/senators_103-112-1.xls
# This script looks through the two original CSVs, caches the ICPSR ID of every member from the 110th Congress onward,
# then goes through every legislator in the Sunlight Labs Congress API and tries to match them up by a combination of
# last name, state, and party.
@konklone
konklone / Dockerfile
Created September 22, 2013 18:17
Dockerfile for installing Ruby 2.0 and RVM
FROM ubuntu
MAINTAINER Eric Mill "eric@konklone.com"
# turn on universe packages
RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list
RUN apt-get update
# basics
RUN apt-get install -y nginx openssh-server git-core openssh-client curl
RUN apt-get install -y nano
@konklone
konklone / rename-listserv-log-files.rb
Created November 9, 2015 21:29
Rename files exported from L-Soft's LISTSERV software from XXX.LOGYYMM to XXX-YYYYMM.LOG
#!/usr/bin/env ruby
###
# Small script to rename files as exported from L-Soft's LISTSERV.
#
# Files are named with the month in the extension, e.g. SM-COP.LOG1410
# This renames them to be of the form SM-COP-2014-10.log
#
# Written by Eric Mill, eric.mill@gsa.gov. Public domain.
###
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
arpc.afrc.af.mil
www.uscg.mil
erecruit.nga.mil
arpcmt1.afrc.af.mil
arpcmt2.afrc.af.mil
arpcmt3.afrc.af.mil
mypay.dfas.mil
mypayeaw.dfas.mil
www.fdm.army.mil
52arty-db-002v.afrc.af.mil
@konklone
konklone / date differences in google spreadsheets.js
Created April 23, 2018 00:08
calculate date differences between two columns, for Google Apps Script / GSheets
// Subtracts two dates, formatted as e.g. 2025-04-10T12:46:10
// Author: Eric Mill, eric.mill@gsa.gov
// columns with notBefore and notAfter dates
var startField = "D";
var endField = "E";
var resultField = "F";
// first sheet
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];
@konklone
konklone / cert.rb
Last active June 29, 2019 13:07 — forked from pzb/sample-chain1.txt
generate a self-signed root, issuing intermediate, and end entity certificate and private key
#!/usr/bin/env ruby
# Forked from https://gist.github.com/pzb/84f867ed5a330093cfbf
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@konklone
konklone / injection.html
Last active November 28, 2018 06:10
southwest airlines HTTP injection
<link href="http://connected.southwestwifi.com/unb/unb.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://connected.southwestwifi.com/unb/jqr44-1.8.3.js"></script>
<script type="text/javascript">var r44_btime=new Date();var r44_smu_time=1431575257.040</script>
<script type="text/javascript" src="http://connected.southwestwifi.com/unb/unb.js"></script>