Skip to content

Instantly share code, notes, and snippets.

View cjp's full-sized avatar

Christopher J. Pilkington cjp

  • EmblemHealth
  • Baltimore, Maryland, USA
View GitHub Profile
@cjp
cjp / notam-drone-cny
Created November 14, 2013 22:54
Notices to Airmen regarding drone flights in Central New York
Selected NOTAMs
The following NOTAM list was selected by the user from a previous request. This list may not reflect all active NOTAMs for any of the below locations.
Data Current as of: Thu, 14 Nov 2013 22:39:00 UTC
ZBW BOSTON (ARTCC),NASHUA, NH.
!BDR 11/034 ZBW AIRSPACE UNMANNED ACFT WITHIN AREA DEFINED AS ART194036 ART102081 ART060075
ART070090 ART050050 ART123090 ART215040 ART229052 ART250037 ART270025 ART102011 ART194036 ART167013
@cjp
cjp / xccdf-markdown.rb
Last active August 29, 2015 13:56
Convert XCCDF to Markdown
#!/usr/bin/env ruby
require 'rubygems'
require 'xmlsimple'
# stolen from facets, thanks to dharple for the suggestion
def word_wrap(text, col_width=80)
text.gsub!( /(\S{#{col_width}})(?=\S)/, '\1 ' )
text.gsub!( /(.{1,#{col_width}})(?:\s+|$)/, "\\1\n" )
text

Keybase proof

I hereby claim:

  • I am cjp on github.
  • I am cjp (https://keybase.io/cjp) on keybase.
  • I have a public key whose fingerprint is 0EE5 CD71 3529 D6A1 FCAA FFF9 208D 40F7 D7FB 7888

To claim this, I am signing this object:

@cjp
cjp / gist:f4dda3cc0f26ad10a3fe
Last active February 22, 2022 20:41
T-Mobile NXDOMAIN hijacking

Confirmed, T-Mobile hijacks DNS.

I am testing from my laptop tethered to a stock T-Mobile Note 3. Lookup of my IP address:

$ curl http://checkip.dyndns.org
<html><head><title>Current IP Check</title></head><body>Current IP Address: 172.56.20.69</body></html>
$ /usr/bin/whois 172.56.20.69 | grep OrgName
OrgName:        T-Mobile USA, Inc.
PROMPT='%F{10}%n@%F{11}%m %F{blue}%2c%(?,%{%F{green}%},%{%F{red}%}) ❯%f '
RPROMPT='$(git_prompt_info) %(?,%{%F{green}%},%{%F{red}%})❮ %F{blue}%D{%H:%M} %F{yellow}%D{%Z}%f'
ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%f"
ZSH_THEME_GIT_PROMPT_DIRTY=" %F{red}*%f"
ZSH_THEME_GIT_PROMPT_CLEAN=""
@cjp
cjp / rolldie.sh
Created December 11, 2014 17:04
Shell script that rolls a single die
#!/bin/sh
random() {
od -A n -t d -N 1 /dev/random | tr '\n' ' ' | awk '{print $1}'
}
rolldie() {
local r=$(random)
while [ $r -gt 6 -o $r -lt 1 ]; do
r=$(random)
@cjp
cjp / crypto.cat.tls.txt
Created December 26, 2014 14:10
crypto.cat tls certificate as of 2014-12-16
% echo | openssl s_client -tls1_2 -servername crypto.cat -connect crypto.cat:443 2>/dev/null >/tmp/crypto.cat
% openssl x509 -noout -in /tmp/crypto.cat -text | grep -A2 Validity
Validity
Not Before: Dec 24 00:00:00 2014 GMT
Not After : Feb 5 12:00:00 2016 GMT
% for h in md5 sha1; do openssl x509 -noout -in /tmp/crypto.cat -fingerprint -$h; done
MD5 Fingerprint=DE:16:98:A3:A8:B6:04:3F:88:9B:2F:F5:58:26:73:AD
SHA1 Fingerprint=AE:96:D9:C0:69:46:32:7D:1B:83:D1:08:99:61:8A:1D:D8:06:44:E7
@cjp
cjp / stackedit-solarized-dark-correction.md
Last active August 29, 2015 14:13
StackEdit Solarized Dark Correction

Some colors in StackEdit were nonsensical for the Solarized dark theme.

Go to Menu -> Settings -> Extensions -> UserCustom Extension. Paste this code in the box provided, then click OK.

userCustom.onReady = function() {
  $('head').append('<style>.hljs,.hljs-subst,.hljs-tag .hljs-title,.lisp .hljs-title,.clojure .hljs-built_in,.nginx .hljs-title{color:#eee8d5}.hljs-string,.hljs-title,.hljs-constant,.hljs-parent,.hljs-tag .hljs-value,.hljs-rules .hljs-value,.hljs-rules .hljs-value .hljs-number,.hljs-preprocessor,.hljs-pragma,.haml .hljs-symbol,.ruby .hljs-symbol,.ruby .hljs-symbol .hljs-string,.hljs-aggregate,.hljs-template_tag,.django .hljs-variable,.smalltalk .hljs-class,.hljs-addition,.hljs-flow,.hljs-stream,.bash .hljs-variable,.apache .hljs-tag,.apache .hljs-cbracket,.tex .hljs-command,.tex .hljs-special,.erlang_repl .hljs-function_or_atom,.asciidoc .hljs-header,.markdown .hljs-header,.coffeescript .hljs-attribute{color:#dc322f}pre
@cjp
cjp / gist:32469727ea538b81c929
Created February 11, 2015 23:55
nginx server section for TLS
server {
listen [::]:443 ssl spdy ipv6only=off;
server_name whatever.wherever;
ssl_certificate somethingsomething.pem;
ssl_certificate_key somethingsomething.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA
@cjp
cjp / trello-json2csv.rb
Created June 2, 2015 16:26
Convert Trello JSON export into CSV summary
#!/usr/bin/env ruby
#
# trello-json2csv.rb - Convert Trello JSON export into CSV summary
#
# note: only includes first label and first member of each card
#
# Copyright (C) 2015 Christopher J. Pilkington https://github.com/cjp
# Licensed under The MIT License, http://opensource.org/licenses/MIT
#