Skip to content

Instantly share code, notes, and snippets.

View zeisss's full-sized avatar
🍪
Eat More Chocolate Cookies!

Stephan zeisss

🍪
Eat More Chocolate Cookies!
View GitHub Profile

Keybase proof

I hereby claim:

  • I am zeisss on github.
  • I am zeisss (https://keybase.io/zeisss) on keybase.
  • I have a public key ASBmYeTfh_UmZt2E_LnUuot3iOBPzO-HHQlK55dyoen49wo

To claim this, I am signing this object:

@zeisss
zeisss / http2_test.go
Last active July 14, 2021 21:18
A POC showing how to serve a HTTP2 server over an outgoing connection (PTTH style)
// Run with
//
// $ GODEBUG=http2debug=2 go test . -v
//
// for debug output
package main
import (
"crypto/tls"
"fmt"
@zeisss
zeisss / main.go
Last active June 22, 2021 13:47
AWS ip-ranges.json: Find aws prefix / CIDR block for given IP addresses
/*
find_ip search a local copy of https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html#aws-ip-download for a specific IP and prints the prefix.
*/
package main
import (
"encoding/json"
"fmt"
"net"
"os"
FROM golang:1.6
RUN go get github.com/nlopes/slack
COPY main.go /go/src/main.go
CMD ["go", "run", "/go/src/main.go"]
core@ip-172-31-28-12 ~ $ cat test.service
[Unit]
Description=Stephan Test
[Service]
ExecStart=/bin/echo 01234567890123456789012345678901234567890123456789 012345678901\
234567890123456789012345678901234567890123456789012345678901234567890123456789012345\
678901234567890123456789012345678901234567890123456789012345678901234567890123456789\
01234567890123456789012345678901234567890123456789012345678901234567890123456789\
01234567890123456789012345678901234567890123456789012345678901234567890123456789\
@zeisss
zeisss / Cargo.toml
Last active August 29, 2015 14:24
Reading GiantSwarm Environments with Rust 1.2.0-nightly (9ad0063a1 2015-06-20)
[package]
name = "swarm-rust-example"
version = "0.1.0"
authors = ["root"]
[dependencies]
hyper = "0.6.1"
@zeisss
zeisss / gist:151d3323955ec6e9b44f
Created June 26, 2015 09:39
Finding the channels of a user in slack
curl https://api.slack.com/api/channels.list -d "token=${TOKEN}" | jq '.channels[] | {name: .name, m: (.members[] | contains("$MEMBERID"))}'|grep -B1 true|grep name
etcdctl ls /path/api/ --recursive|xargs -I{} echo 'A="$(etcdctl get {})" && etcdctl set $(echo {}|sed s/api/othername/) "${A}"; unset A'
@zeisss
zeisss / gist:98f5bb5d6c01fe62225e
Created June 11, 2015 20:59
Second Golang Meetup - Go Channels 101
# Go Channels
Dennis - [email protected] or @denderello
Stephan - [email protected] or @zeisss_public
> "Don't communicate by sharing memory, share memory by communicating." -- Rob Pike
## Problem
package main
import "time"
import "fmt"
import "math/rand"
// parallel performs the given actions with `n` actions in parallel.
// Make `n == len(actions)` to perform all actions in parallel.
//
// Arguments