watch -n 0.5 "cat /proc/cpuinfo | grep MHz && echo && sensors"
watch cat /sys/devices/system/cpu/cpu{0..7}/cpufreq/cpuinfo_max_freq
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
watch -n 0.5 sudo tlp-stat -p
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
# Generate a Packer var file | |
cat <<EOF > packer-ova.json | |
{ | |
"vcenter_server":"vcenter.example.com", | |
"username":"me", | |
"password":"mypass", | |
"datacenter": "DC", | |
"datastore":"Datastore", | |
"folder": "foo", | |
"cluster": "10.1.2.3", |
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 -x | |
set -eou pipefail | |
gw=$(ip route | grep default | awk {'print $3'}) | |
echo Fixing DNS | |
chattr -i /etc/resolv.conf |
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
# Colors (Solarized Dark) | |
colors: | |
# Default colors | |
primary: | |
background: '#002b36' # base03 | |
foreground: '#839496' # base0 | |
# Cursor colors | |
cursor: | |
text: '#002b36' # base03 |
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
const maxAttempts = 10 | |
const retryIntervalSeconds = 5 | |
var sshConnected bool | |
log.Printf("Connecting to VM using SSH") | |
for i := 0; i < maxAttempts; i++ { | |
if i > 0 { | |
time.Sleep(time.Second * retryIntervalSeconds) |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Launch test function", | |
"type": "go", | |
"request": "launch", | |
"mode": "test", | |
"program": "${workspaceFolder}/bootstrap/kubeadm/internal/controllers", | |
"args": [ |
https://developers.google.com/calendar/api/quickstart/python#prerequisites
virtualenv venv
source venv/bin/activate
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
export container_name=$(docker ps --format '{{.Names}}' | grep test-.\*-control-plane)
export host_port=$(docker inspect $container_name -f '{{(index (index .NetworkSettings.Ports "6443/tcp") 0).HostPort}}')
docker exec $container_name cat /etc/kubernetes/admin.conf | sed "s/server: https:\/\/${container_name}:6443/server: https:\/\/localhost:${host_port}/" > /tmp/kubeconfig
export KUBECONFIG=/tmp/kubeconfig
kubectl get pods -A
I often need a local HTTPS server which simply responds with a self-signed certificate.
This server does just that in pure Go, without additional dependencies and without having to worry about generating the certificate (no more googling openssl
commands...).
go run main.go
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
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: kuard | |
labels: | |
app: kuard | |
spec: | |
replicas: 1 | |
selector: |
NewerOlder