Skip to content

Instantly share code, notes, and snippets.

Nick Glynn 17twenty

Block or report user

Report or block 17twenty

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@17twenty
17twenty / cheatsheet.md
Created Aug 24, 2017
Docker - A Cheatsheet
View cheatsheet.md

Docker Cheatsheet

Docker Registries & Repositories

Login to a Registry

docker login
docker login localhost:8080
@17twenty
17twenty / mail.html
Created Aug 21, 2017
Email Markup for newsletters
View mail.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Signup for my newsletter</title>
<style type="text/css">
body{
margin: 0 auto;
padding: 0;
@17twenty
17twenty / consulservicediscovery.go
Created Aug 4, 2017
Want to find things from your Golang apps in Consul?
View consulservicediscovery.go
package main
import (
"fmt"
"log"
consul "github.com/hashicorp/consul/api"
)
// Client provides an interface for getting data out of Consul
@17twenty
17twenty / ipmath.go
Created Jun 28, 2017
IP Address math
View ipmath.go
package ipmath
import (
"crypto/sha1"
"encoding/binary"
"math"
"net"
)
//ToUInt32 converts an IPv4 address into
@17twenty
17twenty / ratelimitMyCopy.go
Created Jun 14, 2017
Demo of using golang.org x time rate RateLimiter
View ratelimitMyCopy.go
package main
import (
"bytes"
"fmt"
"io"
"time"
"golang.org/x/time/rate"
)
@17twenty
17twenty / git.sh
Created Mar 30, 2017
Wrapper script that can specify an ssh-key file with the Git command
View git.sh
#!/bin/bash
#-------------------------------------------------------------------------------
# Wrapper script that can specify an ssh-key file with the Git command
#
# The MIT License (MIT) - http://opensource.org/licenses/MIT
# Copyright (c) 2013 Alvin Abad
#-------------------------------------------------------------------------------
if [ $# -eq 0 ]; then
@17twenty
17twenty / ecs-cluster.tf
Last active Mar 23, 2017
Terraform Docker Injection - You can override the docker config this way - useful for custom BIP / CIDRs
View ecs-cluster.tf
...
# Fetch the AWS ECS Optimized Linux AMI. Note that if you've never launched this AMI before, you have to accept the
# terms and conditions on this webpage or the EC2 instances will fail to launch:
# https://aws.amazon.com/marketplace/pp/B00U6QTYI2
data "aws_ami" "ecs" {
most_recent = true
owners = ["amazon"]
filter {
name = "name"
@17twenty
17twenty / le-cert.rb
Created Mar 23, 2017 — forked from tobiasfeistmantl/le-cert.rb
Easy to use Ruby script to register and authorize new domains on Let's Encrypt and getting certificates for them. Call 'ruby le-new.rb' and follow the instructions. Install OpenSSL and the ACMEClient gem before!
View le-cert.rb
#!/usr/bin/env ruby
begin
require 'acme-client'
rescue LoadError
abort 'MISSING GEM! You haven\'t installed the ACME client. Install the gem with the command \'gem install acme-client\'.'
end
require 'openssl'
require 'resolv'
@17twenty
17twenty / drop_encrypt.go
Created Mar 13, 2017 — forked from josephspurrier/drop_encrypt.go
Golang - Drag and Drop AES Encryption and Decryption
View drop_encrypt.go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
"os"
@17twenty
17twenty / sysctl.conf
Created Mar 10, 2017
Make-a-da-linux-awesome - A simple sysctl setup to max out the awesomeness on Linux in a network configuration
View sysctl.conf
sysctl -w fs.file-max="9999999"
sysctl -w fs.nr_open="9999999"
sysctl -w net.core.netdev_max_backlog="4096"
sysctl -w net.core.rmem_max="16777216"
sysctl -w net.core.somaxconn="65535"
sysctl -w net.core.wmem_max="16777216"
sysctl -w net.ipv4.ip_local_port_range="1025 65535"
sysctl -w net.ipv4.tcp_fin_timeout="30"
sysctl -w net.ipv4.tcp_keepalive_time="30"
sysctl -w net.ipv4.tcp_max_syn_backlog="20480"
You can’t perform that action at this time.