Skip to content

Instantly share code, notes, and snippets.

@aerickson
aerickson / mirror.sh
Created May 7, 2020
mirror squarespace site with wget
View mirror.sh
#!/usr/bin/env bash
set -e
wget --recursive -c --level=inf --page-requisites --convert-links --adjust-extension --span-hosts --domains=mywebsite.com,squarespace-cdn.com http://www.mywebsite.com
@aerickson
aerickson / # llvm - 2020-04-02_11-35-20.txt
Created Apr 2, 2020
llvm on macOS 10.15.3 - Homebrew build logs
View # llvm - 2020-04-02_11-35-20.txt
Homebrew build logs for llvm on macOS 10.15.3
Build date: 2020-04-02 11:35:20
@aerickson
aerickson / README.md
Created Aug 28, 2019 — forked from robbiet480/README.md
A consul-template plugin to get EC2 metadata
View README.md

ec2-consul-template-plugin

About

This is a simple little Python script to let you query EC2 metadata from consul-template. It's only requirement is boto. It uses the EC2 internal metadata service so it does not require any API keys or even a region. The only caveat is that this can only be run on a machine on EC2.

Usage

You can give no arguments for full dictionary output or one or more arguments to get specific key(s). Put it somewhere on your machine, chmod +x it and give the full path to consul-template.

Examples

@aerickson
aerickson / README.md
Created Aug 28, 2019 — forked from marceloalmeida/README.md
A consul-template plugin to get EC2 metadata
View README.md

ec2-consul-template-plugin

About

This is a simple little Python script to let you query EC2 metadata from consul-template. It's only requirement is boto. It uses the EC2 internal metadata service so it does not require any API keys or even a region. The only caveat is that this can only be run on a machine on EC2.

Usage

You can give no arguments for full dictionary output or one or more arguments to get specific key(s). Put it somewhere on your machine, chmod +x it and give the full path to consul-template.

Examples

View Screen Cheat Sheet.txt
Screen Cheat Sheet
===========================
terminal usage:
new session:
screen
new named session:
screen -S <NAME>
view sessions:
screen -list
@aerickson
aerickson / gist:4b40a16b824e5891d237
Last active Oct 2, 2015
Bootstrap 3.0.0 and Typeahead.js 0.11.1/Latest working example. From http://jsfiddle.net/KrtB5/340/.
View gist:4b40a16b824e5891d237
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type='text/javascript' src='//code.jquery.com/jquery-2.0.2.js'></script>
@aerickson
aerickson / bootstrap_3_with_typeahead_js_working.html
Last active Oct 2, 2015
Example showing Bootstrap 3.0.0 and Typeahead.js 0.9.3 working. From http://www.bootply.com/86571# (but with fixed css/js links).
View bootstrap_3_with_typeahead_js_working.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Bootply snippet - Bootstrap 3 Typeahead</title>
<meta name="generator" content="Bootply" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="A search typeahead example for Bootstrap 3" />
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
View keybase.md

Keybase proof

I hereby claim:

  • I am aerickson on github.
  • I am aerickson (https://keybase.io/aerickson) on keybase.
  • I have a public key whose fingerprint is 6DE6 51F5 A324 882E AB32 A9E8 DE79 F47A 9C1F 0CA6

To claim this, I am signing this object:

@aerickson
aerickson / PyCurlSSLFixOnUbuntu
Last active Dec 16, 2018
how to rebuild PyCurl against OpenSSL on Ubuntu (12-13+)
View PyCurlSSLFixOnUbuntu
XBMC uses pycurl/libcurl to fetch stuff. YouTube requires the RC4
cipher that GnuTLS has removed for security reasons (or doesn't allow
it to be selected, or XBMC doesn't allow to specify the cipher...).
PyCurl linked against OpenSSL can take the RC4 argument and make the
Youtube plugin work (Ubuntu ships it linked against GnuTLS), so we
need to rebuild to make it work.
///
from: https://code.google.com/p/wfuzz/wiki/PyCurlSSLBug
View find_external_ip.rb
require 'socket'
def local_ip
orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily
UDPSocket.open do |s|
s.connect '64.233.187.99', 1
s.addr.last
end
ensure