Skip to content

Instantly share code, notes, and snippets.

@tyzbit
tyzbit / custom_host_lua_script.lua
Last active June 27, 2023 23:58
OPNSense ntopng call webhook when in a Google Meet
-- /usr/local/share/ntopng/scripts/callbacks/checks/hosts/custom_host_lua_script.lua
if (host.name() == "meet.google.com") then
local response, err = ntop.httpGet("https://home-assistant-url/api/webhook/webhook-url")
if err then
print("Webhook request for meet.google.com match failed: " .. err)
end
print("Active Google Meet in progress")
end
-- IMPORTANT: do not forget this return at the end of the script
@tyzbit
tyzbit / Shotcut APNG Preset
Last active February 17, 2023 04:47
Shotcut APNG Settings (For creating animated Discord stickers)
audio_off=1
f=apng
an=1
vcodec=apng
width=320
height=320
aspect=1
progressive=1
frame_rate_num=3000000
frame_rate_den=1000000
@tyzbit
tyzbit / kubeproxy.sh
Created October 22, 2022 00:47
Kube Proxy - Use a Kubernetes cluster to proxy out to somewhere else
function kubeproxy() {
setopt local_traps
pod_name="socat-$(whoami)"
if [[ "${2}x" == "x" ]]; then
echo "Usage: kubeproxy [Hostname] [Port]"
return 0
fi
if kubectl run --restart=Never --image=alpine/socat $pod_name -- -d -d tcp-listen:$2,fork,reuseaddr tcp-connect:$1:$2; then
while [[ $(kubectl get pod $pod_name -o json | jq -r '.status.phase') != "Running" ]]; do
sleep 0.1
@tyzbit
tyzbit / configmap.yaml
Last active October 15, 2022 23:58
How to mount configmap
apiVersion: v1
kind: ConfigMap
metadata:
name: file
namespace: default
data:
mycoolfile.txt: |
hey check out my cool file
@tyzbit
tyzbit / Feeds.opml
Created August 30, 2022 15:56
My RSS Feeds
<?xml version="1.0" encoding="UTF-8"?>
<opml version="2.0">
<head>
<title>Feeds</title>
</head>
<body>
<outline text="Anime" title="Anime">
<outline title="Anime News Network - News" htmlUrl="https://www.animenewsnetwork.com/news/" text="Anime News Network - News" type="rss" xmlUrl="https://www.animenewsnetwork.com/news/rss.xml?ann-edition=us" />
</outline>
<outline text="Crypto" title="Crypto">
@tyzbit
tyzbit / ginjson.go
Last active May 3, 2022 23:58
Gin JSON Formatter
func GinJSONFormatter(param gin.LogFormatterParams) string {
jsonFormat := `{"time":"%s","clientip":"%s","method":"%s","uri":"%s","status":%3d,"latency":"%v","message":"%s","host":"%s","useragent":"%s","proto":"%s","error_msg":"%s","size":%d}` + "\n"
return fmt.Sprintf(jsonFormat,
param.TimeStamp.Format(TimeFormatter),
param.ClientIP,
param.Method,
param.Request.RequestURI,
param.StatusCode,
param.Latency,
fmt.Sprintf("%s %s %s", param.Method, param.Request.URL, param.Request.Proto),
@tyzbit
tyzbit / tylertios_hot_sauces.md
Last active April 17, 2022 16:49
Tylertio's Hot Sauce Reviews

Tylertio's Hot Sauce Reviews


Hot sauces I like and would buy again


Iris Lune | Eclipse Hot Sauce ⭐️⭐️⭐️⭐️⭐️

Brooklyn alt-pop band Iris Lune (featuring HEATONIST's own Aaron Liao) teamed up with the Ontario hot sauce gurus at Dawson’s Hot Sauce for this peachy concoction. The heavier consistency and perfect blend of sweetness and mild heat make Eclipse great with salads, eggs, fried chicken, and even cheesecake. Enjoy while grooving out to Iris Lune’s equally spicy and flavorful music here: www.irislune.com

Ingredients: Peach, yellow pepper, vinegar, extra virgin, olive oil, garlic, sugar, Vietnamese red chili, salt.

@tyzbit
tyzbit / output
Created February 25, 2022 20:50
fio output
$ sudo fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=fiotest --filename=testfio --bs=4k --iodepth=64 --size=8G --readwrite=randrw --rwmixread=75
fiotest: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=64
fio-3.16
Starting 1 process
fiotest: Laying out IO file (1 file / 8192MiB)
Jobs: 1 (f=1): [m(1)][100.0%][r=511MiB/s,w=170MiB/s][r=131k,w=43.4k IOPS][eta 00m:00s]
fiotest: (groupid=0, jobs=1): err= 0: pid=2634098: Fri Feb 25 20:47:34 2022
read: IOPS=130k, BW=510MiB/s (534MB/s)(6141MiB/12049msec)
bw ( KiB/s): min=465664, max=565208, per=99.99%, avg=521844.38, stdev=27636.21, samples=24
iops : min=116416, max=141302, avg=130461.08, stdev=6909.07, samples=24
@tyzbit
tyzbit / helmrelease.yml
Created February 15, 2022 20:29
Longhorn RecurringJobs HelmRelease
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: longhorn-recurring-jobs
namespace: flux-system
spec:
targetNamespace: longhorn-system
releaseName: longhorn-recurring-jobs
chart:
spec:
@tyzbit
tyzbit / recurringjobs.yml
Last active August 11, 2023 13:20
Longhorn RecurringJobs
## The purpose of snapshots and backups are to be able to restore data to the last known good state
## either due to full data loss or corruption/unwanted data change
## Data properties:
## - Can change slowly or quickly.
## If the data changes quickly, we must snapshot/backup more frequently. We must also retain more.
## If the data changes slowly, we can snapshot less frequently
## - Is low priority or high priority.
## Low priority means we don't need offsite backups
## Medium priority means we need an offsite backup
## High priority means we need multiple historical offsite backups