Kubernetes Notes
Get Dashboard Token
# get the name of the dashboard token secret.
# e.g. kubernetes-dashboard-token-3anjf
kubectl get secrets -n kube-system
#!/bin/bash | |
# A script for shutting down an idle VM with GPUs attached when they are idle and there | |
# are no users logged in. Add the below crontab via `crontab -e` to run this script every | |
# 10 minutes and append its output to a log: | |
# | |
# */10 * * * * ~/shutdown_idle_gpu_machine.sh >> ~/shutdown_idle_gpu_machine.log 2>&1 | |
# | |
# This script should live in your HOME directory. Your user should have sudoer privileges. |
// Exercise: Equivalent Binary Trees (https://tour.golang.org/concurrency/7) | |
// There can be many different binary trees with the same sequence of values stored in it. | |
// For example, here are two binary trees storing the sequence 1, 1, 2, 3, 5, 8, 13. | |
// A function to check whether two binary trees store the same sequence is quite complex | |
// in most languages. We'll use Go's concurrency and channels to write a simple solution. | |
package main | |
import ( | |
"fmt" |
#!/bin/bash | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
CYAN='\033[0;36m' | |
NC='\033[0m' # no color | |
# attempts to download the URL specified as argument $1 using wget. If wget isn't | |
# installed it falls back to curl. If curl isn't installed it prints an error and | |
# exits. | |
# usage: download <url> <outfile> |
# get the name of the dashboard token secret.
# e.g. kubernetes-dashboard-token-3anjf
kubectl get secrets -n kube-system
The official Direwolf User Manual uses MacPorts to manage installation and dependencies. I don't particularly like MacPorts, so here are some instructions for installing Direwolf via Homebrew.
# Install Direwolf via Homebrew
brew install tdsmith/ham/direwolf
// MIT License | |
// | |
// (c) 2018 Brannon Dorsey <brannon@brannondorsey.com> | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
experiment_1/
hyperparameters.json
checkpoints/
(saved model weight checkpoints go in here)notes.txt
(general notes and comments about this experiment)experiment_2/
experiment_3/
etc.
A comparison of the Mean Squared Error algorithm in C, Python, and JavaScript.
gcc mse.c -O3 -o mse -lm
time ./mse
348.172699
// test if node's event loop is gauranteed to run events in the order they are | |
// pushed to the event queue. Turns out they DO NOT!!! 10,000 integers appended | |
// one after the other to append.txt using fs.appendFile() will NOT maintain | |
// the order of those ints. | |
const fs = require('fs') | |
function getAppend(i) { | |
return () => { | |
fs.appendFile('append.txt', `${i.toString().padStart(3)}\n`, (err) => { |
// JS in payloads/google-home.html | |
attack() | |
.then((json) => { | |
console.log('The attack was successful! Here is the JSON it exfiltrated:') | |
console.log(json) | |
}, | |
err => { | |
// there probably isn't even a machine with this IP address... | |
console.error('No Google Home found at this IP ') | |
} |