Skip to content

Instantly share code, notes, and snippets.

View philoserf's full-sized avatar
Remote and happy

Mark Ayers philoserf

Remote and happy
View GitHub Profile
@philoserf
philoserf / clone-all-gists.sh
Last active October 2, 2023 12:43
clone all your gists
gh gist list -L 9999 |
cut -f 1 |
xargs -n1 gh gist clone
@philoserf
philoserf / new-mac-addr.sh
Last active October 2, 2023 12:44
new-mac-address
printf "starting mac addr: %s\n" "$(ifconfig en0 | grep ether)"
ifconfig en0 ether "$(openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/./0/2; s/.$//")"
printf "new mac addr: %s\n" "$(ifconfig en0 | grep ether)"
@philoserf
philoserf / remove-terminating-namespace.sh
Last active October 2, 2023 12:44
remove kubernetes namespace stuck in termiinating status
for ns in $(kubectl get ns --field-selector "status.phase=Terminating" --output "jsonpath='{.items[*].metadata.name}'"); do
kubectl get ns "${ns}" --output json |
jq '.spec.finalizers = []' |
kubectl replace --raw "/api/v1/namespaces/${ns}/finalize" --filename -
done
@philoserf
philoserf / main.go
Last active September 1, 2023 19:23
to, err := human()
package main
import (
"fmt"
"log"
)
func main() {
to, err := human()
if err != nil {