Skip to content

Instantly share code, notes, and snippets.

View embano1's full-sized avatar

Michael Gasch embano1

View GitHub Profile
@embano1
embano1 / xargs.MD
Last active February 18, 2019 13:10
find xargs rm

helps with space issues

find . -type f -ctime +80d -maxdepth 1 | xargs -I{} rm -v {}

@embano1
embano1 / README.MD
Created February 6, 2019 22:36
Download protected Videos (e.g. Vimeo) with youtube-dl
youtube-dl https://player.vimeo.com/video/299186608 --referer https://skillsmatter.com/skillscasts/12115-keynote-not-just-events-developing-asynchronous-microservices
@embano1
embano1 / hack.md
Last active March 18, 2019 10:27
Python OOM Docker Quick'n'Dirty

Run container with 200M MEM limit and swap off

docker run -it -m 200M --memory-swap 0 python

Now run ctop with single container view to see mem usage increasing

ctop // switch to single container view
@embano1
embano1 / README.MD
Created September 23, 2019 14:54
Dockerfile for Go modules and built cache efficiency

Also works across git branches if you keep the intermediate build images around, e.g. those <none> images in the docker images output.

FROM golang:1.12 AS builder

# enable Go modules support
ENV GO111MODULE=on

WORKDIR $GOPATH/src/github.com/myrepo/myapp
@embano1
embano1 / README.MD
Created October 17, 2019 14:54
Bill kind

kindcfg

kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
  extraPortMappings:
  - containerPort: 5432
    hostPort: 5432
@embano1
embano1 / 03-envoy.yaml
Last active October 25, 2019 15:25
VEBA Contour Deployment
# examples/contour/03-envoy.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
app: envoy
name: envoy
namespace: projectcontour
spec:
[...]
@embano1
embano1 / client.go
Last active April 11, 2024 13:46
gRPC Graceful Shutdown on Client and Server
package main
import (
"context"
"grpc-tutorial/greeter"
"io"
"log"
"os"
"os/signal"
"sync"
@embano1
embano1 / README.MD
Last active February 18, 2020 19:12
Benchmark fmt.Sprintf %v vs %s
go test -bench=. -benchmem                    
goos: darwin
goarch: amd64
pkg: fmt-perf
BenchmarkFmtV-16         6899274               174 ns/op              64 B/op          1 allocs/op
BenchmarkFmtS-16         9181304               129 ns/op              80 B/op          2 allocs/op
PASS
ok      fmt-perf        4.138s
@embano1
embano1 / doc.md
Created March 31, 2020 19:33
for patrick