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 | |
# https://stackoverflow.com/a/79334151/2597447 | |
# usage: | |
# ./git-commits-as-yaml.sh [rev-list options] | |
# | |
# examples, show last 3 commits as yaml: | |
# ./git-commits-as-yaml.sh HEAD~3..HEAD | |
# show all commits in branch as yaml: | |
# ./git-commits-as-yaml.sh |
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 | |
# usage: app-refresh kafka | |
set -eo pipefail | |
application=${1:-argocd-applications} | |
current_project=$(oc project | cut -d '"' -f 2) | |
cleanup () { | |
oc project "$current_project" &> /dev/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 | |
set -xeuo pipefail | |
ES_REST_BASEURL=${ES_REST_BASEURL:-https://localhost:9200} | |
ES_PATH_CONF=${ES_PATH_CONF:-/etc/elasticsearch} | |
function es { | |
path="$1" | |
shift | |
curl -s \ |
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/sh | |
# source: | |
# - https://staaldraad.github.io/2017/12/20/netstat-without-netstat/ | |
# - https://gist.github.com/staaldraad/4c4c80800ce15b6bef1c1186eaa8da9f | |
awk 'function hextodec(str,ret,n,i,k,c){ | |
ret = 0 | |
n = length(str) | |
for (i = 1; i <= n; i++) { | |
c = tolower(substr(str, i, 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
#!/usr/bin/env bash | |
# watches files recursively in folder, runs command upon changes | |
# usage: | |
# ./watch.sh folder command | |
# example: | |
# ./watch.sh lib make test | |
folder=$1 | |
shift |
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/sh | |
# https://github.com/eficode/wait-for | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2017 Eficode Oy | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal |
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 java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
public class SimpleJDBC { | |
public static void main(String[] args) throws Exception { | |
String db_url = "jdbc:oracle:thin:@localhost:1521/ORCLPDB1.localdomain"; | |
String schema = "NVMSADMIN"; |
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
function get_JSON(url) { | |
return new Promise((resolve, reject) => { | |
https.get(url, { | |
headers: { | |
'user-agent': 'arve0/nvdb-vegsystemreferanse', | |
'accept': 'application/json', | |
} | |
}, (res) => { | |
let body = ''; | |
res.on('data', (chunk) => { |
NewerOlder