Skip to content

Instantly share code, notes, and snippets.

Niels Hofmans hazcod

Block or report user

Report or block hazcod

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
View docker-swarm-security-groups.tf
resource "scaleway_security_group" "swarm_managers" {
name = "swarm_managers"
description = "Whitelist HTTP(S) and SSH traffic"
inbound_default_policy = "drop"
outbound_default_policy = "accept"
}
resource "scaleway_security_group_rule" "ssh_accept" {
security_group = "${scaleway_security_group.swarm_managers.id}"
@hazcod
hazcod / cloudSettings
Last active Aug 16, 2019
My VS Code preferences.
View cloudSettings
{"lastUpload":"2019-08-16T09:06:54.903Z","extensionVersion":"v3.4.1"}
@hazcod
hazcod / cloudbuild.yaml
Last active Jun 25, 2019
Clean container registry images in Google Cloud Build step.
View cloudbuild.yaml
substitutions:
_IMG_KEEP: "3"
steps:
- name: 'gcr.io/cloud-builders/gcloud-slim'
entrypoint: 'bash'
args:
- '-c'
@hazcod
hazcod / go-alpine-protobuf.Dockerfile
Last active Jun 24, 2019
Use protobuf on golang alpine Docker image.
View go-alpine-protobuf.Dockerfile
FROM golang:alpine
RUN apk add --no-cache protobuf git \
&& go get github.com/golang/protobuf/protoc-gen-go \
&& cp /go/bin/protoc-gen-go /usr/bin/
# e.g. find proto -type f -iname '*.proto' -exec protoc -I proto/ --go_out go/ {} \;
@hazcod
hazcod / remove-map-refs.sh
Last active May 13, 2019
Remove mapping file references using (bsd) sed and find.
View remove-map-refs.sh
find css js -type f \( -iname '*.css' -o -iname '*.js' \) -exec sed -i '' -e 's/sourceMappingURL=[^ ]*\.map//g' {} +
View pprof-cpu-svg.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hazcod
hazcod / genpass.sh
Created Feb 5, 2019
Bash snippet to generate a 32-character password with strong entropy.
View genpass.sh
#!/usr/bin/env sh
LC_ALL=C tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' < /dev/urandom | head -c 32 ; echo
@hazcod
hazcod / btt-work.bttpreset
Created Aug 30, 2018
My BetterTouchTool TouchBar config.
View btt-work.bttpreset
{
"BTTPresetName" : "work",
"BTTGeneralSettings" : {
"disableScrollingIf3" : true,
"BTTForceNormalClickPressure5F" : 200,
"disableScrollingIf2" : true,
"BTTDidRegisterForUpdateStats" : "2.608",
"BTTShowControlStrip" : false,
"BTTShowControlStripItem" : true,
"BTTForceForceClickPressure5F" : 600,
@hazcod
hazcod / feature-policy
Created Aug 24, 2018
Full Feature-Policy header
View feature-policy
Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; animations 'none'; autoplay 'none'; camera 'none'; encrypted-media 'none'; fullscreen 'none'; geolocation 'none'; gyroscope 'none'; image-compression 'none'; legacy-image-formats 'none'; magnetometer 'none'; max-downscaling-image 'none'; microphone 'none'; midi 'none'; payment 'none'; picture-in-picture 'none'; speaker 'none'; sync-xhr 'none'; unsized-media 'none'; usb 'none'; vertical-scroll 'none'; vr 'none'";
@hazcod
hazcod / logger.go
Last active Aug 27, 2018
Simple logger that listens for UNIX datagram message and prints them to stdout. We don't like syslog-ng in our postfix container!
View logger.go
package main
import (
"bufio"
"net"
"os"
"syscall"
)
func println(msg string) {
You can’t perform that action at this time.