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
@superseb
superseb / sshkeypair_ec2_regions_awscli.md
Last active July 25, 2019 15:42
Add SSH keypair to all EC2 regions using awscli

Add SSH key pair to all regions using awscli

Based on https://fedoramagazine.org/ssh-key-aws-regions/

docker run -ti python bash
apt update && apt -y install jq
pip install awscli
# Need to set access key, secret key AND region in aws configure
aws configure
@DazWorrall
DazWorrall / config.json
Created March 22, 2016 09:21
Faking RHEV in qemu under packer so that cloud init takes its user data from a floppy disk
{
"builders":
[
{
"type": "qemu",
"output_directory": "output",
"iso_url": "trusty-server-cloudimg-amd64-disk1.img",
"iso_checksum": "cf12c9878c9fb71c95d8f8c288761a99",
"iso_checksum_type": "md5",
"ssh_wait_timeout": "300s",
limit_req_zone $binary_remote_addr zone=weechat:10m rate=5r/m;
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name ##goeshere##;
include /path/to/ssl_config;
...
@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active April 21, 2024 03:30
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@baldwicc
baldwicc / solarized_setup.js
Last active February 9, 2024 15:38
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',
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@carwin
carwin / ghfm.rb
Created March 27, 2013 11:28
GitHub Flavored Markdown Processor
#!/usr/bin/ruby
require 'rubygems'
require 'redcarpet'
require 'albino'
class SyntaxRenderer < Redcarpet::Render::HTML
def block_code(code, language)
if language && !language.empty?
Albino.colorize(code, language)
@unbracketed
unbracketed / export_repo_issues_to_csv.py
Last active August 3, 2023 18:13
Export Issues from Github repo to CSV (API v3)
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 2, 2024 03:13
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1