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
services: | |
opentelemetry-collector-contrib: | |
image: otel/opentelemetry-collector-contrib:latest | |
ports: | |
- '4317:4317' | |
volumes: | |
- ./file-exporter:/file-exporter:rw | |
- ./otel-config.yml:/otel-config.yml | |
command: ['--config=/otel-config.yml'] |
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
import { | |
type AttributeValue, | |
type Context, | |
context, | |
type Counter, | |
type Meter, | |
propagation, | |
type Span, | |
SpanStatusCode, | |
trace, |
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 zx | |
const account = process.argv[3]; | |
const cluster = process.argv[4]; | |
const target = process.argv[5]; | |
const port = process.argv[6]; | |
if (!target || !port) { | |
console.error("Usage: forward.mjs <account> <cluster> <target> <port>"); | |
console.error("Example: forward.mjs 1234567890 cluster-dev my-api 8000"); | |
process.exit(1); |
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
version=$(curl -s -L -o /dev/null -w '%{url_effective}' https://github.com/protocolbuffers/protobuf/releases/latest | grep -oP 'tag/\Kv[^/]+') | |
version=${version#v} | |
url="https://github.com/protocolbuffers/protobuf/releases/download/v$version/protoc-$version-linux-x86_64.zip" | |
curl -O "$url" |
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 circularSeq[T any](values []T) iter.Seq[T] { | |
i := 0 | |
return func(yield func(T) bool) { | |
value := values[i] | |
i++ | |
if i == len(values) { | |
i = 0 | |
} | |
if !yield(value) { | |
return |
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 | |
fswatch -l 1 -o ./**/*.go --event=Updated | while read -r; do | |
clear | |
output=$(go test ./... 2>&1) | |
if echo "$output" | grep -- '- FAIL' > /dev/null; then | |
echo -e "\e[31m$(echo "$output" | awk '/--- FAIL/,/Test:/')\e[0m" | |
elif [ -z "$output" ]; then | |
echo -e "\e[31mBUILD FAILED\e[0m" | |
else | |
echo -e "\e[32mPASS\e[0m" |
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 log | |
import ( | |
"context" | |
"log/slog" | |
"os" | |
"runtime" | |
"github.com/bakins/slogotlp" | |
"github.com/covalenthq/lumberjack" |
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
curl -s https://api.github.com/repos/docker/compose/releases/latest | grep browser_download_url | grep -i "$(uname -s)-$(uname -m)" | cut -d '"' -f 4 | head -n 1 | xargs curl -L -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose |
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
#r "nuget: Confluent.Kafka" | |
#r "nuget: System.Text.Json" | |
open Confluent.Kafka | |
open System | |
open System.Text.Json | |
open System.Threading.Tasks | |
open Confluent.Kafka.Admin | |
let server = "localhost:9092" |
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
#r "nuget: PacketDotNet" | |
#r "nuget: SharpPcap" | |
open PacketDotNet | |
open SharpPcap | |
open System.Net.NetworkInformation | |
open System.Net | |
open System.IO | |
let deviceName = "eth0" |
NewerOlder