This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:stretch-slim | |
RUN apt-get update -y && apt install -y curl && \ | |
curl -LO https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64/containerd.io_1.2.6-3_amd64.deb && apt install -f -y ./containerd.io_1.2.6-3_amd64.deb && \ | |
curl -LO https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64/docker-ce-cli_18.09.7~3-0~debian-stretch_amd64.deb && apt install -f -y ./docker-ce-cli_18.09.7~3-0~debian-stretch_amd64.deb && \ | |
curl -LO https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64/docker-ce_18.09.7~3-0~debian-stretch_amd64.deb && apt install -f -y ./docker-ce_18.09.7~3-0~debian-stretch_amd64.deb && \ | |
rm -rf *.deb | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi if you're seeing this - you probably got stuck where I was: | |
The pipeline randomly fails at ssh-add? | |
Guess what the fix is - add a new line at the end of your ssh key stored in jenkins, absolutely stupid right. | |
Here's an example of pipeline: | |
def tagBuild(gitTag){ | |
// Required for setup of jenkins slave ssh daemon | |
tryAddKnownHost('github.com') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Quick script to create a dict of subnetid -> isPublic (check if AWS VPC subnet is public or not) | |
import boto3 | |
ec2 = boto3.client('ec2') | |
subnetDict = {} | |
apicall = ec2.describe_route_tables() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"os" | |
"strconv" | |
"strings" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Func func(key string) (interface{}, error) | |
type result struct { | |
value interface{} | |
err error | |
} | |
type entry struct { | |
res result | |
ready chan struct{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Also available at: https://play.golang.org/p/yTTpB5gB6C | |
package main | |
import ( | |
"fmt" | |
) | |
// ***************************************************************************** | |
// Example 1 - Struct vs Struct with Embedded Type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
echo "Cleaning workspace" | |
ls -1 | grep -v generate.sh | xargs rm -rf | |
echo "Generating CA" | |
openssl genrsa -out ./ca.key.pem 4096 | |
openssl req -key ca.key.pem -new -x509 -days 7300 -sha256 -out ca.cert.pem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Example { | |
String name; | |
int ID; | |
static void main(String[] args) { | |
Example man = new Example() | |
man.getStudent() | |
println(man.name + " is " + man.ID) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
slice := []string{"TEST1", "TEST2", "TEST3", "TEST4"} | |
fmt.Println("SLICE AT START", slice) | |
for i := len(slice) - 1; i >= 0; i-- { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "vscode://schemas/color-theme", | |
"comment": "Cold Snack, created by Evan Rowe.", | |
"author": "Evan Rowe", | |
"name": "Cold Snack Theme", | |
"tokenColors": [{ | |
"settings": { | |
"background": "#002B36", | |
"foreground": "#93A1A1" | |
} |