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"]
@zeisss
zeisss / update_somafm_playlists.sh
Last active December 26, 2015 11:19
Updates somafm m3u playlists files in the current folder
#!/bin/sh
# Create the interested streams by touching:
# $ touch somafm_groovesalad.m3u
# $ touch somafm_covers.m3u
for x in somafm_*.m3u
do
PLAYLIST_FILE=$x
STREAM=$(echo $PLAYLIST_FILE | sed -e 's/^somafm_//' -e 's/\.m3u$//')
echo Checking $STREAM
type Args struct {
Values []string `json:values`
}
type Service int
// {"id": 1, "method": "echo2.Echo2", "params": {"values": ["hello", "world"]}}
func (this *Service) Echo2(params *Args, response *string) error {
*response = "Hello World"
return nil
// {"id": 1, "method": "echo2.Echo", "params": ["hello", "world"]}
package main
import (
"log"
"fmt"
"net"
"net/rpc"
"net/rpc/jsonrpc"
)
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_NAME = ENV['BOX_NAME'] || "ubuntu"
BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise64.box"
VF_BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise64_vmware_fusion.box"
AWS_REGION = ENV['AWS_REGION'] || "us-east-1"
AWS_AMI = ENV['AWS_AMI'] || "ami-d0f89fb9"
FORWARD_DOCKER_PORTS = ENV['FORWARD_DOCKER_PORTS']
{application, <App Name>,
[{description, "<App Description>"},
{vsn, "<App Version>"},
{modules, [<Module List>]},
{registered, [<Registered Modules]},
{applications, [<Dependency List>]},
{mod, {<Application Behaviour Module>, []}}]}.
@zeisss
zeisss / editor.erl
Last active December 22, 2015 01:39
State transformation of one string to another
-module(editor).
-include_lib("eunit/include/eunit.hrl").
-export([edit/2, edits/2]).
-type command() :: delete | {add, char()} | {insert, char()} |
skip | {replace, char()}.
%% Applies the list of commands to the given Input string and returns the resulting