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
#Access istio proxy for concrete pod | |
kubectl -n $namespace $pod -c istio-proxy -- /bin/bash | |
#Use TCP dump to troubleshooting the requests | |
sudo tcpdump -vvv -i eth0 -A 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420' |
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
#List topics | |
kafka-topics --zookeeper zk01.example.com:2181 --list | |
#Get kafka offsets info from kafka internal topic with ssl configuration | |
#included formatter to translate binary data | |
kafka-console-consumer --bootstrap-server 10.180.48.138:19093 --topic __consumer_offsets \ | |
--formatter "kafka.coordinator.group.GroupMetadataManager\$OffsetsMessageFormatter" \ | |
--from-beginning --consumer-property bootstrap.servers=10.180.48.138:19093 \ | |
--consumer-property security.protocol=SSL \ | |
--consumer-property ssl.truststore.location=/etc/kafka/secrets/kafka.truststore.jks \ |
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
# Run container with docker context | |
docker run -it --privileged -v $PWD:/opt quay.io/buildah/stable:v1.14.0 bash | |
# Build image | |
buildah bud --format oci --storage-driver=vfs --layers -t image:version . | |
# Get ECR credentials | |
aws ecr get-login | |
export ECR_LOGIN=AWS | |
export ECR_TOKEN=... |
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
#Go templating with special characters: | |
#Check ephemeral storage per node due to pod eviction | |
kubectl get nodes $NODE_ID \ | |
-o go-template='{{ $ephemeral := index .status.allocatable "ephemeral-storage" }}{{ $ephemeral}}' |
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
#Download certs from site | |
echo "" | openssl s_client -host {HOST} -port 443 -showcerts | awk '/BEGIN CERT/ {p=1} ; p==1; /END CERT/ {p=0}' > allcerts.pem | |
#Import certs | |
keytool -import -alias your-alias -keystore cacerts -file certificate.der |
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 | |
set -exuo pipefail | |
[explanation](https://gist.github.com/mohanpedala/1e2ff5661761d3abd0385e8223e16425) | |
# kill all the child processes for this script when it exits | |
trap 'jobs=($(jobs -p)); ((${#jobs})) && kill "${jobs[@]}" || true; exit 0' TERM |
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 | |
podman run -d --name=gvisor-tap-vsock --privileged --net=host -it quay.io/crcont/gvisor-tap-vsock:v3 | |
podman generate systemd --restart-policy=no gvisor-tap-vsock > /etc/systemd/system/gvisor-tap-vsock.service | |
systemctl daemon-reload | |
systemctl enable gvisor-tap-vsock.service |
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
# Check rules | |
Get-DnsClientNrptRule | |
#Set metric to manage interface precedence order | |
Set-NetIPInterface -InterfaceIndex 17 -InterfaceMetric 15 | |
# Check / Set DNS address | |
Get-DnsClientServerAddress | |
Set-DnsClientServerAddress -InterfaceIndex 17 -ServerAddresses ("172.17.167.38") | |
Set-DnsClientServerAddress -InterfaceIndex 17 -ResetServerAddresses |
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
# Check largest files | |
sudo du -a /dir/ | sort -n -r | head -n 20 |
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
# Get ID | |
gpg --auto-key-locate keyserver --locate-keys [email protected] | |
# Export | |
gpg -ao mypub.key --export <MY_KEY_ID> | |
gpg -ao myprivate.key --export-secret-keys <MY_KEY_ID> | |
# Import | |
gpg --import myprivate.key | |
gpg --import mypub.key |
OlderNewer