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:
/* | |
* By Simon Jürgensmeyer, 2014. | |
* based on the work of Nayuki Minase: | |
* http://nayuki.eigenstate.org/page/how-to-implement-the-discrete-fourier-transform | |
*/ | |
package main | |
import "fmt" | |
import "math" |
I hereby claim:
To claim this, I am signing this object:
#!/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 |
## | |
# 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 |
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) |
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 |
// 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) |
#!/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 |
#!/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 |