This file contains 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 * as dns from "node:dns"; | |
import { $ } from 'bun'; | |
const addrs = await dns.promises.resolveSrv("_web1._tcp.mydomain.local"); | |
console.log(addrs); |
This file contains 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
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml |
This file contains 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
docker pull registry.k8s.io/ingress-nginx/controller:v1.8.1 | |
docker pull registry.k8s.io/ingress-nginx/kube-webhook-certgen:v20230407 | |
kind load docker-image -n dev registry.k8s.io/ingress-nginx/controller:v1.8.1 | |
kind load docker-image -n dev registry.k8s.io/ingress-nginx/kube-webhook-certgen:v20230407 |
This file contains 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
cat <<EOF | kind create cluster --name dev --config=- | |
kind: Cluster | |
apiVersion: kind.x-k8s.io/v1alpha4 | |
nodes: | |
- role: control-plane | |
kubeadmConfigPatches: | |
- | | |
kind: InitConfiguration | |
nodeRegistration: | |
kubeletExtraArgs: |
This file contains 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 | |
openssl req -nodes -x509 -newkey rsa:2048 -keyout /etc/ssl/private/test.key -out /etc/ssl/private/test.crt -days 30 | |
cat /etc/ssl/private/test.key /etc/ssl/private/test.crt > /etc/ssl/private/test.pem | |
cat <<EOL >> /etc/haproxy/haproxy.cfg | |
defaults | |
mode http | |
timeout client 10s | |
timeout connect 5s | |
timeout server 10s |
This file contains 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 | |
# update, add docker gpg key, and docker apt repo | |
sudo apt update | |
sudo apt install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt update | |
apt-cache policy docker-ce | |
if [[ $(grep -i microsoft /proc/version) ]]; then |
This file has been truncated, but you can view the full file.
This file contains 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
[ | |
{ | |
"zipCode": "10100", | |
"subDistrictList": [ | |
{ | |
"subDistrictId": "100801", | |
"districtId": "1008", | |
"provinceId": "10", | |
"subDistrictName": "ป้อมปราบ" |
This file contains 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
killport() { | |
while test $# -gt 0 | |
do | |
port_number=$1 | |
pid=$(lsof -P | grep ':'$port_number'[[:space:]](LISTEN)' | awk '{print $2}') | |
if ! kill -QUIT $pid > /dev/null 2>&1; then | |
echo -e "\e[0;31mNo process running on \e[0m $port_number port" >&2 | |
else | |
echo -e "Kill $port_number \e[0;32msuccessfully\e[0m" | |
fi |
NewerOlder