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 / 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 / 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
#
@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 / 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