Skip to content

Instantly share code, notes, and snippets.

View jmhublar's full-sized avatar
☘️
🐝

Joshua Hublar jmhublar

☘️
🐝
View GitHub Profile
@gswallow
gswallow / get-events-by-pod-name-fragment.sh
Last active February 2, 2023 21:24
Get events by pod name (or a fragment thereof)
#!/bin/bash
pod_name=$1
while true; do
kubectl get events --sort-by='.lastTimestamp' \
-ojson \
| jq -r '.items[] | select((.involvedObject.name | contains("'$pod_name'")) and (.involvedObject.kind=="Pod")) | "\(.lastTimestamp) [\(.count)] \(.message)"'
echo
echo "---------"
echo
@gswallow
gswallow / git.tf
Last active April 6, 2023 14:49
Git info for terraform states
terraform {
required_providers {
external = {
source = "hashicorp/external"
version = "~> 2"
}
}
}
data "external" "git_remote_url" {
"metrics": {
...
"disk": {
"measurement": [
"used_percent",
"inodes_free"
],
"metrics_collection_interval": 60,
"resources": [
"*"
# Instructions for fresh install
$ sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume --daemon
# reboot
$ source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
$ echo 'export NIX_PATH=darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH' | tee -a ~/.zshrc
$ echo 'source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh' | tee -a ~/.zshrc
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
$ nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
@BretFisher
BretFisher / docker-for-mac.md
Last active April 26, 2024 09:38
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no