Skip to content

Instantly share code, notes, and snippets.

let mut output: Box<io::Write> = match matches.value_of("out") {
Some(o) if o == "-" => Box::new(io::stdout()),
Some(o) => Box::new(File::create(&Path::new(o)).unwrap()),
None => Box::new(io::stdout()),
};
@thinktainer
thinktainer / gen_proto.sh
Created December 14, 2017 10:09
generate protos with timestamp gogoproto
protoc -I $GOPATH/src -I $PWD --gogoslick_out=Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,import_path=commission_results:. commission_events.proto
@thinktainer
thinktainer / main.go
Last active December 13, 2017 12:51
replace_sql_credential.go
package main
import (
"fmt"
"regexp"
"strings"
)
func main() {
rg := regexp.MustCompile(`.*:\/\/(\S+):(\S+)@.*`)
echo "external_reference:\"1234567890\"\ncorrelation_token:\"18cec3bc-b298-4a75-8a3b-18fa6c251bf6\"\n" | protoc -I=$GOPATH/src --encode=InsuranceSupplyStarted $GOPATH/src/github.com/utilitywarehouse/insurance-proto
buf-model/insurance_supply_events.proto | wc -c
github.com/utilitywarehouse/insurance-protobuf-model/insurance_supply_events.proto: warning: Import google/protobuf/timestamp.proto but not used.
50
interface=lo
bind-interfaces
listen-address=127.0.0.1
address=/dev/127.0.0.1
server=/lan/192.168.100.1
domain=lan,192.168.0.0/24
conf-file=/etc/dnsmasq-dynamic-resolv.conf
resolv-file=/etc/dnsmasq-resolv.conf
#no-resolv
cvt 1600 900 60
xrandr --newmode "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync
xrandr --addmode eDP-1 1600x900_60.00
version: '2'
services:
zk-1:
image: mrhornsby/zookeeper:latest
expose:
- "2181"
ports:
- "2181:2181"
networks:
net:
"dein Scripts-----------------------------
" Required:
set runtimepath^=/home/thinktainer/.config/nvim/plugins/dein.vim/repos/github.com/Shougo/dein.vim
" Required:
if dein#load_state(expand('/home/thinktainer/.config/nvim/plugins/dein.vim'))
call dein#begin(expand('/home/thinktainer/.config/nvim/plugins/dein.vim'))
" Let dein manage dein
" Required:
interface=lo
bind-interfaces
listen-address=127.0.0.1
address=/dev/127.0.0.1
resolv-file=/etc/dnsmasq-resolv.conf
@thinktainer
thinktainer / Dockerfile
Last active January 23, 2017 15:03
Dockerfile for fakes3 without licence restriction
FROM alpine:3.5
RUN apk update && apk upgrade && apk --update add \
ruby ruby-rake ruby-io-console \
libstdc++ tzdata ca-certificates \
&& echo 'gem: --no-document' > /etc/gemrc \
&& gem install fakes3 -v 0.2.5 \
&& rm -rf /var/cache/apk/*
RUN mkdir -p /srv