Skip to content

Instantly share code, notes, and snippets.

View kawsark's full-sized avatar
💭
Learning K8S from schoolofdevops

Kawsar Kamal kawsark

💭
Learning K8S from schoolofdevops
View GitHub Profile
#!/bin/bash
# Set variables
export PATH="$${PATH}:/usr/local/bin"
export local_ip="$(curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip)"
consul_version="1.7.2"
consul_url="https://releases.hashicorp.com/consul/${consul_version}/consul_${consul_version}_linux_amd64.zip"
curl "${consul_url}" -o consul.zip
@kawsark
kawsark / vault-agent-pki
Last active February 3, 2025 23:16
Vault Agent with PKI certificate rendering
### Configure variables
These variables will be used for this snippet. Please substitute accordingly.
```bash
export RootCAName="root_ca"
export InterCAName="inter_ca"
export CommonName="hashidemos.io"
export InterCommonName="inter.hashidemos.io"
export Root_CA_ttl="730h"
export Inter_CA_ttl="350h"
export Cert_ttl="8h"
@kawsark
kawsark / ring-battery.csv
Created February 14, 2024 14:15
RING Battery
Date Day Battery level Weather
Feb 14 1 77% Sunny
@kawsark
kawsark / nws-command.sh
Created October 10, 2024 14:04
Run command based on National Weather Service API from weather.gov
#!/bin/bash
# The command to run. Use operation=$1 to pass it in as a parameter.
OPERATION='kasa --type plug --alias "basement-fan" on'
# Threshold for maximum humidity
th=65
# Threshold for minimum temperature
tt=60