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 / delete-vpc.sh
Created March 5, 2017 15:22
Delete AWS VPC including dependencies
#!/bin/sh
#
# Delete a VPC and its dependencies
if [ -z "$1" ] then
echo "usage: $0 <vpcid>"
exit 64
fi
vpcid="$1"
@cjp
cjp / .el
Last active May 15, 2023 09:40
How to get org-protocol to work with spacemacs
;; I have no idea why it works. This is the product of 4 hours of trial-and-error.
(defun dotspacemacs/user-init ()
"Initialization function for user code.
It is called immediately after `dotspacemacs/init'. You are free to put almost
any user code here. The exception is org related code, which should be placed
in `dotspacemacs/user-config'."
(server-start)
(require 'org-protocol)
)
@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.
@cjp
cjp / solarized_setup.js
Last active August 5, 2016 17:56 — forked from baldwicc/solarized_setup.js
Solarized Light and Solarized Dark for Chrome Secure Shell (nassh), with fonts
/**
* STEP 1: Setup
* - Open Chrome Secure Shell settings
* - Open JS Console (CTRL+SHIFT+J)
* - Copy and paste the following:
*/
var s7d_colours = {
'base03': '#002b36',
'base02': '#073642',
'base01': '#586e75',
@cjp
cjp / nopol.el
Last active July 26, 2016 17:03
A useful filter
(defun tw-nopol (tweet)
(setq mat nil)
(dolist (pat '("DNC" "RNC" "Bernie" "Clinton" "Hillary" "#DemsInPhilly" "Trump" "#RNCinCLE" "fascis" "politic" "conservati" "liberal" "election" "voting") mat)
(if (string-match pat (cdr (assq 'text tweet)))
(setq mat t))))
(twittering-visit-timeline '":exclude-if/tw-nopol/:home")
@cjp
cjp / browse-url-display.el
Created April 6, 2016 22:41
Display URL requested by `browse-url` function
(defun browse-url-display (url &optional _new-window)
;; new-window ignored
"Open a help window displaying the requested URL."
(interactive (browse-url-interactive-arg "URL: "))
(with-help-window "*url*"
(princ (list url))))
(setq browse-url-browser-function 'browse-url-display)
@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 / asset-tag.rb
Created December 18, 2015 23:59
Take list of assets and classifications in CSV and tag the assets in Nexpose
#!/usr/bin/env ruby
require 'csv'
require 'nexpose'
require 'highline/import'
require 'ipaddr'
class String
# ask String if it's an IPv4 address
def ipv4?
@cjp
cjp / gist:53f03a988530d474be0e
Last active December 2, 2015 21:00
manhattantimesnews.com DNS broken
manhattantimesnews.com. 172800 IN NS ns1.m28.siteground.biz.
manhattantimesnews.com. 172800 IN NS ns2.m28.siteground.biz.
;; Received 94 bytes from 192.26.92.30#53(192.26.92.30) in 19 ms
manhattantimesnews.com. 14400 IN A 181.224.140.118
manhattantimesnews.com. 86400 IN NS ns1.vm2936.sgvps.net.
manhattantimesnews.com. 86400 IN NS ns2.vm2936.sgvps.net.
;; Received 108 bytes from 181.224.147.71#53(181.224.147.71) in 48 ms
$ host ns1.vm2936.sgvps.net
@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
#