#!/usr/bin/env bash
DB_USER="user"
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 | |
GHAPI="https://api.github.com" | |
REPO="neovim/nvim-lspconfig" | |
API_URL="$GHAPI/repos/$REPO/contents/lsp" | |
TMP_JSON="/tmp/nvim_lspconfig_lsp_files.json" | |
curl -s "$API_URL" -o "$TMP_JSON" |
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 | |
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server" sh -s - --disable-traefik | |
helm repo add traefik https://traefik.github.io/charts | |
helm install traefik traefik/traefik | |
# or | |
# helm install traefik oci://ghcr.io/traefik/helm/traefik |
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 jwk | |
import ( | |
"crypto/rsa" | |
"crypto/x509" | |
"encoding/base64" | |
"encoding/pem" | |
"fmt" | |
"math/big" | |
) |
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 PrintStructInTable(v interface{}) { | |
val := reflect.ValueOf(v) | |
typ := reflect.TypeOf(v) | |
// Ensure that the input is a struct | |
if typ.Kind() != reflect.Struct { | |
fmt.Println("Input is not a struct") | |
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
#!/usr/bin/env bash | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <json_file>" | |
exit 1 | |
fi | |
json_file="$1" | |
certificates=$(jq -c '.production.Certificates[]' $json_file) |
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 | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <container-id>" | |
exit 1 | |
fi | |
CONTAINER_ID=$1 | |
CPU_PERCENT=$(docker stats $CONTAINER_ID --no-stream --format "{{.CPUPerc}}" | tr -d '%') |
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
create or replace function gen_uuidv7() returns uuid as $$ | |
declare | |
begin | |
return gen_uuidv7(clock_timestamp()); | |
end $$ language plpgsql; | |
create or replace function gen_uuidv7(p_timestamp timestamp with time zone) returns uuid as $$ | |
declare | |
v_time numeric := null; | |
v_unix_t numeric := null; |
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 | |
encode() { | |
local input="$1" | |
if [ -z "$input" ]; then | |
input=$(cat) | |
fi | |
echo -n "$input" | base64 -w0 | tr '+/' '-_' | tr -d '=' | |
} |
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 | |
import ( | |
"fmt" | |
"regexp" | |
"golang.org/x/net/publicsuffix" | |
) | |
func isRootDomain(domain string) (bool, error) { |
NewerOlder