Skip to content

Instantly share code, notes, and snippets.

View nicerobot's full-sized avatar
🤖
☯️ ☮️ 🐶 🐾 👾 🎮 🎼 🎶 🕺 🎧 🌻 🌱 🏞 🌊 🌔 🌎

nicerobot nicerobot

🤖
☯️ ☮️ 🐶 🐾 👾 🎮 🎼 🎶 🕺 🎧 🌻 🌱 🏞 🌊 🌔 🌎
View GitHub Profile
@nicerobot
nicerobot / Dockerfile
Last active January 17, 2021 06:03
A Docker Multi-Stage Scratch Build for Go with binary compression using UPX and including SSL certificates.
FROM golang:1.9.2-alpine3.7 as build-env
RUN apk add --no-cache git build-base && \
echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk add --no-cache upx=3.94-r0
ADD . /go/src/github.com/gomatic/app/
WORKDIR /go/src/github.com/gomatic/app
RUN go get -d ./ && \
CGO_ENABLED=0 GOOS=linux go build -o app -a -ldflags="-s -w" -installsuffix cgo && \
@koop
koop / ensure-cert-macos.sh
Created November 28, 2017 20:27
Ensures a certificate is in the macOS system keychain.
#!/bin/bash
# Usage
# $ ./install-cert-macos.sh "/path/to/cert"
CERT_PATH="$1"
# First, grab the SHA-1 from the provided SSL cert.
CERT_SHA1=$(openssl x509 -in "$CERT_PATH" -sha1 -noout -fingerprint | cut -d "=" -f2 | sed "s/://g")
# Next, grab the SHA-1s of any standard.dev certs in the keychain.
# Don't return an error code if nothing is found.
@nicerobot
nicerobot / keybase.md
Created September 13, 2017 16:41
keybase.md

Keybase proof

I hereby claim:

  • I am nicerobot on github.
  • I am nicerobot (https://keybase.io/nicerobot) on keybase.
  • I have a public key whose fingerprint is 0C6F 8A92 78AA 679B C74F BD66 2C7A 5B8A 0CF4 9016

To claim this, I am signing this object:

@posener
posener / go-shebang-story.md
Last active March 29, 2024 08:38
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@plinyar
plinyar / FirehoseTransformer.kt
Last active September 5, 2018 16:56
Sample AWS Kinesis Firehose lambda transformation in Java (Kotlin indeed)
import com.amazonaws.services.lambda.runtime.Context
import com.amazonaws.services.lambda.runtime.LambdaLogger
class FirehoseTransformer {
private lateinit var logger: LambdaLogger
fun handler(event: KinesisFirehoseEvent, context: Context): KinesisFirehoseResponse {
logger = context.getLogger()
logger.log("Lambda started. Got messages ${event.records.size}.")
@matryer
matryer / term_context.go
Last active March 10, 2022 05:23
Making Ctrl+C termination cancel the context.Context
func main() {
ctx := context.Background()
// trap Ctrl+C and call cancel on the context
ctx, cancel := context.WithCancel(ctx)
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
defer func() {
signal.Stop(c)
{
"Parameters" : {
"VPCID" : {
"Type" : "AWS::EC2::VPC::Id",
"Description" : "Select Virtual Private Cloud ID"
},
"ELBSubnet" : {
"Type" : "List<AWS::EC2::Subnet::Id>",
"Description" : "Subnets for Elastic Loadbalancer"
},
{
"Parameters": {
"CIDRRange": {
"Description": "VPCCIDR Range (will be a /16 block)",
"Type": "String",
"Default": "10.251.0.0",
"AllowedValues": ["10.250.0.0","10.251.0.0"]
}
},
"Mappings": {
@miglen
miglen / aws-certification.md
Last active May 5, 2023 10:04
AWS Certification guide and notes on how to prepare for the aws associate certification architect, sysops and developer exams


AWS Certification notes

Those are my personal notes on AWS Solution Architect certification preparation. Hope you find them usefull.

To pass AWS certification, you should have:

  • Sound knowledge about most of the AWS services ( EC2, VPC, RDS, Cloudfront, S3, Route53 etc,)
  • Hands on experience with AWS services.
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note