docker run --rm --privileged \
-v $PWD:/go/src/github.com/sj14/multicode \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/github.com/sj14/multicode \
-e GITHUB_TOKEN=YOURTOKEN \
-e GO111MODULE=on \
goreleaser/goreleaser --rm-dist --snapshot --skip-publish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o nounset # fail if an unset variable is used | |
set -o errexit # fail if a command exits with non-zero | |
set -o pipefail # fail if a command in a pipe fails | |
readonly TALOS_VESION=1.7.2 | |
readonly K8S_VERSION=1.30.1 | |
readonly CLUSTERS=( <cluster-1> <cluster-2> ) # <-- ADJUST ME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#set -o xtrace # output every line which gets executed | |
set -o nounset # fail if an unset variable is used | |
set -o errexit # fail if a command exits with non-zero | |
set -o pipefail # fail if a command in a pipe fails | |
recurse() { | |
for i in "$1"/*;do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o xtrace # output every line which gets executed | |
set -o nounset # fail if an unset variable is used | |
#set -o errexit # fail if a command exits with non-zero | |
set -o pipefail # fail if a command in a pipe fails | |
COUNTER=0 | |
while test $COUNTER -le 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Produce (context to kafka message header) | |
propagators := propagation.TraceContext{} | |
propagators.Inject(ctx, splunkkafka.NewMessageCarrier(msg)) | |
err := producer.Produce(msg, deliveryChan) | |
// Consume (kafka message headers to context) | |
message, err := client.ReadMessage(1 * time.Second) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func syncProduce(ctx context.Context, producer *kafka.Producer, topic string, key, data []byte) error { | |
if producer == nil { | |
return errors.New("nil producer") | |
} | |
if producer.IsClosed() { | |
return errors.New("closed producer") | |
} | |
deliveryChan := make(chan kafka.Event, 1) | |
// do not close the delivery channel, as messages still could be sent there, which would panic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func main() { | |
val := reflect.ValueOf(&MY_STRUCTURE).Elem() | |
printStructure(val, 4) | |
} | |
func printStructure(s reflect.Value, level int) { | |
for i := 0; i < s.NumField(); i++ { | |
f := s.Field(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Host Database | |
# | |
# localhost is used to configure the loopback interface | |
# when the system is booting. Do not change this entry. | |
## | |
127.0.0.1 localhost | |
255.255.255.255 broadcasthost | |
::1 localhost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
interfaces=( $(netstat -in | egrep 'utun\d .*\d+\.\d+\.\d+\.\d+' | cut -d ' ' -f 1) ) | |
rulefile="rules.tmp" | |
echo "" > $rulefile | |
sudo pfctl -a com.apple/tun -F nat | |
for i in "${interfaces[@]}" | |
do | |
RULE="nat on ${i} proto {tcp, udp, icmp} from 192.168.64.0/24 to any -> ${i}" | |
echo $RULE >> $rulefile | |
done |
I hereby claim:
- I am sj14 on github.
- I am simjue (https://keybase.io/simjue) on keybase.
- I have a public key ASD4NSo5o8EeuD_BFMsysgkVNqX-9Sbpyjqlk-w3qDqo1wo
To claim this, I am signing this object:
NewerOlder