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
events { | |
worker_connections 4096; ## Default: 1024 | |
} | |
http { | |
# DEBUG: | |
map $uri $proxy_uri_base { | |
"~/crypto-proxy/(?<proxy_base>[^/]*)" $proxy_base; | |
default $uri; | |
} |
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
# Grafana PDC -- private network tunnel | |
# This is templated by Terraform templatefile() | |
# https://grafana.com/docs/grafana-cloud/connect-externally-hosted/private-data-source-connect/configure-pdc/ | |
job "grafana-pdc" { | |
region = "global" | |
datacenters = ["${NOMAD_DATACENTER}"] | |
namespace = "${NOMAD_NAMESPACE}" | |
type = "service" |
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
// Copyright (c) 2024 Neomantra BV | |
// | |
// Opinionated Reader/Writer wrappers | |
package nmio | |
import ( | |
"compress/gzip" | |
"io" | |
"os" |
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 VerifyDirectoryExists(dirPath string) error { | |
if fileInfo, err := os.Stat(dirPath); err != nil { | |
if os.IsNotExist(err) { | |
return fmt.Errorf("directory '%s' does not exist", dirPath) | |
} else { | |
return fmt.Errorf("error filestat on '%s': %w", dirPath, err) | |
} | |
} else if !fileInfo.IsDir() { | |
return fmt.Errorf("'%s' exists but is not a directory", dirPath) | |
} |
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
// NewPointerValueMap converts a map[string]*T to a map[string]T, omitting nil pointers. | |
func NewPointerValueMap[K comparable, V any](src map[K]*V) map[K]V { | |
dst := make(map[K]V) | |
for k, ptr := range src { | |
if ptr != nil { | |
dst[k] = *ptr | |
} | |
} | |
return dst | |
} |
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
# adapted from https://github.com/neomantra/docker-onload/blob/master/jammy/Dockerfile | |
# install dependencies | |
sudo apt-get update -y | |
sudo apt-get install -y --no-install-recommends \ | |
autoconf \ | |
automake \ | |
ca-certificates \ | |
coreutils \ | |
curl \ |
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
[01;01H [2J | |
[13;50H -------- | |
[14;50H ////////\\ | |
[15;50H/ \\ | |
[16;50H| o o | | |
[17;50H| /_ @| | |
[18;50H \ / | |
[19;50H \ \__/ /\ | |
[20;50H \____/ | |
[06;45HHow badly does MIT |
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 perl | |
# From: https://klipkyle.gitlab.io/blog/2017-10-22-vt100-ani.html | |
# | |
# scat | |
# | |
# sleepy-cat - like cat, except delay a little bit to emulate the | |
# behavior of an old terminal | |
# | |
# By default a delay is inserted after every line feed (to emulate | |
# screen refresh), and a smaller delay is inserted between every |
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
-- converts thousands-separated numbers into plain numbers | |
-- for example: | |
-- cnum(0) == 0 | |
-- cnum(1,000) == 1000 | |
-- cnum(3,141,593) == 3141593 | |
-- cnum(-9,001) == -9001 | |
function cnum(...) | |
local superbase = 1000 | |
local sign = 1 | |
local result = 0 |
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
# Extract Pi from pi.neomantra.com | |
# IPv4 | |
dig pi.neomantra.com +short | |
# 3.141.59.26 | |
dig pi.neomantra.com +short | tr -d . | sed -re 's/^.{1}/&./' | |
# 3.1415926 |
NewerOlder