Compare commits

...

243 Commits

Author SHA1 Message Date
de8451e12b Switched hiddenbar for ice
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-07 07:07:35 +01:00
3d836bc810 Added spotmenu
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-07 06:56:58 +01:00
066e482fd8 Added Gifski
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-07 06:47:16 +01:00
c6a9a90dde Cleaned up GS leftovers
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-07 06:36:53 +01:00
1d34f433ef Removed GS tools
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-07 06:34:18 +01:00
8be57f1430 Handle removing old tools
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-07 06:19:23 +01:00
92b9c9d927 Remove karabiner-elements
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-06 18:24:34 +01:00
9334e7adcc Added tailscale app
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-06 18:23:36 +01:00
17ad5b51fc Added 1password
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-06 18:15:42 +01:00
7c99a558f6 Fixed install of some apps and config 2025-09-06 17:14:17 +01:00
fca2d9530e Added kind-list-images
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-03 11:00:41 +01:00
Marcus Noble
3ad35f41c3 Update kind-create-cluster to v1.34 by default 2025-09-03 10:10:32 +01:00
d98212c757 Update FPATH
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-29 10:09:22 +01:00
c879e18a89 Fix green colour
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-27 08:02:43 +01:00
4fb6921469 Added green colour util
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-27 07:58:36 +01:00
f4e7952130 Added baobab to install list
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-10 14:55:14 +01:00
716004c46b Added gpg config
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-09 10:06:34 +01:00
e2fb52f896 Enable syntax in vim:
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-09 09:41:47 +01:00
851be03ffc Removed screen dummp dir
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-07 20:47:39 +01:00
f7259cf9af Added more apps
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-07 20:47:22 +01:00
6bb71f487c Fix k9s screen dump dir
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-07 16:47:12 +01:00
2ad80a9c67 Added some more Mac-specific apps / installs
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-06 13:01:39 +02:00
14bc3b3b7c Various updates
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-06 09:57:01 +02:00
3e48fec287 Update git aliases to include PR link on publish
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-05-28 08:13:19 +01:00
ce1a34246e Updated k9s config
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-05-08 09:41:14 +01:00
fe5e9d9c9b Handle opening grafana via teleport
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-04-10 11:41:56 +01:00
a8f0d8d043 Fixed kind
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-02-07 13:47:10 +00:00
21f3d27493 Updated default kind version to 1.32
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-02-07 11:32:40 +00:00
18732d84e9 Added new Krew plugins - explore and blame
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-01-16 07:33:26 +00:00
58cbef9432 Added git release alias
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-01-09 05:26:37 +00:00
e8ba500810 Set git to follow tags by default
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-01-09 05:17:55 +00:00
14750b0260 Install opentofu
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-12-24 07:58:54 +00:00
21b88d4ec6 Upgraded default kind version
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-11-03 08:46:34 +00:00
74888271aa Added a kube-empty-namespace helper
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-09-19 09:54:39 +01:00
aab2b2a52f Added flag to skip confirmation when force-deleting
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-09-17 12:28:58 +01:00
2d78ed73c9 Added gs-ssh
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-08-30 13:42:25 +01:00
c305a854eb Fix path order
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-08-20 20:03:24 +01:00
d501fc75d0 Added kpexec
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-07-26 07:00:45 +01:00
5eaee93d3e Dont use prerelease when upgrading talos
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-07-19 11:58:47 +01:00
1e6b1a9c92 Added script to handle upgrading talos
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-06-24 10:26:01 +01:00
79fd63ec78 Added autorise
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-06-13 08:30:31 +01:00
951bbcc7fd Handle non-namespaced resouces
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-06-07 13:18:56 +01:00
a1cd7f9eae Fix standup/teardown
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-05-03 15:32:59 +01:00
aae5d5791d Updated standup/teardown
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-05-03 15:17:43 +01:00
7a7ceaa3bd Fix repo creation
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-04-25 10:32:35 +01:00
b7ab28935b Added azure-cli
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-04-04 11:32:10 +01:00
b60bf05177 Support audit policy when creating kind cluster
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-03-04 15:17:22 +00:00
028487c55a Ensure teleport cache directory is symlink
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-02-21 15:48:00 +00:00
071195304d Remove kubectx
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-02-20 08:50:40 +00:00
329f4124ae Updated kube-shell to work in rerstricted clusters
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-02-15 12:23:54 +00:00
d7469d40ae Added an --all flag to flux-pause
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-02-13 12:44:24 +00:00
e1aad7b032 Fix typo
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-02-12 09:05:49 +00:00
9c67d15489 Fix standup and teardown scripts
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-02-12 08:00:25 +00:00
67a6f50ca7 Fix gs-login
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-02-09 16:05:53 +00:00
6e93ae0969 Added gron
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-02-06 19:09:43 +00:00
6b44bf8ecc Added renovate-prs
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-02-06 19:09:29 +00:00
45c9d5afcb Stop brew updating everything all the time
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-01-21 18:26:04 +00:00
09a3059378 Added standup/teardown helpers
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-01-21 18:25:02 +00:00
625aa58ce9 Added support for Teleport to gs-login
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2024-01-18 09:08:17 +00:00
4bd7292f23 Added kubectl-iam4sa
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-12-01 08:01:12 +00:00
d207414434 Added Civo CLI
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-10-04 09:51:42 +01:00
0f584fd297 Added talosctl
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-10-03 17:22:01 +01:00
a822f82708 Add correct python bin dir to PATH
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-09-22 15:32:19 +01:00
4c10b4fb94 Remove python install dir from PATH
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-09-22 15:26:26 +01:00
ce98d5da65 Added Python install dir to PATH
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-09-22 15:23:40 +01:00
6e64c9dd6a Update kind kubeconfig
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-09-01 17:26:01 +01:00
5650fc8fdb Added kind helpers
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-09-01 16:44:24 +01:00
80710a2ccf Install openssh
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-08-17 07:26:14 +01:00
34ba64ab24 Ensure local dnsmasq is used for wifi
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-08-14 06:57:56 +01:00
1bbe379a34 Set DOCKER_HOST env var
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-07-06 10:17:43 +01:00
a0a1834112 Prevent pushing branches to kubernetes repos directly
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-07-03 09:06:07 +01:00
c44a00fbcb Ensure git publish uses fork remote if found
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-06-20 08:50:31 +01:00
4b3373f76f Fix namespace on flux-pause
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-06-08 10:29:45 +01:00
80ee8996de Speed up zsh startup
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-06-01 11:35:50 +01:00
3d1da1e586 Added flux-pause
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-05-12 10:52:15 +01:00
7f795ef69a Added Crane
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-05-12 09:10:08 +01:00
3df7db747b Checkout repo after create
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-04-13 07:13:10 +01:00
1cd2abbcc4 Added jq and yq testers
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-04-04 08:39:24 +01:00
b0a62568e9 Added tkn tab completion
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-03-31 07:45:22 +01:00
b2487b3642 Updated gs-create-repo
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-03-24 10:49:51 +00:00
642f685a03 Added watch
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-02-17 11:20:40 +00:00
4338fae15f Updated flux-refresh
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-02-02 15:33:07 +00:00
6336e83371 Added flux-refresh-all
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-02-01 18:42:20 +00:00
c306923371 Added flux
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-01-27 08:55:13 +00:00
2b6ac7ee27 Fixed gs-create-repo
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-01-23 09:18:49 +00:00
3d41d240b0 Fixed kube-schedule-anywhere
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-01-16 12:22:13 +00:00
c57251d4d5 Updated fzf usage and updated kube-ssh to use kubectl debug
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-01-04 23:38:25 +00:00
2a59d2b677 Changed location of symlinked gnu tools
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2023-01-04 23:38:03 +00:00
08c0c58227 Added util to lookup ec2 type availability
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-12-16 15:11:27 +00:00
5d22f6edc9 Disable AWS CLI pager output
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-12-15 13:17:00 +00:00
9d4ee4e95b Added podman
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-11-21 13:45:20 +00:00
b65b3ee032 Added kube-schedule-anywhere
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-11-21 13:45:05 +00:00
8ac6aef897 Added flux utils
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-11-11 14:39:30 +00:00
cdbd89cf3f Added kubeseal
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-11-07 18:54:50 +00:00
5064c29cb4 Added pulumi
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-11-06 14:29:37 +00:00
8795465b80 Use gnu base64
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-10-28 15:54:44 +01:00
e15ca89f5b Fixed quotes
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-10-28 07:38:54 +01:00
64fe2474da Better gnu util handling
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-10-28 07:22:31 +01:00
0eb4663dab Added bashrc
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-10-28 07:04:39 +01:00
a1d663d0d6 Added gnu sed
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-10-28 07:03:26 +01:00
a6d474a93f Fixed force deleting core resources
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-10-25 09:51:33 +01:00
1127b5fc64 Remove keepingyouawake
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-09-24 11:59:53 +01:00
1aa3722c02 Added find-empty-dirs
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-09-18 11:25:31 +01:00
53f6c16cf3 Added more mac apps
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-09-18 11:18:44 +01:00
855c741b0b Better handling of installed git
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-09-10 19:44:22 +01:00
7dd94b20e5 Pull out mac specific brew apps
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-09-09 08:58:02 +01:00
6870e67472 Fix apt
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-09-09 08:40:27 +01:00
2ffd1172bf More linux improvements
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-09-09 07:31:06 +01:00
9271bddf7a Linux improvements
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-09-09 07:04:34 +01:00
6b4546694b Switched to doggo
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-09-08 17:56:38 +01:00
b5b6d450eb Added golangci-lint
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-08-24 14:39:18 +01:00
03b058f685 Updated gs-create-repo with all steps
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-08-17 15:17:02 +01:00
5d965ade68 Added gs-create-repo command
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-08-17 12:41:22 +01:00
31ec51f982 Update gs-create-cluster for CAPA clusters
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-08-17 11:51:20 +01:00
0e3be2cb83 Added dnsmasq
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-08-15 16:33:30 +01:00
5b3cbc4cbd Fix typo
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-08-11 09:35:57 +01:00
375ae575e5 Added ssh hostname to starship config
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-08-06 21:56:42 +01:00
88474c7831 Updated kube-ssh to use alpine
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-07-15 08:00:35 +01:00
c991af3e0f Added auto update and tab completion for GS utils
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-07-15 07:53:44 +01:00
f363cabe84 Ensure AWS_PROFILE is unset
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-07-15 07:51:06 +01:00
93134c7f30 Added HA CLI
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-07-11 05:55:11 +01:00
cbe4bdc0d7 Switch to main after gs-release
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-07-08 07:53:28 +01:00
35853c10c2 Update default GCP project used
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-07-08 06:04:09 +01:00
6009f16f95 Start ssh agent
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-07-08 06:03:40 +01:00
5a5fa09e70 Added Viddy
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-06-26 10:00:42 +01:00
c49f1f1fc6 Improved output
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-06-22 09:07:06 +01:00
10a9883a84 Updated gs-create-cluster
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-06-17 06:32:41 +01:00
6680689910 Added kube-count-events
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-04-29 16:22:55 +02:00
b25a5c4c8d Tweaked kube-force-delete
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-04-06 05:54:27 +01:00
c5233d41e7 Updated force delete to take a label selector
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-04-05 21:26:27 +01:00
6c7aee7b93 Added litractl for controlling Litra Glow
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-04-01 16:11:01 +01:00
1313900363 Updated GPG
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-04-01 16:10:41 +01:00
843e1c6d20 Added git co alias
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-28 10:51:53 +01:00
e918596757 Added kapp
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-23 06:57:36 +00:00
37817394c4 Added tz
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-23 06:54:21 +00:00
475b4d3b5f Silence output
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-18 07:37:01 +00:00
28b8a20ff9 Removed GS specific aliases
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-18 07:36:52 +00:00
15ae2e615a Fixed disable webhook script
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-15 09:29:05 +00:00
4528e35872 Disable/enable webhooks
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-11 18:38:47 +00:00
381adefe87 Make things pretty
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-11 18:38:32 +00:00
b9647b569d More style tweaks
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-04 15:03:28 +00:00
03ec3eea98 Made things pretty
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-04 14:05:47 +00:00
d0b7ffb63b Added kube-force-delete script
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-03 09:22:27 +00:00
37497ee10a Added gs-open command:
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-02 07:56:15 +00:00
a08cb76510 Removed GS specific completion setup
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-02 07:46:04 +00:00
495da19e85 Added script for handling AWS CLI login
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-01 11:50:41 +00:00
dfba592831 Ensure new context used each login
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-01 11:49:13 +00:00
0ab4e25456 Handle new repos with no tags
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-03-01 11:48:47 +00:00
758298694c Updated gs-login to remove old flags
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-02-22 10:16:24 +00:00
8dcba62bee Added script to update GS tools
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-02-22 08:42:51 +00:00
18bd3c0985 Updated gs-login to support new opsctl login
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-02-21 14:17:10 +00:00
99a1ef4575 Added jless install
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-02-21 14:16:52 +00:00
4b006c5c43 Added kube-restarting
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-02-07 12:26:58 +00:00
ecb3beec8f Added lastpass CLI 2022-01-26 10:26:33 +00:00
693bb7a0e9 Added Vale
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-01-25 06:22:53 +00:00
9bb937fbe3 Fixed namespace
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-01-20 15:02:02 +00:00
f50d6136b9 Added kube-template and kube-trigger-cronjob
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-01-20 08:58:17 +00:00
6462c06743 Switch yq binary
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-01-20 08:57:46 +00:00
dc6bf17452 Added release notes to gs-release
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-01-19 11:18:11 +00:00
4265bf76ce Added tabby to install list
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-01-09 19:06:41 +00:00
ee191f8bd2 Added tabby
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-01-09 14:28:57 +00:00
f13e42df13 Added stats and stern install
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-01-07 08:03:52 +00:00
6e2ad466d7 Updated gs-login to support old orgs in default
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-01-05 06:16:01 +00:00
e8fd0e0be6 Added vault cli
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2022-01-04 11:46:34 +00:00
bca70e0e01 Fix install script
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-24 10:29:45 +00:00
e3dcb1da3d Fixed bash arrays in gs-release
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-17 07:25:45 +00:00
1568e5a56f Ensure default namespace is used
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-15 10:46:43 +00:00
fc58941ad1 Added more krew plugins
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-14 15:53:57 +00:00
1cfabac2f5 Fix login fallback
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-14 15:53:44 +00:00
d0556dc92f Cleaned up pre-flight checks
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-14 08:24:18 +00:00
d28d49cb04 Ensure MC context is updated each time gs-login is used
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-14 08:07:58 +00:00
3024bbd0cc Added lookup for MC if no args given to gs-login
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-14 07:49:42 +00:00
586538f14f Catch errors rather than exit early
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-13 15:11:38 +00:00
56e07cfd24 Set kubeconfig file on login
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-13 15:11:17 +00:00
f79c757168 Install yq
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-13 15:11:01 +00:00
83978cc429 Fix namespace selector
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-08 08:34:05 +00:00
1dfe84005b Fix bash substring for older bash
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-08 08:22:05 +00:00
927cf87bae MC login fallback if Dex down
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-07 13:04:19 +00:00
622b9b16a8 Fix gs-login
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-07 12:44:20 +00:00
b1ca06ca1c Improved gs-login
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-07 10:08:44 +00:00
6ab3606e20 Fix defaul namespace if not in config
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-06 09:34:16 +00:00
8752ee0267 Ignore kube clusters
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-06 07:41:58 +00:00
fd2f36cab0 Added git push config
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-06 07:41:33 +00:00
21dc2e7a00 Update git take command
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-03 18:42:46 +00:00
0b43014820 Ignore kube files
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-03 18:23:52 +00:00
09248c19cd Fix exec perm
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-03 18:20:33 +00:00
57ee208407 Fixed for MacOS
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-12-03 17:12:52 +00:00
3990c8fd9c Refactor to support multiple OS's
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-11-29 08:07:17 +00:00
48ad89385b Updated kube alises
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-11-26 13:22:19 +00:00
5d4a7758c0 Tweaked zsh autocomplete
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-10-27 08:18:24 +01:00
581c598ed3 Added GPG
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-10-15 11:06:16 +01:00
c72372296c Sign all commits
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2021-10-14 16:30:23 +01:00
9247ec3937 Added git diff pager 2021-10-14 16:27:11 +01:00
383e96efec Merge branch 'master' of https://git.cluster.fun/AverageMarcus/dotfiles 2021-10-14 10:12:15 +01:00
edfbcee609 Lots of changes 2021-10-14 10:11:17 +01:00
Marcus Noble
07d93ee063 Merge pull request #1 from AverageMarcus/remove_asdf 2021-10-03 14:19:02 +01:00
Marcus Noble
5c6919591b Removed asdf 2021-10-03 14:18:02 +01:00
Marcus Noble
7a0806ce75 Added git split-diff 2021-07-26 07:36:38 +01:00
Marcus Noble
6081c13f66 Fix asdf 2021-07-26 07:34:21 +01:00
Marcus Noble
b04d770a26 Dont show AWS prompt from plugin 2021-07-26 06:53:44 +01:00
Marcus Noble
723b7be4e5 Update oh-my-zsh 2021-07-26 06:51:50 +01:00
3335b8fd82 Improved startup performance and switched pkg managers 2021-07-26 04:40:27 +01:00
d095509d3a fix: k9s config 2021-07-24 16:37:56 +01:00
223d9f28a5 Fixed makefile 2021-07-21 08:48:38 +01:00
Marcus Noble
e7dadd014f Added zsh plugins 2021-07-19 07:33:55 +01:00
05fd6a64bd Added kubebulder to path 2021-07-10 09:09:14 +01:00
4b787f5046 Merge branch 'master' of https://git.cluster.fun/AverageMarcus/dotfiles 2021-07-10 09:08:42 +01:00
Marcus Noble
61545c7939 Removed k9s cluster details 2021-07-02 07:04:19 +01:00
Marcus Noble
7c5f0aba60 Added rustup 2021-07-01 07:14:11 +01:00
2cd75934ac Updated installed cli tools and aliases 2021-06-27 17:27:40 +01:00
4a0c464704 Updated installed cli tools and aliases 2021-06-27 17:27:40 +01:00
a6b8d2b29e Updated 2021-06-08 08:55:29 +01:00
5cf171a14e Updated 2021-06-08 08:55:29 +01:00
Marcus Noble
072aeb4c42 Changed default git branch 2021-06-08 08:53:38 +01:00
Marcus Noble
a867f65a7a Changed default git branch 2021-06-08 08:53:38 +01:00
Marcus Noble
8fd8077ba1 Fixed changelog-changed for non-master 2021-06-07 15:11:10 +01:00
Marcus Noble
e1a40415c6 Fixed changelog-changed for non-master 2021-06-07 15:11:10 +01:00
ff544ee43e added git-clone alias 2021-05-16 12:01:32 +01:00
17e691cf96 added git-clone alias 2021-05-16 12:01:32 +01:00
Marcus Noble
b171074349 Updated k9s config / skin 2021-05-14 05:50:31 +01:00
Marcus Noble
a1b136155b Updated k9s config / skin 2021-05-14 05:50:31 +01:00
Marcus Noble
18a78386a4 Fixed k9s linking 2021-05-14 05:38:41 +01:00
Marcus Noble
fe445a48f1 Fixed k9s linking 2021-05-14 05:38:41 +01:00
Marcus Noble
13a55a8b7a Updated some starship and added doggo alias 2021-05-13 14:18:57 +01:00
Marcus Noble
4f3b5b18d1 Updated some starship and added doggo alias 2021-05-13 14:18:57 +01:00
Marcus Noble
299f345a54 Updated starship config 2021-05-10 11:21:26 +01:00
Marcus Noble
f67e206fc9 Updated starship config 2021-05-10 11:21:26 +01:00
Marcus Noble
d92841b3f4 Handle git email 2020-12-07 07:07:54 +00:00
Marcus Noble
c0751c5633 Handle git email 2020-12-07 07:07:54 +00:00
5315d95298 Added make task to upgrade deps 2020-12-07 06:39:28 +00:00
91f4909c0d Always use ssh for GitHub 2020-12-07 06:39:16 +00:00
97580de535 Remove prefix 2020-12-06 13:20:26 +00:00
f7e3bf6af9 Merge branch 'master' of https://git.cluster.fun/AverageMarcus/dotfiles into master 2020-11-25 17:25:11 +00:00
67de5ca347 Fix AWS 2020-11-25 17:24:16 +00:00
17c24459cd Avoid using exa my mistake 2020-11-25 17:24:10 +00:00
0132d1b125 Update '.config/starship.toml' 2020-11-20 08:02:29 +00:00
Marcus Noble
cffe261765 Fix typo in pre-req task 2020-10-13 14:18:12 +01:00
Marcus Noble
b8e7fffb40 fix assume role 2020-10-13 10:44:32 +01:00
Marcus Noble
7fd182569b Added aws-specific helpers 2020-10-13 10:18:20 +01:00
7b57da7ac9 Support additional dotfiles 2020-10-03 08:27:31 +01:00
cfed6832ad Update dotfiles 2020-09-27 19:58:44 +01:00
387deecb80 Add '.k9s/skin.yml' 2020-09-17 02:17:53 +00:00
15c860b0fe Add '.k9s/config.yml' 2020-09-17 02:17:36 +00:00
77 changed files with 3397 additions and 666 deletions

View File

@@ -1,50 +0,0 @@
format = """\
$directory\
$git_branch\
$git_commit\
$git_state\
$git_status\
$package\
$golang\
$nodejs\
$terraform\
$memory_usage\
$aws\
$kubernetes\
$cmd_duration\
$custom\
$line_break\
$jobs\
$battery\
$time\
$character\
"""
[character]
success_symbol = "[✨](yellow)"
error_symbol = "[✗](red)"
use_symbol_for_status = true
[aws]
symbol = " "
displayed_items = "profile"
[docker]
symbol = " "
[git_commit]
only_detached = true
[golang]
symbol = " "
[kubernetes]
symbol = "ﴱ "
style = "bold blue"
disabled = false
[terraform]
show_version = true
[nodejs]
symbol = " "

View File

@@ -1,17 +0,0 @@
# Aliases
alias grep='grep --color=auto'
alias watch='watch '
alias cat=' bat '
alias curl='curlie'
alias tmp='cd $(mktemp -d)'
alias ls=' exa --group-directories-first --icons --header --git --ignore-glob=.git'
lt() {
DEPTH=$(echo $1 | grep "^[0-9]*$")
if [ "$DEPTH" = "" ]; then
DEPTH=2
else
shift
fi
ls -l --tree -L $DEPTH -I ".git|cache|log|logs|node_modules|vendor" $@
}
alias aws='docker run --rm -ti -v ~/.aws:/root/.aws -v $(pwd):/aws -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY amazon/aws-cli'

View File

@@ -1,24 +0,0 @@
alias aws='docker pull -q amazon/aws-cli:latest 1> /dev/null && docker run --rm -i -v ~/.aws:/root/.aws -v $(pwd):/aws -e NO_COLOR=true -e AWS_PROFILE -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN amazon/aws-cli'
assume-role() {
ROLE=$1
if [[ -z "$ROLE" ]]; then
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export AWS_SESSION_TOKEN=
else
OUTPUT=$(aws sts assume-role --role-arn $ROLE --role-session-name assumed-role-session --query Credentials --output json)
export AWS_ACCESS_KEY_ID=$(echo $OUTPUT | jq -r .AccessKeyId)
export AWS_SECRET_ACCESS_KEY=$(echo $OUTPUT | jq -r .SecretAccessKey)
export AWS_SESSION_TOKEN=$(echo $OUTPUT | jq -r .SessionToken)
fi
aws sts get-caller-identity
}
aws-decode-message() {
ENCODED=$1
aws sts decode-authorization-message --query DecodedMessage --output text --encoded-message $ENCODED | jq -r '.context.action, .context.resource'
}

View File

@@ -1,21 +0,0 @@
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/goworkspace/bin"
export EDITOR='vim'
export VISUAL='code'
# AWS
if [ -f ~/.aws/profile ]; then
export AWS_PROFILE=$(cat ~/.aws/profile)
export AWS_DEFAULT_REGION=eu-west-1
export AWS_REGION=eu-west-1
fi
# Node
export NODE_ENV=localhost
export NPM_TOKEN=`head -n 1 ~/.npmrc | sed 's~//registry.npmjs.org/:_authToken=\(.*\)~\1~'`
# Go
export GOPATH=$HOME/goworkspace
export GO111MODULE=on
# Krew
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"

View File

@@ -1,167 +0,0 @@
alias k='kubectl '
alias kshell='kubectl run -it shell --image bash --restart Never --rm -- sh'
kiam () {
kubectl run -it shell --image docker-tiocoreeng-apps-virtual.bts.artifactory.tio.systems/aws-cli:latest --env=AWS_DEFAULT_REGION=eu-west-1 --overrides="{ \"metadata\": { \"annotations\": { \"iam.amazonaws.com/role\": \"$1\" } } }" --command bash --restart Never --rm
}
kube-ssh() {
sh -c "$(curl -sSL https://raw.githubusercontent.com/AverageMarcus/kube-ssh/master/ssh.sh)"
}
kube-forward() {
if [ -n "$ZSH_VERSION" ]; then
setopt LOCAL_OPTIONS NO_NOTIFY NO_MONITOR
fi
IFS=$'\n'
SERVICES=( $(kubectl get service --no-headers -o json | jq '[.items[] | select(.metadata.annotations."kube-forward" != "false")] | (.[] | .metadata.name + "\t" + ([.spec.ports[].port] | join(",")))' -r | column -t) )
unset IFS
TO_KILL=()
cleanup() {
echo "\nClosing connections..."
for pid in "${TO_KILL[@]}"
do
(kill -2 $pid) &> /dev/null
done
trap - INT TERM
}
trap 'cleanup' INT TERM
HOST_PORT=9001
echo "Forwarding..."
for s in "${SERVICES[@]}"
do
SERVICE=( $(echo $s) )
if [ -n "$ZSH_VERSION" ]; then
NAME=${SERVICE[1]}
PORT=${SERVICE[2]}
else
NAME=${SERVICE[0]}
PORT=${SERVICE[1]}
fi
PORTS=($(echo $PORT | tr "," "\n"))
for PORT in "${PORTS[@]}"
do
(kubectl port-forward svc/$NAME $HOST_PORT:$PORT > /dev/null 2>&1) &
BG_PID=$!
if `curl -s -o /dev/null --retry 5 --retry-delay 0 --retry-connrefused -m 3 http://localhost:$HOST_PORT`
then
echo "\e[1m$NAME:$PORT\e[0m ➡ \e[34mhttp://localhost:$HOST_PORT\e[0m"
TO_KILL+=($BG_PID)
((HOST_PORT=HOST_PORT+1))
else
(kill -2 $BG_PID) &> /dev/null
fi
done
done
echo "\n\e[2m(Use [Ctl + C] to exit)"
cat
if [ -n "$BASH_VERSION" ]; then
cleanup
fi
}
source <(kubectl completion zsh)
## Merge multiple kubeconfigs
function join_by { local d=$1; shift; echo -n "$1"; shift; printf "%s" "${@/#/$d}"; }
KUBECONFIG="$HOME/.kube/config"
OTHER_CLUSTERS="$(join_by :$HOME/.kube/clusters/ $(echo $HOME/.kube/clusters/$(/bin/ls $HOME/.kube/clusters)))"
export KUBECONFIG=$KUBECONFIG:$OTHER_CLUSTERS
## Kubectl exec
kx () {
local pod=($(kubectl get pods --all-namespaces -owide | fzf | awk '{print $1, $2}'))
local cmd=${@:-"sh"}
echo kubectl exec -it --namespace $pod[1] $pod[2] $cmd
kubectl exec -it --namespace $pod[1] $pod[2] $cmd
}
## Kubectl logs
kl () {
local pod=($(kubectl get pods --all-namespaces -owide | fzf | awk '{print $1, $2}'))
local attr=${@:-""}
echo kubectl logs -f $attr --namespace $pod[1] $pod[2]
kubectl logs -f $attr --namespace $pod[1] $pod[2]
}
## Display everything
kall () {
kubectl get all --all-namespaces
}
kctx () {
KUBECONFIG="$HOME/.kube/config"
OTHER_CLUSTERS="$(join_by :$HOME/.kube/clusters/ $(echo $HOME/.kube/clusters/$(ls $HOME/.kube/clusters)))"
export KUBECONFIG=$KUBECONFIG:$OTHER_CLUSTERS
kubectx $@
}
k-version-test() {
VERSION=""
FILES=""
while test $# -gt 0; do
case "$1" in
-v|--version)
shift
VERSION=$1
shift
;;
-f|--files)
shift
FILES=$1
shift
;;
-h|--help)
echo "k-version-test - test Kubernetes manifest files against different versions of Kubernetes"
echo " "
echo "k-version-test [options]"
echo " "
echo "Options:"
echo "-h, --help show this help text"
echo "-v, --version the version of kubernetes to test against"
echo "-f, --files the manifest file(s) to test against"
return 0
;;
*)
break
;;
esac
done
which kind &> /dev/null || (echo "'kind' not installed. Follow install instructions here: https://github.com/kubernetes-sigs/kind/"; return 1)
if [ ! -z $VERSION ];
then
TAG=$(curl -s 'https://registry.hub.docker.com/v2/repositories/kindest/node/tags/' | jq '."results" | map(.name | select(startswith("v'$VERSION'"))) | .[0]' | xargs)
kind create cluster --image kindest/node:$TAG
else
kind create cluster
fi
echo
if kubectl apply --dry-run -f $FILES ; then
echo "\n☸ Kubernetes $VERSION. Result: ✅\n"
else
echo "\n☸ Kubernetes $VERSION. Result: ❌\n"
fi
kind delete cluster
}
fix-broken-replicasets() {
kubectl get replicasets --all-namespaces -o jsonpath='{range .items[?(@.status.replicas==0)]}--namespace {@.metadata.namespace} {@.metadata.name};{end}' | tr ";" "\n" | xargs -I {} sh -c "kubectl delete rs {}"
}
source <(tkn completion zsh)

View File

@@ -1,23 +0,0 @@
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use
fi
elif [ "$node_version" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use 4 #default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc

View File

@@ -1,45 +0,0 @@
[user]
name = Marcus Noble
email = github@marcusnoble.co.uk
[core]
editor = /usr/bin/vim
excludesfile = ~/.gitignore
[push]
default = simple
[credential]
helper = store
[color]
ui = true
[color "diff"]
old = red strike
new = green italic
[alias]
basename = "!git remote -v | head -n1 | awk '{print $2}' | sed 's/.*\\///' | sed 's/\\.git//'"
org-name = "!git remote -v | grep -m 1 -o ':.*/' | sed 's:^.\\(.*\\).$:\\1:'"
branch-name = "!git rev-parse --abbrev-ref HEAD"
changelog-changed = "!test $(git diff --name-only HEAD origin/master | grep CHANGELOG.md | wc -l | xargs) = 1"
main = "!git remote set-head origin --auto && git checkout $(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') && git pull"
publish = "!func(){ if [[ $(git branch-name) != \"$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')\" ]]; then git push -u origin $(git branch-name) && (git changelog-changed || echo '\n\n⚠ Dont forget to update changelog ⚠️ ') ; else echo "Wat?!"; fi; }; func"
cleanup = "!git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done"
dont-change-file = "!git update-index --assume-unchanged"
ignore-file = "!git update-index --skip-worktree"
remember-file = "!git update-index --no-skip-worktree"
logg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
dif = "!git diff -w"
pop = "!git stash pop"
[help]
autocorrect = 1
[diff]
compactionHeuristic = true
[url "ssh://git@github.com"]
insteadOf = https://github.com

10
.gitignore vendored
View File

@@ -22,3 +22,13 @@
.env .env
*.log *.log
/os-specific/darwin/home/.gnupg/*
!/os-specific/darwin/home/.gnupg/gpg-agent.conf
/home/.kube/*
!/home/.kube/clusters/.gitkeep
!/home/.kube/switch-config.yaml
/home/.k9s/benchmarks
/home/.k9s/clusters
/home/.k9s/screen-dumps

156
.hyper.js
View File

@@ -1,156 +0,0 @@
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
scrollback: 100000,
// default font size in pixels for all tabs
fontSize: 13,
// font family with optional fallbacks
fontFamily: '"OpenDyslexicMono Nerd Font", "Fira Code", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// default font weight: 'normal' or 'bold'
fontWeight: 'normal',
// font weight for bold characters: 'normal' or 'bold'
fontWeightBold: 'bold',
// line height as a relative unit
lineHeight: 1,
// letter spacing as a relative unit
letterSpacing: 0,
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
// terminal text color under BLOCK cursor
cursorAccentColor: '#000',
// `'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for █
cursorShape: 'BEAM',
// set to `true` (without backticks and without quotes) for blinking cursor
cursorBlink: true,
// color of the text
foregroundColor: '#fff',
// terminal background color
// opacity is only supported on macOS
backgroundColor: '#000',
// terminal selection color
selectionColor: 'rgba(248,28,229,0.3)',
// border color (window, tabs)
borderColor: '#333',
// custom CSS to embed in the main window
css: `.line {
color: #999;
stroke: #999;
}`,
// custom CSS to embed in the terminal window
termCSS: '',
// if you're using a Linux setup which show native menus, set to false
// default: `true` on Linux, `true` on Windows, ignored on macOS
showHamburgerMenu: '',
// set to `false` (without backticks and without quotes) if you want to hide the minimize, maximize and close buttons
// additionally, set to `'left'` if you want them on the left, like in Ubuntu
// default: `true` (without backticks and without quotes) on Windows and Linux, ignored on macOS
showWindowControls: '',
// custom padding (CSS format, i.e.: `top right bottom left`)
padding: '12px 14px',
// the full list. if you're going to provide the full color palette,
// including the 6 x 6 color cubes and the grayscale map, just provide
// an array here instead of a color map object
colors: {
black: '#000000',
red: '#C51E14',
green: '#1DC121',
yellow: '#C7C329',
blue: '#0A2FC4',
magenta: '#C839C5',
cyan: '#20C5C6',
white: '#C7C7C7',
lightBlack: '#686868',
lightRed: '#FD6F6B',
lightGreen: '#67F86F',
lightYellow: '#FFFA72',
lightBlue: '#6A76FB',
lightMagenta: '#FD7CFC',
lightCyan: '#68FDFE',
lightWhite: '#FFFFFF',
},
// the shell to run when spawning a new session (i.e. /usr/local/bin/fish)
// if left empty, your system's login shell will be used by default
//
// Windows
// - Make sure to use a full path if the binary name doesn't work
// - Remove `--login` in shellArgs
//
// Bash on Windows
// - Example: `C:\\Windows\\System32\\bash.exe`
//
// PowerShell on Windows
// - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`
shell: '',
// for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
// by default `['--login']` will be used
shellArgs: ['--login'],
// for environment variables
env: {},
// set to `false` for no bell
bell: `false`,
// if `true` (without backticks and without quotes), selected text will automatically be copied to the clipboard
copyOnSelect: false,
// if `true` (without backticks and without quotes), hyper will be set as the default protocol client for SSH
defaultSSHApp: true,
// if `true` (without backticks and without quotes), on right click selected text will be copied or pasted if no
// selection is present (`true` by default on Windows and disables the context menu feature)
// quickEdit: true,
// URL to custom bell
// bellSoundURL: 'http://example.com/bell.mp3',
// for advanced config flags please refer to https://hyper.is/#cfg
},
// a list of plugins to fetch and install from npm
// format: [@org/]project[#version]
// examples:
// `hyperpower`
// `@company/project`
// `project#1.0.1`
plugins: ["hyper-search", "hyperterm-paste", "hyper-tabs-enhanced", "hyper-chesterish", "hyper-quit"],
// in development, you can create a directory under
// `~/.hyper_plugins/local/` and include it here
// to load it and avoid it being `npm install`ed
localPlugins: [],
keymaps: {
// Example
// 'window:devtools': 'cmd+alt+o',
},
};

View File

@@ -1,22 +0,0 @@
k9s:
refreshRate: 2
headless: false
readOnly: false
noIcons: false
logger:
tail: 100
buffer: 5000
sinceSeconds: -1
fullScreenLogs: false
textWrap: false
showTime: false
currentContext:
currentCluster:
clusters:
thresholds:
cpu:
critical: 90
warn: 80
memory:
critical: 90
warn: 80

View File

@@ -1,66 +0,0 @@
k9s:
body:
fgColor: "#97979b"
bgColor: "#414446"
logoColor: "#5af78e"
info:
fgColor: white
sectionColor: "#5af78e"
frame:
border:
fgColor: "#5af78e"
focusColor: "#5af78e"
menu:
fgColor: white
keyColor: "#57c7ff"
numKeyColor: "#ff6ac1"
crumbs:
fgColor: "#414446"
bgColor: white
activeColor: "#f3f99d"
status:
newColor: "#eff0eb"
modifyColor: "#5af78e"
addColor: "#57c7ff"
errorColor: "#ff5c57"
highlightcolor: "#f3f99d"
killColor: mediumpurple
completedColor: gray
title:
fgColor: "#5af78e"
bgColor: "#414446"
highlightColor: white
counterColor: white
filterColor: "#57c7ff"
views:
# Charts skins...
charts:
bgColor: default
defaultDialColors:
- "#57c7ff"
- "#ff5c57"
defaultChartColors:
- "#57c7ff"
- "#ff5c57"
table:
fgColor: "#57c7ff"
bgColor: "#414446"
cursorColor: "#5af78e"
markColor: darkgoldenrod
header:
fgColor: white
bgColor: "#414446"
sorterColor: orange
xray:
fgColor: "#57c7ff"
bgColor: "#414446"
cursorColor: "#5af78e"
graphicColor: darkgoldenrod
showIcons: false
yaml:
keyColor: "#ff5c57"
colonColor: white
valueColor: "#f3f99d"
logs:
fgColor: white
bgColor: "#414446"

9
.zshrc
View File

@@ -1,9 +0,0 @@
for filename in ~/.dotfiles/*; do
source $filename
done
for filename in ~/.additional_dotfiles/*; do
source $filename
done
eval "$(starship init zsh)"

View File

@@ -1,62 +1,8 @@
SHELL := bash SHELL := bash
.PHONY: Install .PHONY: Install
install: pre-reqs dotfiles ## Installs all dotfiles and associated. install: ## Installs all dotfiles and associated.
@bash ./install.sh
.PHONY: pre-reqs
pre-reqs: ## Install all required binaries.
which brew > /dev/null || bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"; \
[ -d ~/.oh-my-zsh ] || sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; \
brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null || brew install homebrew/cask-fonts/font-open-dyslexic-nerd-font; \
which fzf > /dev/null || brew install fzf; \
which bat > /dev/null || brew install bat; \
which curlie > /dev/null || brew install rs/tap/curlie; \
which exa > /dev/null || brew install exa; \
which kubectl > /dev/null || brew install kubectl; \
which tkn > /dev/null || brew install tektoncd/tools/tektoncd-cli; \
which k9s > /dev/null || brew install k9s; \
which helm > /dev/null || brew install helm; \
which go > /dev/null || brew install go; \
which jq > /dev/null || brew install jq; \
which kind > /dev/null || brew install kind; \
which kubectx > /dev/null || brew install kubectx; \
which tldr > /dev/null || brew install tldr; \
which progress > /dev/null || brew install progress; \
which htop > /dev/null || brew install htop; \
which starship > /dev/null || brew install starship
.PHONY: upgrade
upgrade: ## Upgrade all required binaries.
brew list --cask homebrew/cask-fonts/font-open-dyslexic-nerd-font > /dev/null && brew upgrade homebrew/cask-fonts/font-open-dyslexic-nerd-font; \
which fzf > /dev/null && brew upgrade fzf; \
which bat > /dev/null && brew upgrade bat; \
which curlie > /dev/null && brew upgrade rs/tap/curlie; \
which exa > /dev/null && brew upgrade exa; \
which kubectl > /dev/null && brew upgrade kubectl; \
which tkn > /dev/null && brew upgrade tektoncd/tools/tektoncd-cli; \
which k9s > /dev/null && brew upgrade k9s; \
which helm > /dev/null && brew upgrade helm; \
which go > /dev/null && brew upgrade go; \
which jq > /dev/null && brew upgrade jq; \
which kind > /dev/null && brew upgrade kind; \
which kubectx > /dev/null && brew upgrade kubectx; \
which tldr > /dev/null && brew upgrade tldr; \
which progress > /dev/null && brew upgrade progress; \
which htop > /dev/null && brew upgrade htop; \
which starship > /dev/null && brew upgrade starship
.PHONY: dotfiles
dotfiles: ## Installs the dotfiles.
for file in $(shell find $(CURDIR) -name ".*" -not -name ".gitignore" -not -name ".git" -not -name ".config" -not -name ".github" -not -name ".*.swp" -not -name ".gnupg"); do \
f=$$(basename $$file); \
ln -sfn $$file $(HOME)/$$f; \
done; \
mkdir -p $(HOME)/.additional_dotfiles; touch $(HOME)/.additional_dotfiles/credentials; \
mkdir -p $(HOME)/.config; \
for file in $(shell find $(CURDIR)/.config -type f); do \
f=$$(basename $$file); \
ln -sfn $$file $(HOME)/.config/$$f; \
done;
.PHONY: help .PHONY: help
help: help:

2
home/.bashrc Normal file
View File

@@ -0,0 +1,2 @@
alias date='gdate'
alias sed='gsed'

55
home/.bin/.utils Normal file
View File

@@ -0,0 +1,55 @@
END_CHARS="\e[0m\n"
tput colors &>/dev/null
if [ $? -eq 0 ]; then
bold() {
printf "\e[1m$@${END_CHARS}"
}
italic() {
printf "\e[3m$@${END_CHARS}"
}
underline() {
printf "\e[4m$@${END_CHARS}"
}
orange() {
printf "\e[38;5;208m$@${END_CHARS}"
}
blue() {
printf "\e[38;5;75m$@${END_CHARS}"
}
green() {
printf "\e[32;5;75m$@${END_CHARS}"
}
else
bold() {
echo $@
}
italic() {
echo $@
}
underline() {
echo $@
}
orange() {
echo $@
}
blue() {
echo $@
}
green() {
echo $@
}
fi
_fzf() {
fzf --multi --ansi -i -1 --height=50% --reverse -0 --header-lines=1 --border --info=hidden
}

View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
source .utils
REGIONS=( $(aws ec2 describe-regions --region eu-west-1 | jq -r '.Regions[].RegionName') )
INSTANCE_TYPES=()
print_usage() {
orange "aws-instance-type-availability - check EC2 instance type availability in all regions"
echo " "
underline "Usage:"
echo "aws-instance-type-availability [instance type IDs]"
echo " "
echo " "
underline "Options:"
echo "-h, --help show this help text"
}
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
*)
INSTANCE_TYPES+=${1}
break
;;
esac
done
for INSTANCE in "${INSTANCE_TYPES[@]}"; do
blue "${INSTANCE} availability:"
for REGION in "${REGIONS[@]}"; do
aws ec2 describe-instance-type-offerings --filters Name=instance-type,Values=${INSTANCE} --region ${REGION} | jq -r '.InstanceTypeOfferings[0].Location | select( . != null )'
done
echo ""
done

68
home/.bin/flux-pause Executable file
View File

@@ -0,0 +1,68 @@
#!/usr/bin/env bash
source .utils
set -e
VERBOSE=""
ALL=""
TARGET_RESOURCE="kustomization"
NAMESPACES="-n flux-system"
print_usage() {
blue "flux-pause - Suspends Flux Kustomization resources"
echo " "
underline "Usage:"
echo "flux-pause [options] RESOURCE_NAME..."
echo " "
underline "Options:"
echo " --all pause all Kustomizations"
echo "-n, --namespace the namespace resources belong in. Default: flux-system"
echo "-v --verbose show full verbose output"
echo "-h, --help show this help text"
}
RESOURCES=()
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
-n|--namespace)
shift
NAMESPACES="-n $1"
shift
;;
-v|--verbose)
VERBOSE="true"
shift
;;
--all)
ALL="true"
shift
;;
*)
RESOURCES+=(${1})
shift
;;
esac
done
if [[ "${ALL}" == "true" ]]; then
RESOURCES=$(kubectl get kustomization ${NAMESPACES} -o json | jq -r '.items[] | "\( .metadata.name)"')
fi
for RESOURCE in ${RESOURCES[@]}
do
printf "Pausing '${RESOURCE}'..."
if [[ "${VERBOSE}" == "true" ]]; then
echo ""
flux suspend kustomization ${NAMESPACES} ${RESOURCE} || true
else
flux suspend kustomization ${NAMESPACES} ${RESOURCE} &> /dev/null || true
printf " ✅"
fi
echo ""
done

129
home/.bin/flux-refresh Executable file
View File

@@ -0,0 +1,129 @@
#!/usr/bin/env bash
source .utils
set -e
VERBOSE=""
TARGET_RESOURCE="all"
NAMESPACES="-A"
print_usage() {
blue "flux-refresh - Refresh all flux resources"
echo " "
underline "Usage:"
echo "flux-refresh [options]"
echo " "
underline "Options:"
echo "-t, --type the resource type to target. Valid options: gitrepo, helmrepository, kustomization, helmrelease & all. Default: all"
echo "-n, --namespace the namespace resources belong in. Default: all namespaces"
echo " --verbose show full verbose output"
echo "-h, --help show this help text"
}
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
-t|--type)
shift
TARGET_RESOURCE=$1
shift
;;
-n|--namespace)
shift
NAMESPACES="-n $1"
shift
;;
--verbose)
VERBOSE="true"
shift
;;
*)
shift
;;
esac
done
if [[ "${TARGET_RESOURCE}" == "all" || "${TARGET_RESOURCE}" == "gitrepo" ]]; then
GITREPOS=$(kubectl get gitrepo ${NAMESPACES} -o json | jq -r '.items[] | "\(.metadata.namespace)/\( .kind)/\( .metadata.name)"')
fi
if [[ "${TARGET_RESOURCE}" == "all" || "${TARGET_RESOURCE}" == "helmrepository" ]]; then
HELMREPOS=$(kubectl get helmrepository ${NAMESPACES} -o json | jq -r '.items[] | "\(.metadata.namespace)/\( .kind)/\( .metadata.name)"')
fi
if [[ "${TARGET_RESOURCE}" == "all" || "${TARGET_RESOURCE}" == "kustomization" ]]; then
KUSTOMIZATIONS=$(kubectl get kustomization ${NAMESPACES} -o json | jq -r '.items[] | "\(.metadata.namespace)/\( .kind)/\( .metadata.name)"')
fi
if [[ "${TARGET_RESOURCE}" == "all" || "${TARGET_RESOURCE}" == "helmrelease" ]]; then
HEALMRELEASES=$(kubectl get helmrelease ${NAMESPACES} -o json | jq -r '.items[] | "\(.metadata.namespace)/\( .kind)/\( .metadata.name)"')
fi
if [[ "${GITREPOS}" != "" ]]; then
blue "Refreshing GitRepositories"
for RESOURCE in ${GITREPOS}
do
PARTS=($(echo ${RESOURCE} | tr '[:upper:]' '[:lower:]' | tr "/" "\n"))
printf "${PARTS[0]}/${PARTS[2]}"
if [[ "${VERBOSE}" == "true" ]]; then
echo ""
flux reconcile source git -n ${PARTS[0]} ${PARTS[2]} || true
else
flux reconcile source git -n ${PARTS[0]} ${PARTS[2]} &> /dev/null || true
printf " ✅"
fi
echo ""
done
fi
if [[ "${HELMREPOS}" != "" ]]; then
blue "Refreshing HelmRepositories"
for RESOURCE in ${HELMREPOS}
do
PARTS=($(echo ${RESOURCE} | tr '[:upper:]' '[:lower:]' | tr "/" "\n"))
printf "${PARTS[0]}/${PARTS[2]}"
if [[ "${VERBOSE}" == "true" ]]; then
echo ""
flux reconcile source helm -n ${PARTS[0]} ${PARTS[2]} || true
else
flux reconcile source helm -n ${PARTS[0]} ${PARTS[2]} &> /dev/null || true
printf " ✅"
fi
echo ""
done
fi
if [[ "${KUSTOMIZATIONS}" != "" ]]; then
blue "Refreshing Kustomizations"
for RESOURCE in ${KUSTOMIZATIONS}
do
PARTS=($(echo ${RESOURCE} | tr '[:upper:]' '[:lower:]' | tr "/" "\n"))
printf "${PARTS[0]}/${PARTS[2]}"
if [[ "${VERBOSE}" == "true" ]]; then
echo ""
flux reconcile kustomization -n ${PARTS[0]} ${PARTS[2]} || true
else
flux reconcile kustomization -n ${PARTS[0]} ${PARTS[2]} &> /dev/null || true
printf " ✅"
fi
echo ""
done
fi
if [[ "${HEALMRELEASES}" != "" ]]; then
blue "Refreshing HelmReleases"
for RESOURCE in ${HEALMRELEASES}
do
PARTS=($(echo ${RESOURCE} | tr '[:upper:]' '[:lower:]' | tr "/" "\n"))
printf "${PARTS[0]}/${PARTS[2]}"
if [[ "${VERBOSE}" == "true" ]]; then
echo ""
flux reconcile helmrelease -n ${PARTS[0]} ${PARTS[2]} || true
else
flux reconcile helmrelease -n ${PARTS[0]} ${PARTS[2]} &> /dev/null || true
printf " ✅"
fi
echo ""
done
fi

43
home/.bin/flux-resume-all Executable file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/env bash
source .utils
set -e
print_usage() {
blue "flux-resume-all - Resume all flux resources"
echo " "
underline "Usage:"
echo "flux-resume-all [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
}
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
KUSTOMIZATIONS=$(kubectl get kustomization -A -o json | jq -r '.items[] | select(.spec.suspend==true) | "\(.metadata.namespace)/\( .kind)/\( .metadata.name)"')
GITREPOS=$(kubectl get gitrepo -A -o json | jq -r '.items[] | select(.spec.suspend==true) | "\(.metadata.namespace)/\( .kind)/\( .metadata.name)"')
if [[ "${KUSTOMIZATIONS}" == "" ]] && [[ "${GITREPOS}" == "" ]]; then
italic "Nothing to resume"
fi
for RESOURCE in ${KUSTOMIZATIONS} ${GITREPOS}
do
PARTS=($(echo ${RESOURCE} | tr '[:upper:]' '[:lower:]' | tr "/" "\n"))
blue "Resuming ${PARTS[1]} - ${PARTS[0]}/${PARTS[2]}"
kubectl patch ${PARTS[1]} -n ${PARTS[0]} ${PARTS[2]} -p '{"spec":{"suspend":null}}' --type merge
done

37
home/.bin/flux-state Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
source .utils
set -e
print_usage() {
blue "flux-state - Check if any Flux resources are suspended"
echo " "
underline "Usage:"
echo "flux-state [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
}
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
blue "'kustomization' resources:"
KUSTOMIZATIONS=$(kubectl get kustomization -A -o json)
echo ${KUSTOMIZATIONS} | jq -r '.items[] | select(.spec.suspend==true) | "\(.metadata.namespace)/\( .metadata.name) - ⚠Suspended"' | column -t
echo ${KUSTOMIZATIONS} | jq -r '.items[] | select(.spec.suspend!=true) | "\(.metadata.namespace)/\( .metadata.name) - ⚡Active"' | column -t
echo ""
blue "'gitrepo' resources:"
GITREPOS=$(kubectl get gitrepo -A -o json)
echo ${GITREPOS} | jq -r '.items[] | select(.spec.suspend==true) | "\(.metadata.namespace)/\( .metadata.name) - ⚠Suspended"' | column -t
echo ${GITREPOS} | jq -r '.items[] | select(.spec.suspend!=true) | "\(.metadata.namespace)/\( .metadata.name) - ⚡Active"' | column -t

37
home/.bin/jq-test Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
source .utils
print_usage() {
orange "jq-test - interactively use JQ against a json file"
echo " "
underline "Usage:"
echo "jq-test [FILE]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
}
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
*)
POS_ARGS+=$1
shift
;;
esac
done
if [ ${#POS_ARGS[@]} -eq 0 ]
then
print_usage
exit 0
fi
echo '' | fzf --preview "jq {q} < ${POS_ARGS[@]}"

141
home/.bin/kind-create-cluster Executable file
View File

@@ -0,0 +1,141 @@
#!/usr/bin/env bash
source .utils
NAME=""
VERSION="1.34.0@sha256:7416a61b42b1662ca6ca89f02028ac133a309a2a30ba309614e8ec94d976dc5a"
NODES="2"
FEATURE_GATES="MutatingAdmissionPolicy"
RUNTIME_CONFIG="admissionregistration.k8s.io/v1alpha1"
AUDIT_POLICY=""
print_usage() {
orange "kind-create-cluster - create a Kind cluster"
echo " "
underline "Usage:"
echo "kind-create-cluster [cluster-name]"
echo " "
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-v, --version the version of kubernetes to use (default: ${VERSION})"
echo "-n, --nodes the number of worker nodes (default: ${NODES})"
echo "-f, --feature-gates a comma seperated list of feature-gates to enable (default: ${FEATURE_GATES})"
echo "-r, --runtime-config a comma seperated list of API versions to enable (default: ${RUNTIME_CONFIG})"
echo " --audit-policy a file containing the audit policy config"
}
while test $# -gt 0; do
case "$1" in
-n|--nodes)
shift
NODES=$1
shift
;;
-v|--version)
shift
VERSION=$1
shift
;;
-f|--feature-gates)
shift
FEATURE_GATES=$1
shift
;;
-r|--runtime-config)
shift
RUNTIME_CONFIG=$1
shift
;;
--audit-policy)
shift
AUDIT_POLICY=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
# Positional args
NAME=${1:-$(LC_ALL=C tr -dc a-z </dev/urandom | head -c 10)}
function node() {
TYPE=$1
COUNT=$2
for ((i = 1 ; i <= $COUNT ; i++)); do
echo "- role: ${TYPE}"
echo " image: kindest/node:${VERSION}"
if [[ "${AUDIT_POLICY}" != "" ]]; then
if [[ "${TYPE}" == "control-plane" ]]; then
echo " kubeadmConfigPatches:"
echo " - |"
echo " kind: ClusterConfiguration"
echo " apiServer:"
echo " extraArgs:"
echo " audit-log-path: /var/log/kubernetes/kube-apiserver-audit.log"
echo " audit-policy-file: /etc/kubernetes/policies/audit-policy.yaml"
echo " extraVolumes:"
echo " - name: audit-policies"
echo " hostPath: /etc/kubernetes/policies"
echo " mountPath: /etc/kubernetes/policies"
echo " readOnly: true"
echo " pathType: "DirectoryOrCreate""
echo " - name: "audit-logs""
echo " hostPath: "/var/log/kubernetes""
echo " mountPath: "/var/log/kubernetes""
echo " readOnly: false"
echo " pathType: DirectoryOrCreate"
echo " extraMounts:"
echo " - hostPath: ${AUDIT_POLICY}"
echo " containerPath: /etc/kubernetes/policies/audit-policy.yaml"
echo " readOnly: true"
fi
fi
done
}
function feature-gates() {
if [[ "${FEATURE_GATES}" != "" ]]; then
echo "featureGates:"
FEATURES=(${FEATURE_GATES//,/ })
for f in "${FEATURES[@]}"; do
echo " \"${f}\": true"
done
fi
}
function runtime-config() {
if [[ "${RUNTIME_CONFIG}" != "" ]]; then
echo "runtimeConfig:"
RUNTIME=(${RUNTIME_CONFIG//,/ })
for f in "${RUNTIME[@]}"; do
echo " \"${f}\": true"
done
fi
}
CONFIG="kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: ${NAME}
nodes:
$(node "control-plane" 1)
$(node "worker" $NODES)
$(feature-gates)
$(runtime-config)
"
CONFIG_FILE=`mktemp`
echo "${CONFIG}" > ${CONFIG_FILE}
cat ${CONFIG_FILE}
kind create cluster --config ${CONFIG_FILE}
kind get kubeconfig --name ${NAME} > ~/.kube/clusters/kind.yaml

22
home/.bin/kind-delete-cluster Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
source .utils
CONTEXT_NAME=$(kubectl config current-context | sed -e "s/kind-//")
print_usage() {
orange "kind-delete-cluster - delete a Kind cluster"
echo " "
underline "Usage:"
echo "kind-delete-cluster [cluster-name]"
echo " "
echo "If no cluster-name is provided it will attempt to get it from the current kubectl context"
echo " "
underline "Options:"
echo "-h, --help show this help text"
}
# Positional args
NAME=${1:-${CONTEXT_NAME}}
kind delete cluster --name ${NAME}

53
home/.bin/kind-list-images Executable file
View File

@@ -0,0 +1,53 @@
#!/usr/bin/env zsh
source .utils
TAG_COUNT=5
MINOR_VERSION="v1."
print_usage() {
orange "kind-list-images - List latest images for use with Kind nodes"
echo " "
underline "Usage:"
echo "kind-list-images [minor-version]"
echo " "
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --last-n-minors return the last n minor versions (default: ${TAG_COUNT})"
}
while test $# -gt 0; do
case "$1" in
-n|--last-n-minors)
shift
TAG_COUNT=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
MINOR_VERSION=$1
shift
;;
esac
done
TAGS=( $(crane ls kindest/node | sort | grep 'v1.' | grep -vE 'alpha|beta' | grep ${MINOR_VERSION}) )
declare -A latestMinor
for TAG in "${TAGS[@]}"; do
MINOR="${TAG%.*}"
latestMinor[$MINOR]=$TAG
done
RETURN_TAGS=( $(echo $latestMinor | tr ' ' '\n' | sort -r | head -n ${TAG_COUNT}) )
for TAG in "${RETURN_TAGS[@]}"; do
echo " - kindest/node:$(blue $TAG)@$(crane digest kindest/node:$TAG)"
done

63
home/.bin/kube-all Executable file
View File

@@ -0,0 +1,63 @@
#!/usr/bin/env bash
source .utils
NAMESPACE="$(kubectl config view --minify --output 'jsonpath={..namespace}' &>/dev/null)"
set -e
NAMESPACE=${NAMESPACE:-default}
LABEL=""
ALL_NAMESPACES=false
print_usage() {
blue "kube-all - A better 'kubectl get all' - actually get all Kubernetes resources, including custom resources"
echo " "
underline "Usage:"
echo "kube-all [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace the to search in"
echo "-l, --selector the label selector to match on"
echo "-A, --all-namespaces match resources in all namespaces (default: false)"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-l|--selector)
shift
LABEL=$1
shift
;;
-A|--all-namespaces)
ALL_NAMESPACES=true
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
NAMESPACED="--namespaced"
if [[ "${LABEL}" != "" ]]; then
LABEL="-l ${LABEL}"
NAMESPACED=""
fi
NAMES="$(kubectl api-resources ${NAMESPACED} --verbs list -o name | tr '\n' ,)"
if [[ "$ALL_NAMESPACES" == "true" ]]; then
kubectl get "${NAMES::${#NAMES}-1}" --show-kind --ignore-not-found ${LABEL} -A 2>/dev/null
else
kubectl get "${NAMES::${#NAMES}-1}" --show-kind --ignore-not-found ${LABEL} -n ${NAMESPACE} 2>/dev/null
fi

View File

@@ -0,0 +1,62 @@
#!/usr/bin/env bash
source .utils
NAMESPACE="$(kubectl config view --minify --output 'jsonpath={..namespace}' &>/dev/null)"
set -e
NAMESPACE=${NAMESPACE:-default}
LABEL=""
ALL_NAMESPACES=false
print_usage() {
blue "kube-clean-replicasets - Remove all olf ReplicaSets with 0 desired pods"
echo " "
underline "Usage:"
echo "kube-clean-replicasets [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace the to search in"
echo "-l, --selector the label selector to match on"
echo "-A, --all-namespaces match resources in all namespaces (default: false)"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-l|--selector)
shift
LABEL=$1
shift
;;
-A|--all-namespaces)
ALL_NAMESPACES=true
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
if [[ "${LABEL}" != "" ]]; then
LABEL="-l ${LABEL}"
fi
if [ $ALL_NAMESPACES ]; then
kubectl get replicasets --all-namespaces $LABEL -o jsonpath='{range .items[?(@.status.replicas==0)]}--namespace {@.metadata.namespace} {@.metadata.name};{end}' | \
tr ";" "\n" | \
xargs -I {} sh -c "kubectl delete rs {}"
else
kubectl get replicasets --namespace $NAMESPACE $LABEL -o jsonpath='{range .items[?(@.status.replicas==0)]}--namespace {@.metadata.namespace} {@.metadata.name};{end}' | \
tr ";" "\n" | \
xargs -I {} sh -c "kubectl delete rs {}"
fi

29
home/.bin/kube-count-events Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
source .utils
set -e
print_usage() {
blue "kube-count-events - Counts events by type"
echo " "
underline "Usage:"
echo "kube-count-events [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
}
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
kubectl get events -A | awk '{ print $4 }' | sort | uniq -c | sort -bgr

61
home/.bin/kube-disable-webhook Executable file
View File

@@ -0,0 +1,61 @@
#!/usr/bin/env bash
source .utils
set -e
WEBHOOK_TYPE="mutating"
print_usage() {
blue "kube-disable-webhook - Disabled a webhook by modifying the namespace selector"
echo " "
underline "Usage:"
echo "kube-disable-webhook [options] NAME"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-t, --type the type of webhook [mutating (default), validating]"
}
while test $# -gt 0; do
case "$1" in
-t|--type)
shift
WEBHOOK_TYPE=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
NAME=${1}
FAKE_SELECTOR='"namespaceSelector":{"matchExpressions":[{"key":"disabled","operator":"In","values":["webhook"]}]}'
if [[ "${WEBHOOK_TYPE}" == "mutating" ]]; then
printf "🚫 Disabling mutating webhook ${NAME}..."
kubectl annotate mutatingwebhookconfigurations.admissionregistration.k8s.io ${NAME} previous-state="$(kubectl get mutatingwebhookconfigurations.admissionregistration.k8s.io ${NAME} -o json)" &>/dev/null
HOOKS=$(kubectl get mutatingwebhookconfigurations.admissionregistration.k8s.io ${NAME} -o go-template='{{range .webhooks}}{{.name}}{{"\n"}}{{end}}')
for HOOK in ${HOOKS}
do
kubectl patch mutatingwebhookconfigurations.admissionregistration.k8s.io ${NAME} -p '{"webhooks": [{"name": "'${HOOK}'", '${FAKE_SELECTOR}'}]}' 1>/dev/null
done
printf " ✅ Done"
elif [[ "${WEBHOOK_TYPE}" == "validating" ]]; then
printf "🚫 Disabling validating webhook ${NAME}..."
kubectl annotate validatingwebhookconfigurations.admissionregistration.k8s.io ${NAME} previous-state="$(kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io ${NAME} -o json)" &>/dev/null
HOOKS=$(kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io ${NAME} -o go-template='{{range .webhooks}}{{.name}}{{"\n"}}{{end}}')
for HOOK in ${HOOKS}
do
kubectl patch validatingwebhookconfigurations.admissionregistration.k8s.io ${NAME} -p '{"webhooks": [{"name": "'${HOOK}'", '${FAKE_SELECTOR}'}]}' 1>/dev/null
done
printf " ✅ Done"
else
echo "Unknown webhook type"
exit 1
fi

94
home/.bin/kube-empty-namespace Executable file
View File

@@ -0,0 +1,94 @@
#!/usr/bin/env bash
source .utils
set -e
NAMESPACE=""
CONTEXT="$(kubectl config current-context)"
print_usage() {
blue "kube-empty-namespace - Force delete all resources in the provided namespace"
echo " "
underline "Usage:"
echo "kube-empty-namespace"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo " --context sets the context from the kubeconfig to use"
echo "-n, --namespace the namespace the resources are in (required)"
}
YOLO="0"
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
--context)
shift
CONTEXT="$1"
shift
;;
--yolo)
YOLO="1"
shift
;;
*)
POS_ARGS+=(`echo $1 | tr '/' ' '`)
shift
;;
esac
done
if [[ "${NAMESPACE}" == "" ]]; then
echo "Please provide the namespace to empty"
exit 1
fi
function deleteResource() {
RES="${1//.v1/}"
kubectl --context "${CONTEXT}" patch -p '{"metadata":{"finalizers":null}}' --type=merge -n ${NAMESPACE} ${RES} 1>/dev/null || printf ""
kubectl --context "${CONTEXT}" delete -n ${NAMESPACE} ${RES} 2>/dev/null || printf ""
}
printf "⚠️ This could leave cloud resources undeleted if finalizers aren't honoured ⚠️\n\n"
RESOURCES=()
if [[ "${YOLO}" == 0 ]]; then
printf "Are you sure you want to force delete all resources in '${NAMESPACE}'? (y/n): "
read CONFIRM
else
echo ""
echo ""
orange "YOLO MODE!!! (What could go wrong?!)"
CONFIRM="y"
fi
if [ "${CONFIRM}" = "y" ]; then
echo ""
echo "💣 OK, I hope you know what you're doing..."
echo "Deleting all resources in namespace '${NAMESPACE}'"
echo ""
NAMES="$(kubectl --context "${CONTEXT}" api-resources --namespaced --verbs list -o name 2>/dev/null | tr '\n' ,)"
RESOURCES=$(kubectl --context "${CONTEXT}" get "${NAMES::${#NAMES}-1}" --ignore-not-found -n ${NAMESPACE} -o go-template='{{range.items}}{{.kind}}.{{.apiVersion}}/{{.metadata.name}}{{"\n"}}{{end}}' 2>/dev/null | tr '[:upper:]' '[:lower:]' | sed -r "s|/(v.+)/|/|g")
IFS='
'
for RESOURCE in ${RESOURCES}
do
deleteResource ${RESOURCE}
done
else
echo "Aborting..."
exit 1
fi

65
home/.bin/kube-exec Executable file
View File

@@ -0,0 +1,65 @@
#!/usr/bin/env bash
source .utils
NAMESPACE="$(kubectl config view --minify --output 'jsonpath={..namespace}' &>/dev/null)"
set -e
NAMESPACE=${NAMESPACE:-default}
POD=""
CMD="sh"
print_usage() {
blue "kube-exec - execute commands within a pod"
echo " "
underline "Usage:"
echo "kube-exec [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace the pod is in"
echo "-p, --pod the name of the pod"
echo "-c, --command the command to run in the pod (default: sh)"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-p|--pod)
shift
POD=$1
shift
;;
-c|--command)
shift
CMD=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
if [[ "$POD" == "" ]]; then
which fzf &>/dev/null || (
echo "If no pod provided, fzf is required to select pods"
echo ""
print_usage
exit 1
)
pod=($(kubectl get pods --all-namespaces -o wide | _fzf | awk '{print $1, $2}'))
POD=${pod[1]}
NAMESPACE=${pod[0]}
fi
echo kubectl exec -it --namespace $NAMESPACE $POD $CMD
kubectl exec -it --namespace $NAMESPACE $POD $CMD

113
home/.bin/kube-force-delete Executable file
View File

@@ -0,0 +1,113 @@
#!/usr/bin/env bash
source .utils
NAMESPACE="$(kubectl config view --minify --output 'jsonpath={..namespace}' &>/dev/null)"
set -e
NAMESPACE=${NAMESPACE:-default}
SELECTOR=""
CONTEXT="$(kubectl config current-context)"
print_usage() {
blue "kube-force-delete - Force delete resources, even those with finalizers"
echo " "
underline "Usage:"
echo "kube-force-delete [RESOURCE_TYPE] [RESOURCE_NAME]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo " --context sets the context from the kubeconfig to use"
echo "-n, --namespace the namespace the resource is in (default: current namespace)"
}
YOLO="0"
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-l|--selector)
shift
SELECTOR="$1"
shift
;;
-h|--help)
print_usage
exit 0
;;
--context)
shift
CONTEXT="$1"
shift
;;
--yolo)
YOLO="1"
shift
;;
/)
# We want to ignore slash seperators between resource types and names
shift
;;
*)
POS_ARGS+=(`echo $1 | tr '/' ' '`)
shift
;;
esac
done
if [ ${#POS_ARGS[@]} -lt 2 ] && [[ "${SELECTOR}" == "" ]]; then
echo "Please provide the resource type and name to delete"
exit 1
fi
function deleteResource() {
RES="${1//.v1/}"
echo "Deleting ${RES}"
kubectl --context "${CONTEXT}" patch -p '{"metadata":{"finalizers":null}}' --type=merge -n ${NAMESPACE} ${RES} 1>/dev/null|| printf ""
kubectl --context "${CONTEXT}" delete -n ${NAMESPACE} ${RES} 2>/dev/null || printf ""
}
printf "⚠️ This could leave cloud resources undeleted if finalizers aren't honoured ⚠️\n\n"
RESOURCES=()
if [[ "${SELECTOR}" == "" ]]; then
printf "Are you sure you want to delete ${POS_ARGS[0]}/${POS_ARGS[1]}? (y/n): "
RESOURCES=("${POS_ARGS[0]}/${POS_ARGS[1]}")
else
printf "Are you sure you want to delete all matching '${SELECTOR}'? (y/n): "
fi
if [[ "${YOLO}" == 0 ]]; then
read CONFIRM
else
echo ""
echo ""
orange "YOLO MODE!!! (What could go wrong?!)"
CONFIRM="y"
fi
if [ "${CONFIRM}" = "y" ]; then
echo ""
echo "💣 OK, I hope you know what you're doing..."
if [[ "${SELECTOR}" != "" ]]; then
SELECTOR="-l ${SELECTOR}"
NAMES="$(kubectl --context "${CONTEXT}" api-resources --verbs list -o name 2>/dev/null | tr '\n' ,)"
RESOURCES=$(kubectl --context "${CONTEXT}" get "${NAMES::${#NAMES}-1}" --ignore-not-found ${SELECTOR} -n ${NAMESPACE} -o go-template='{{range.items}}{{.kind}}.{{.apiVersion}}/{{.metadata.name}}{{"\n"}}{{end}}' 2>/dev/null | tr '[:upper:]' '[:lower:]' | sed -r "s|/(v.+)/|/|g")
fi
IFS='
'
for RESOURCE in ${RESOURCES}
do
deleteResource ${RESOURCE}
done
else
echo "Aborting..."
exit 1
fi

90
home/.bin/kube-forward-all Executable file
View File

@@ -0,0 +1,90 @@
#!/usr/bin/env bash
source .utils
NAMESPACE="$(kubectl config view --minify --output 'jsonpath={..namespace}' &>/dev/null)"
set -e
NAMESPACE=${NAMESPACE:-default}
HOST_PORT=10001
print_usage() {
blue "kube-forward-all - create port-forwards for all pods in the given namespace"
echo " "
underline "Usage:"
echo "kube-forward-all [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace to launch the pod in"
echo "-p, --port the port to start at (and increment from for each service) (default: 10001)"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-p|--port)
shift
HOST_PORT=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
# Get all services first
IFS=$'\n'
SERVICES=( $(kubectl get service --namespace ${NAMESPACE} --no-headers -o json | jq '[.items[] | select(.metadata.annotations."kube-forward" != "false")] | (.[] | .metadata.name + "\t" + ([.spec.ports[].port] | join(",")))' -r | column -t) )
unset IFS
# Track the port-forwards we need to clean up
TO_KILL=()
cleanup() {
echo "\nClosing connections..."
for pid in "${TO_KILL[@]}"
do
(kill -2 $pid) &> /dev/null
done
trap - INT TERM
}
trap 'cleanup' INT TERM
echo "Forwarding..."
for s in "${SERVICES[@]}"
do
SERVICE=( $(echo $s) )
NAME=${SERVICE[0]}
PORT=${SERVICE[1]}
PORTS=($(echo $PORT | tr "," "\n"))
for PORT in "${PORTS[@]}"
do
(kubectl port-forward --namespace ${NAMESPACE} svc/$NAME $HOST_PORT:$PORT &>/dev/null) &
BG_PID=$!
if `curl -s -o /dev/null --retry 5 --retry-delay 0 --retry-connrefused -m 3 http://localhost:$HOST_PORT`
then
echo "\e[1m$NAME:$PORT\e[0m ➡ \e[34mhttp://localhost:$HOST_PORT\e[0m"
TO_KILL+=($BG_PID)
((HOST_PORT=HOST_PORT+1))
else
(kill -2 $BG_PID) &> /dev/null
fi
done
done
echo "\n\e[2m(Use [Ctl + C] to exit)"
cat
cleanup

65
home/.bin/kube-logs Executable file
View File

@@ -0,0 +1,65 @@
#!/usr/bin/env bash
source .utils
NAMESPACE="$(kubectl config view --minify --output 'jsonpath={..namespace}' &>/dev/null)"
set -e
NAMESPACE=${NAMESPACE:-default}
POD=""
ARGS=""
print_usage() {
blue "kube-logs - tail logs from a pod"
echo " "
underline "Usage:"
echo "kube-logs [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace the pod is in"
echo "-p, --pod the name of the pod to get logs for"
echo "-a, --args additional arguments to pass to kubectl logs command"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-p|--pod)
shift
POD=$1
shift
;;
-a|--args)
shift
ARGS=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
if [[ "$POD" == "" ]]; then
which fzf &>/dev/null || (
echo "If no pod provided, fzf is required to select pods"
echo ""
print_usage
exit 1
)
pod=($(kubectl get pods --all-namespaces -o wide | _fzf | awk '{print $1, $2}'))
POD=${pod[1]}
NAMESPACE=${pod[0]}
fi
echo kubectl logs -f $ARGS --namespace $NAMESPACE $POD
kubectl logs -f $ARGS --namespace $NAMESPACE $POD

51
home/.bin/kube-reenable-webhook Executable file
View File

@@ -0,0 +1,51 @@
#!/usr/bin/env bash
source .utils
set -e
WEBHOOK_TYPE="mutating"
print_usage() {
blue "kube-reenable-webhook - Re-enable a previously disabled webhook"
echo " "
underline "Usage:"
echo "kube-reenable-webhook [options] NAME"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-t, --type the type of webhook [mutating (default), validating]"
}
while test $# -gt 0; do
case "$1" in
-t|--type)
shift
WEBHOOK_TYPE=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
NAME=${1}
FAKE_SELECTOR='"namespaceSelector":{"matchExpressions":[{"key":"disabled","operator":"In","values":["webhook"]}]}'
if [[ "${WEBHOOK_TYPE}" == "mutating" ]]; then
printf "🔌 Re-enabling mutating webhook ${NAME}..."
kubectl get mutatingwebhookconfigurations.admissionregistration.k8s.io ${NAME} -o custom-columns="prev:.metadata.annotations.previous-state" --no-headers | kubectl apply -f -
printf " ✅ Done"
elif [[ "${WEBHOOK_TYPE}" == "validating" ]]; then
printf "🔌 Re-enabling validating webhook ${NAME}..."
kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io ${NAME} -o custom-columns="prev:.metadata.annotations.previous-state" --no-headers | kubectl apply -f -
printf " ✅ Done"
else
echo "Unknown webhook type"
exit 1
fi

38
home/.bin/kube-restarting Executable file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
source .utils
NAMESPACE="$(kubectl config view --minify --output 'jsonpath={..namespace}' &>/dev/null)"
set -e
NAMESPACE=${NAMESPACE:-default}
NAMESPACE="-A"
print_usage() {
blue "kube-restarting - Show all pods with restarts"
echo " "
underline "Usage:"
echo "kube-restarting [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace the to search in (searches all if not set)"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE="-n $1"
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
kubectl get pod ${NAMESPACE} -o json | jq --raw-output '.items[] | select([.status.containerStatuses[].restartCount] | add > 0) | "\( .metadata.namespace)/\( .metadata.name) \t \([.status.containerStatuses[].restartCount] | add)" ' | column -t

View File

@@ -0,0 +1,58 @@
#!/usr/bin/env bash
source .utils
NAMESPACE="$(kubectl config view --minify --output 'jsonpath={..namespace}' &>/dev/null)"
set -e
NAMESPACE=${NAMESPACE:-default}
DEPLOYMENT=""
print_usage() {
blue "kube-schedule-anywhere - modify a deployment to schedule on any node"
echo " "
underline "Usage:"
echo "kube-schedule-anywhere [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace the pod is in"
echo "-d, --deployment the name of the deployment to modify"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-d|--deployment)
shift
DEPLOYMENT=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
if [[ "$DEPLOYMENT" == "" ]]; then
which fzf &>/dev/null || (
echo "If no deployment provided, fzf is required to select deployments"
echo ""
print_usage
exit 1
)
deployment=($(kubectl get deployments --all-namespaces -o wide | _fzf | awk '{print $1, $2}'))
DEPLOYMENT=${deployment[1]}
NAMESPACE=${deployment[0]}
fi
kubectl patch deployment -n ${NAMESPACE} ${DEPLOYMENT} -p '{"spec": { "template": { "spec": { "tolerations": [ { "operator": "Exists" } ] } } } }' 1>/dev/null

72
home/.bin/kube-shell Executable file
View File

@@ -0,0 +1,72 @@
#!/usr/bin/env bash
source .utils
NAMESPACE="$(kubectl config view --minify --output 'jsonpath={..namespace}' &>/dev/null)"
set -e
NAMESPACE=${NAMESPACE:-default}
POD="shell"
IMAGE="digitalocean/doks-debug"
CMD="bash"
print_usage() {
blue "kube-shell - create a new pod and exec into it's shell"
echo " "
underline "Usage:"
echo "kube-shell [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace the pod should launch in"
echo "-p, --pod the name of the pod to get logs for (default: shell)"
echo "-i, --image the image to use for the shell container (default: digitalocean/doks-debug)"
echo "-c, --command the initial command to execute in the container (default: sh)"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-p|--pod)
shift
POD=$1
shift
;;
-i|--image)
shift
IMAGE=$1
shift
;;
-c|--command)
shift
CMD=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
NAMESPACE=${NAMESPACE:-default}
OVERRIDES='{
"spec": {
"securityContext": {"runAsGroup": 1000,"runAsNonRoot": true,"runAsUser": 1000,"seccompProfile": {"type": "RuntimeDefault"}},
"containers": [
{
"name":"'$POD'","image":"'$IMAGE'", "command": ["'$CMD'"],
"stdin": true,"stdinOnce": true,"tty": true,
"securityContext": {"allowPrivilegeEscalation": false,"capabilities": {"drop": ["ALL"]},"privileged": false,"runAsGroup": 1000,"runAsNonRoot": true,"runAsUser": 1000,"seccompProfile": {"type": "RuntimeDefault"}}
}
]
}
}'
kubectl run -it --namespace $NAMESPACE $POD --image $IMAGE --restart Never --overrides "${OVERRIDES}" --rm -- $CMD

80
home/.bin/kube-ssh Executable file
View File

@@ -0,0 +1,80 @@
#!/usr/bin/env bash
source .utils
NAMESPACE="$(kubectl config view --minify --output 'jsonpath={..namespace}' &>/dev/null)"
set -e
NAMESPACE=${NAMESPACE:-default}
POD="kube-ssh"
NODE=""
IMAGE="alpine"
print_usage() {
blue "kube-ssh - gain access to a Kubernetes host node (ssh-like for when a host doesn't have ssh)"
echo " "
underline "Usage:"
echo "kube-ssh [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace to launch the pod in"
echo "-N, --node the name of the node to access"
echo "-i, --image the image to launch for debugging (default: alpine)"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-N|--node)
shift
NODE=$1
shift
;;
-i|--image)
shift
IMAGE=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
if [[ "$NODE" == "" ]]; then
if [ -z "$(which fzf)" ]; then
NODES=$(kubectl get nodes --no-headers -o custom-columns=name:.metadata.name)
i=0
while read -r node; do
echo "[$i] - $node"
i=$((i+1))
done <<< "$NODES"
read -p "Which node would you like to connect to? " -r
echo ""
IFS=$'\n' NODES=($NODES)
NODE=${NODES[$REPLY]}
else
NODES=$(kubectl get nodes)
NODE=$(echo "$NODES" | _fzf | awk '{print $1}')
fi
fi
SERVER_VERSION=$(kubectl version --client=false -o json 2>/dev/null | jq -r '.serverVersion.minor')
if [ ${SERVER_VERSION} -ge 22 ]; then
kubectl debug node/${NODE} -it --image ${IMAGE}
else
NODE_NAME=$(kubectl get node $NODE -o template --template='{{index .metadata.labels "kubernetes.io/hostname"}}')
NODE_SELECTOR='"nodeSelector": { "kubernetes.io/hostname": "'${NODE_NAME}'" },'
kubectl run --namespace ${NAMESPACE} $POD --rm -it --image ${IMAGE} --privileged --overrides '{"spec":{'"${NODE_SELECTOR}"'"hostPID": true}}' --command nsenter -- --mount=/proc/1/ns/mnt -- /bin/bash
fi

62
home/.bin/kube-template Executable file
View File

@@ -0,0 +1,62 @@
#!/usr/bin/env bash
source .utils
NAMESPACE="$(kubectl config view --minify --output 'jsonpath={..namespace}' &>/dev/null)"
set -e
NAMESPACE=${NAMESPACE:-default}
print_usage() {
blue "kube-template - Quickly template up kubernetes resources"
echo " "
underline "Usage:"
echo "kube-template [options] RESOURCE_KIND NAME [extra arguments]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace the to search in"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE="--namespace $1"
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
NAME=${2}
case "$1" in
deployment|dp)
kubectl create ${NAMESPACE} deployment ${NAME} --image=nginx:1.21 --dry-run=client -o yaml ${@:3}
;;
ingress|in)
kubectl create ${NAMESPACE} ingress ${NAME} --dry-run=client -o yaml --rule=example.com/=my-service:web ${@:3}
;;
service|svc)
kubectl create ${NAMESPACE} service clusterip ${NAME} --dry-run=client -o yaml ${@:3}
;;
configmap|cm)
kubectl create ${NAMESPACE} configmap ${NAME} --dry-run=client -o yaml ${@:3}
;;
secret|sec)
kubectl create ${NAMESPACE} secret generic ${NAME} --dry-run=client -o yaml ${@:3}
;;
cronjob|cj)
kubectl create ${NAMESPACE} cronjob ${NAME} --image=alpine:latest --schedule="1 * * * *" --dry-run=client -o yaml ${@:3}
;;
job|jo)
kubectl create ${NAMESPACE} job ${NAME} --image=alpine:latest --dry-run=client -o yaml ${@:3}
;;
esac

40
home/.bin/kube-trigger-cronjob Executable file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/env bash
source .utils
NAMESPACE="$(kubectl config view --minify --output 'jsonpath={..namespace}' &>/dev/null)"
set -e
NAMESPACE=${NAMESPACE:-default}
print_usage() {
blue "kube-trigger-cronjob - Triggers a CronJob by creating a new job based on it"
echo " "
underline "Usage:"
echo "kube-trigger-cronjob [options] CRONJOB_NAME"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace the to search in"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
NAME=${1}
kubectl create job --namespace ${NAMESPACE} ${NAME}-manual --from=cronjob/${NAME} ${@:3}

41
home/.bin/litractl Executable file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
source .utils
set -e
if [ -z `which hidapitester` ]; then
bold "hidapitester command not found"
echo "Download from https://github.com/todbot/hidapitester"
exit 1
fi
print_usage() {
blue "litractl - Control Litra Glow"
echo " "
underline "Usage:"
echo "litractl [on / off]"
}
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
*)
POS_ARGS+=(`echo $1`)
shift
;;
esac
done
if [[ "${POS_ARGS[0]}" == "on" ]]; then
italic "Turning Litra Glow on... "
hidapitester --vidpid 046D/C900 --open --length 20 --send-output 0x11,0xff,0x04,0x1c,0x01 &>/dev/null
elif [[ "${POS_ARGS[0]}" == "off" ]]; then
italic "Turning Litra Glow off... "
hidapitester --vidpid 046D/C900 --open --length 20 --send-output 0x11,0xff,0x04,0x1c &>/dev/null
else
print_usage
fi

82
home/.bin/renovate-prs Executable file
View File

@@ -0,0 +1,82 @@
#!/usr/bin/env bash
source .utils
set -e
RENOVATE_USER="29139614"
MERGE=false
print_usage() {
blue "renovate-prs - List all Renovate PRs and batch approve"
echo " "
underline "Usage:"
echo "renovate-prs [options]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-m, --merge merge PRs after approving"
}
while test $# -gt 0; do
case "$1" in
-m|--merge)
shift
MERGE=true
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
PULLS=$(curl --silent -L -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/search/issues?q=is%3Apr%20is%3Aopen%20archived%3Afalse%20sort%3Aupdated-desc%20review-requested%3AAverageMarcus%20renovate" \
| jq -r -c ".items[] | select(.user.id == ${RENOVATE_USER} and .draft == false) | @base64")
if [[ "${PULLS}" == "" ]]; then
blue "No Renovate PRs pending"
else
for PR in ${PULLS}; do
PR=$(echo ${PR} | base64 -d)
NUMBER=$(echo ${PR} | jq -r '.number')
TITLE=$(echo ${PR} | jq -r '.title')
URL=$(echo ${PR} | jq -r '.pull_request.html_url')
BODY=$(echo ${PR} | jq -r '.body')
PACKAGES=""
HEADER_FOUND=false
DIVIDER_FOUND=false
while IFS= read -r line; do
if [[ "${line}" == "" ]] && [[ "${HEADER_FOUND}" == "true" ]] && [[ "${DIVIDER_FOUND}" == "true" ]]; then
break
fi
if [[ "${HEADER_FOUND}" == "true" ]] && [[ "${DIVIDER_FOUND}" == "true" ]]; then
line=$(echo ${line} | sed -r 's/\((.+)\)//g' | sed -r 's/(\[|\]|`)//g')
parts=(${line//|/ })
PACKAGES+=" - ${parts[0]} - ${parts[${#parts[@]}-3]]} ➡ ${parts[${#parts[@]}-1]]}\n"
fi
if [[ "${line}" == "| Package | Type | Update | Change |" ]] || [[ "${line}" == "| Package | Update | Change |" ]]; then
HEADER_FOUND=true
fi
if [[ "${line}" == "|---|---|---|---|" ]] || [[ "${line}" == "|---|---|---|" ]]; then
DIVIDER_FOUND=true
fi
done <<< "$BODY"
bold "#${NUMBER} ${STATE} $(blue "${TITLE}")"
printf "🌐 $(underline ${URL})\n"
printf "${PACKAGES}"
echo ""
done
fi

71
home/.bin/talos-upgrade Executable file
View File

@@ -0,0 +1,71 @@
#!/usr/bin/env bash
source .utils
set -e
if [[ "${TALOSCONFIG}" == "" ]]; then
echo "You need to set TALOSCONFIG before running this"
exit 1
fi
LATEST_RELEASE=$(curl --silent https://api.github.com/repos/siderolabs/talos/releases | jq -r '[.[] | select(.prerelease == false)] | .[0]')
TALOS_VERSION="$(jq --argjson LATEST_RELEASE "$LATEST_RELEASE" -c -n -r '$LATEST_RELEASE.tag_name')"
KUBERNETES_VERSION="$(jq --argjson LATEST_RELEASE "$LATEST_RELEASE" -c -n -r '$LATEST_RELEASE.body | match("registry.k8s.io/kube-apiserver:v([0-9\\.]+)") | .captures[0].string')"
blue "TALOS_VERSION = ${TALOS_VERSION}"
blue "KUBERNETES_VERSION = ${KUBERNETES_VERSION}"
echo ""
blue "ISO URL: https://github.com/siderolabs/talos/releases/download/${TALOS_VERSION}/metal-amd64.iso"
echo ""
kubectl cluster-info
echo ""
printf "Continue? (y/n): "
read CONFIRM
if [[ "${CONFIRM}" != "y" ]]; then
exit 1
fi
echo ""
blue "Ensuring talosctl is up-to-date..."
brew upgrade siderolabs/tap/talosctl
CONTROL_PLANE="$(talosctl get nodetaintspec -o json | jq -r '.node')"
WORKERS=( $(talosctl get nodeips -o json | jq -r '.node | select(. != "'${CONTROL_PLANE}'")'))
echo ""
kubectl get no -o wide
echo ""
blue "Upgrading the control plane first..."
talosctl upgrade --image ghcr.io/siderolabs/installer:${TALOS_VERSION} --preserve=true --nodes ${CONTROL_PLANE}
echo ""
blue "Upgrading the worker nodes..."
SLEEP="10"
for NODE in "${WORKERS[@]}"
do
talosctl upgrade --image ghcr.io/siderolabs/installer:${TALOS_VERSION} --preserve=true --nodes ${NODE}
italic "Waiting for ${SLEEP} seconds to let pods settle..."
sleep ${SLEEP}
done
echo ""
kubectl get no -o wide
# Only the control plane requires the k8s version upgrading, the workers are done as part of the OS upgrade
echo ""
blue "Upgrading Kubernetes..."
talosctl upgrade-k8s --nodes ${CONTROL_PLANE} --to ${KUBERNETES_VERSION}
echo ""
kubectl get no -o wide
echo ""
orange "🎉 Upgrade Complete! 🎉"
echo ""
blue "ISO URL: https://github.com/siderolabs/talos/releases/download/${TALOS_VERSION}/metal-amd64.iso"

37
home/.bin/yq-test Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
source .utils
print_usage() {
orange "yq-test - interactively use YQ against a json file"
echo " "
underline "Usage:"
echo "yq-test [FILE]"
echo " "
underline "Options:"
echo "-h, --help show this help text"
}
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
*)
POS_ARGS+=$1
shift
;;
esac
done
if [ ${#POS_ARGS[@]} -eq 0 ]
then
print_usage
exit 0
fi
echo '' | fzf --preview "yq {q} < ${POS_ARGS[@]}"

View File

@@ -1,10 +1,19 @@
export ZSH="$HOME/.oh-my-zsh" export ZSH="$HOME/.oh-my-zsh"
plugins=(git npm docker zsh-completions) plugins=(
autoload -U compinit && compinit zsh-syntax-highlighting
fpath=($fpath ~/.zsh/completion) )
# Use this setting if you want to disable marking untracked files under VCS as dirty.
# This makes repository status checks for large repositories much, much faster.
DISABLE_UNTRACKED_FILES_DIRTY="true"
SHOW_AWS_PROMPT=false
COMPLETION_WAITING_DOTS=true
source $ZSH/oh-my-zsh.sh source $ZSH/oh-my-zsh.sh
zstyle ':omz:update' mode reminder
source `brew --prefix switch`/switch.sh
# History # History
HISTFILE="$HOME/.zsh_history" HISTFILE="$HOME/.zsh_history"
@@ -20,9 +29,6 @@ setopt HIST_REDUCE_BLANKS
setopt autocd setopt autocd
autoload -U add-zsh-hook autoload -U add-zsh-hook
BAT_THEME="Monokai Extended Light"
BAT_STYLE="grid,header"
DISABLE_AUTO_TITLE="true" DISABLE_AUTO_TITLE="true"
# Override auto-title when static titles are desired ($ title My new title) # Override auto-title when static titles are desired ($ title My new title)
@@ -31,19 +37,21 @@ title() { export TITLE_OVERRIDDEN=1; echo -en "\e]0;$*\a"}
autotitle() { export TITLE_OVERRIDDEN=0 }; autotitle autotitle() { export TITLE_OVERRIDDEN=0 }; autotitle
# Condition checking if title is overridden # Condition checking if title is overridden
overridden() { [[ $TITLE_OVERRIDDEN == 1 ]]; } overridden() { [[ $TITLE_OVERRIDDEN == 1 ]]; }
# Echo asterisk if git state is dirty
gitDirty() { [[ $(git status 2> /dev/null | grep -o '\w\+' | tail -n1) != ("clean"|"") ]] && echo "*" }
# Show cwd when shell prompts for input. # Show cwd when shell prompts for input.
precmd() { precmd() {
if overridden; then return; fi if overridden; then return; fi
pwd=$(pwd) # Store full path as variable pwd=$(pwd) # Store full path as variable
cwd=${pwd##*/} # Extract current working dir only cwd=${pwd##*/} # Extract current working dir only
print -Pn "\e]0;$cwd$(gitDirty)\a" # Replace with $pwd to show full path print -Pn "\e]0;$cwd\a" # Replace with $pwd to show full path
} }
# Prepend command (w/o arguments) to cwd while waiting for command to complete. # Prepend command (w/o arguments) to cwd while waiting for command to complete.
preexec() { preexec() {
if overridden; then return; fi if overridden; then return; fi
printf "\033]0;%s\a" "${1%% *} | $cwd$(gitDirty)" # Omit construct from $1 to show args printf "\033]0;%s\a" "${1%% *} | $cwd" # Omit construct from $1 to show args
} }
if [ $(/bin/ps -ef | /usr/bin/grep "ssh-agent" | /usr/bin/grep -v "grep" | wc -l) -eq 0 ]; then
eval "$(ssh-agent -s)" > /dev/null
fi

147
home/.dotfiles/aliases Normal file
View File

@@ -0,0 +1,147 @@
# Rename existing tools
alias _cat=`which cat`
alias _curl=`which curl`
alias _ls="/bin/ls"
alias _grep="/usr/bin/grep"
alias _diff="/usr/bin/diff"
alias _du=`which du`
alias _df=`which df`
alias _find=`which find`
alias _top=`which top`
alias _ps="/bin/ps"
alias _dig=`which dig`
alias _readlink='/usr/bin/readlink'
alias _sed='/usr/bin/sed'
alias _date='/bin/date'
alias _base64='/usr/bin/base64'
alias _git=`which git`
if command -v $(brew --prefix)/bin/git &>/dev/null; then
alias _git=$(brew --prefix)/bin/git
fi
# Aliases
alias cat='bat '
alias curl='curlie'
alias ls='eza --group-directories-first --icons --header --git --ignore-glob=.git'
alias grep='rg'
alias diff='delta'
alias du='dust'
alias df='duf -hide special'
alias find='fd'
alias find-empty-dirs='fd --type empty --type directory'
alias bandwhich='sudo bandwhich'
alias top='btm'
alias ps='procs'
alias dig='doggo'
alias kubectx='switch'
alias kctx='switch'
alias machine-info='macchina -t Boron --bar'
alias watch='watch '
alias tmp='cd $(mktemp -d)'
# Ensure GNU version of tools are used by default (symlink so they are picked up in scripts also)
which greadlink &>/dev/null && ln -sfn `which greadlink` /usr/local/bin/readlink
which gsed &>/dev/null && ln -sfn `which gsed` /usr/local/bin/sed
which gdate &>/dev/null && ln -sfn `which gdate` /usr/local/bin/date
which gbase64 &>/dev/null && ln -sfn `which gbase64` /usr/local/bin/base64
lt() {
DEPTH=$(echo $1 | grep "^[0-9]*$")
if [ "$DEPTH" = "" ]; then
DEPTH=2
else
shift
fi
ls -l --tree -L $DEPTH -I ".git|cache|log|logs|node_modules|vendor" $@
}
git() {
if [ "$1" = "take" ]; then # Git clone then cd into new directory
if [ $# -gt 2 ]; then
_git clone ${@:2}
cd $3
else
ORG=$(echo $2 | sed -e 's|https://||' -e 's|/| |g' -e 's|:| |g' | cut -f 2 -d ' ')
REPO=$(echo $2 | sed -e 's|https://||' -e 's|/| |g' -e 's|:| |g' | cut -f 3 -d ' ' | xargs basename -s .git)
DST="${HOME}/Code/${ORG}/${REPO}"
mkdir -p ${DST}
_git clone $2 ${DST}
cd ${DST}
fi
elif [ "$1" = "commit" ]; then # Sign all commits
shift
_git commit -s $@
elif [ "$1" = "co" ]; then # Create a new branch
shift
_git checkout -b $@
elif [ "$1" = "push" ]; then # Guard against pushing to certain orgs
shift
if [ $# -eq 0 ]; then
remote_url=$(_git remote get-url $(git current-remote))
if [[ $remote_url == *"kubernetes/"* ]] || [[ $remote_url == *"kubernetes-sigs/"* ]]; then
echo "⚠️ Don't push directly to Kubernetes"
return 1
fi
fi
_git push $@
elif [ "$1" = "release" ]; then # Create a new tag
shift
SEMVER=$1
CURRENT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
VERSION_PARTS=($(echo $CURRENT_TAG | tr "." "\n"))
VERSION_MAJOR=${VERSION_PARTS[1]}
VERSION_MINOR=${VERSION_PARTS[2]}
VERSION_PATCH=${VERSION_PARTS[3]}
case ${SEMVER} in
patch)
VERSION_PATCH=$((VERSION_PATCH+1))
;;
minor)
VERSION_MINOR=$((VERSION_MINOR+1))
VERSION_PATCH=0
;;
major)
if [[ ${VERSION_MAJOR:0:1} == "v" ]]; then
VERSION_MAJOR="v$((VERSION_MAJOR+1))"
else
VERSION_MAJOR=$((VERSION_MAJOR+1))
fi
VERSION_MINOR=0
VERSION_PATCH=0
;;
*)
echo "Unknown Semver level provided"
exit 1
;;
esac
NEW_VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
echo ""
echo "✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ "
echo "Current version ${CURRENT_TAG}"
echo " New version ${NEW_VERSION}"
echo "✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ "
echo ""
printf "Confirm? (y/n): "
read CONFIRM
if [ "${CONFIRM}" = "y" ]; then
git tag -a -m "${NEW_VERSION}" ${NEW_VERSION}
echo "New tag created, don't forget to push to remote"
else
echo "Aborting..."
exit 1
fi
else
_git $@
fi
}

View File

@@ -0,0 +1,39 @@
export EDITOR='vim'
export VISUAL='code'
export GPG_TTY=$(tty)
# AWS
export AWS_PAGER=""
if [ -f ~/.aws/profile ]; then
export AWS_PROFILE=$(cat ~/.aws/profile)
export AWS_DEFAULT_REGION=eu-west-1
export AWS_REGION=eu-west-1
fi
# Node
export NODE_ENV=localhost
[ -f ~/.npmrc ] && export NPM_TOKEN=`head -n 1 ~/.npmrc | sed 's~//registry.npmjs.org/:_authToken=\(.*\)~\1~'`
# Go
export GOPATH=$HOME/goworkspace
export GO111MODULE=on
# Starship
export STARSHIP_CONFIG=~/.starship/config.toml
export STARSHIP_LOG=error
# Bat
export BAT_THEME="Monokai Extended Light"
export BAT_STYLE="grid,header"
# TZ
export TZ_LIST="Europe/Berlin;Europe/Sofia;UTC"
# Docker
export DOCKER_HOST=$(docker context inspect --format='{{.Endpoints.docker.Host}}')
# Brew - Prevent updating all packages when installing a new one
export HOMEBREW_NO_AUTO_UPDATE=1
# k9s
export K9S_CONFIG_DIR="$HOME/.k9s"

View File

@@ -0,0 +1,6 @@
# Giant Swarm utils
which opsctl &>/dev/null && screen -dm bash -c 'opsctl version update'
which devctl &>/dev/null && screen -dm bash -c 'devctl version update'
which kubectl-gs &>/dev/null && screen -dm bash -c 'kubectl-gs selfupdate'
which opsctl &>/dev/null && opsctl completion zsh > /usr/local/share/zsh/site-functions/_opsctl
which devctl &>/dev/null && devctl completion zsh > /usr/local/share/zsh/site-functions/_devctl

11
home/.dotfiles/kubernetes Normal file
View File

@@ -0,0 +1,11 @@
alias k='kubectl '
alias kx='kube-exec '
alias kl='kube-logs '
alias kshell='kube-shell '
alias kall='kube-all '
alias fix-broken-replicasets='kube-clean-replicasets '
alias kube-forward='kube-forward-all '
source <(kubectl completion zsh)
source <(tkn completion zsh)

2
home/.dotfiles/network Normal file
View File

@@ -0,0 +1,2 @@
# Ensure local dnsmasq is used for DNS
which networksetup &>/dev/null && networksetup -setdnsservers Wi-Fi 127.0.0.1

69
home/.gitconfig Normal file
View File

@@ -0,0 +1,69 @@
[user]
name = Marcus Noble
email = github@marcusnoble.co.uk
signingkey = B8F2DB8A7AEBAF78
[commit]
gpgsign = true
[core]
editor = /usr/bin/vim
excludesfile = ~/.gitignore
[pager]
diff = delta
log = delta
reflog = delta
show = delta
[delta]
line-numbers = true
side-by-side = true
[push]
default = simple
followTags = true
[init]
defaultBranch = main
[credential]
helper = store
[color]
ui = true
[color "diff"]
old = red strike
new = green italic
[alias]
basename = "!git remote -v | head -n1 | awk '{print $2}' | sed 's/.*\\///' | sed 's/\\.git//'"
remote-base-url = "!git remote get-url $(git fork-or-origin) | tr ':' '/' | sed 's|ssh///git@|https://|' | sed 's|git@|https://|' | sed 's|\\.git|/|'"
org-name = "!git remote -v | grep -m 1 -o ':.*/' | sed 's:^.\\(.*\\).$:\\1:'"
branch-name = "!git rev-parse --abbrev-ref HEAD"
changelog-changed = "!test $(git diff --name-only HEAD origin/$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') | grep CHANGELOG.md | wc -l | xargs) = 1"
main-branch = "!git remote show origin 2>/dev/null | grep HEAD | sed 's/.* //'"
fork-or-origin = "!func(){ $(git remote show fork &>/dev/null); if [[ $? == 0 ]]; then echo \"fork\" ; else echo \"origin\"; fi; }; func"
main = "!git remote set-head origin --auto && git checkout $(git main-branch) && git pull"
pr-link = "!echo \"$(git remote-base-url)compare/$(git main-branch)...$(git branch-name)?expand=1\""
publish = "!func(){ if [[ $(git branch-name) != \"$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')\" ]]; then git push -u $(git fork-or-origin) $(git branch-name) && (git changelog-changed || echo '\n\n⚠ Dont forget to update changelog ⚠️ ') && (echo '\n\n'; git pr-link) ; else echo "Wat?!"; fi; }; func"
cleanup = "!git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done"
dont-change-file = "!git update-index --assume-unchanged"
ignore-file = "!git update-index --skip-worktree"
remember-file = "!git update-index --no-skip-worktree"
logg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
dif = "!git diff -w"
pop = "!git stash pop"
current-remote = "!func(){ REMOTE=$(git rev-parse --abbrev-ref @{u}) ; echo ${REMOTE%/*} ; }; func"
[help]
autocorrect = 1
[diff]
compactionHeuristic = true
[url "ssh://git@github.com"]
insteadOf = https://github.com
[pull]
rebase = false
[gpg]
program = /opt/homebrew/bin/gpg

9
home/.k9s/aliases.yaml Normal file
View File

@@ -0,0 +1,9 @@
aliases:
dp: deployments
sec: v1/secrets
jo: jobs
cr: clusterroles
crb: clusterrolebindings
ro: roles
rb: rolebindings
np: networkpolicies

42
home/.k9s/config.yaml Normal file
View File

@@ -0,0 +1,42 @@
k9s:
liveViewAutoRefresh: false
refreshRate: 2
maxConnRetry: 5
readOnly: false
noExitOnCtrlC: false
ui:
enableMouse: false
headless: false
logoless: true
crumbsless: false
reactive: true
noIcons: false
skin: default
skipLatestRevCheck: false
disablePodCounting: false
shellPod:
image: busybox:1.35.0
namespace: default
limits:
cpu: 100m
memory: 100Mi
tty: true
imageScans:
enable: false
exclusions:
namespaces: []
labels: {}
logger:
tail: 5000
buffer: 50000
sinceSeconds: 0
fullScreen: false
textWrap: false
showTime: false
thresholds:
cpu:
critical: 90
warn: 80
memory:
critical: 90
warn: 80

154
home/.k9s/plugins.yaml Normal file
View File

@@ -0,0 +1,154 @@
plugins:
# kubectl-blame by knight42
# Annotate each line in the given resource's YAML with information from the managedFields to show who last modified the field.
# Source: https://github.com/knight42/kubectl-blame
# Install via:
# krew: `kubectl krew install blame`
# go: `go install github.com/knight42/kubectl-blame@latest`
blame:
shortCut: b
confirm: false
description: "Blame"
scopes:
- all
command: sh
background: false
args:
- -c
- "kubectl-blame $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT | less"
# Suspends/Resumes a cronjob
toggleCronjob:
shortCut: Shift-S
confirm: true
scopes:
- cj
description: Toggle to suspend or resume a running cronjob
command: kubectl
background: true
args:
- patch
- cronjobs
- $NAME
- -n
- $NAMESPACE
- --context
- $CONTEXT
- -p
- '{"spec" : {"suspend" : $!COL-SUSPEND }}'
# Flux
reconcile-git:
shortCut: Shift-R
confirm: false
description: Flux reconcile
scopes:
- gitrepositories
command: bash
background: false
args:
- -c
- >-
flux
reconcile source git
--context $CONTEXT
-n $NAMESPACE $NAME
| less -K
reconcile-hr:
shortCut: Shift-R
confirm: false
description: Flux reconcile
scopes:
- helmreleases
command: bash
background: false
args:
- -c
- >-
flux
reconcile helmrelease
--context $CONTEXT
-n $NAMESPACE $NAME
| less -K
reconcile-helm-repo:
shortCut: Shift-R
description: Flux reconcile
scopes:
- helmrepositories
command: bash
background: false
confirm: false
args:
- -c
- >-
flux
reconcile source helm
--context $CONTEXT
-n $NAMESPACE $NAME
| less -K
reconcile-oci-repo:
shortCut: Shift-R
description: Flux reconcile
scopes:
- ocirepositories
command: bash
background: false
confirm: false
args:
- -c
- >-
flux
reconcile source oci
--context $CONTEXT
-n $NAMESPACE $NAME
| less -K
reconcile-ks:
shortCut: Shift-R
confirm: false
description: Flux reconcile
scopes:
- kustomizations
command: bash
background: false
args:
- -c
- >-
flux
reconcile kustomization
--context $CONTEXT
-n $NAMESPACE $NAME
| less -K
remove_finalizers:
shortCut: Ctrl-F
confirm: true
scopes:
- all
description: |
Removes all finalizers
command: kubectl
background: true
args:
- patch
- --context
- $CONTEXT
- --namespace
- $NAMESPACE
- $RESOURCE_NAME.$RESOURCE_GROUP
- $NAME
- -p
- '{"metadata":{"finalizers":null}}'
- --type
- merge
watch-events:
shortCut: Shift-E
confirm: false
description: Watch Events
scopes:
- all
command: sh
background: false
args:
- -c
- "kubectl events --context $CONTEXT --namespace $NAMESPACE --for $RESOURCE_NAME.$RESOURCE_GROUP/$NAME --watch"

View File

@@ -0,0 +1,75 @@
# Base16 Material - k9s color config
# Scheme author: Nate Peterson
# Template author: Jef LeCompte (https://jef.buzz)
k9s:
# General K9s styles
body:
fgColor: '#eeffff'
bgColor: '#263238'
logoColor: '#89ddff'
# ClusterInfoView styles
info:
fgColor: '#c3e88d'
sectionColor: '#eeffff'
# Frame styles
frame:
# Borders styles
border:
fgColor: '#82aaff'
focusColor: '#89ddff'
# MenuView attributes and styles
menu:
fgColor: '#eeffff'
keyColor: '#c3e88d'
# Used for favorite namespaces
numKeyColor: '#c3e88d'
# CrumbView attributes for history navigation.
crumbs:
fgColor: '#89ddff'
bgColor: '#263238'
activeColor: '#263238'
# Resource status and update styles
status:
newColor: '#eeffff'
modifyColor: '#ffcb6b'
addColor: '#c3e88d'
errorColor: '#f07178'
highlightcolor: '#89ddff'
killColor: '#f07178'
completedColor: '#c3e88d'
# Border title styles.
title:
fgColor: '#eeffff'
bgColor: '#263238'
highlightColor: '#c792ea'
counterColor: '#c792ea'
filterColor: '#c792ea'
# Specific views styles
views:
# TableView attributes.
table:
fgColor: '#82aaff'
bgColor: '#263238'
cursorColor: '#89ddff'
# Header row styles.
header:
fgColor: '#82aaff'
bgColor: '#263238'
sorterColor: '#c792ea'
# YAML info styles.
yaml:
keyColor: '#f07178'
colonColor: '#89ddff'
valueColor: '#eeffff'
# Logs styles.
logs:
fgColor: '#eeffff'
bgColor: '#263238'

View File

View File

@@ -0,0 +1,8 @@
kind: SwitchConfig
version: v1alpha1
kubeconfigName: "*.yaml"
kubeconfigStores:
- kind: filesystem
kubeconfigName: "*.yaml"
paths:
- ~/.kube/clusters/

View File

@@ -0,0 +1,4 @@
long_uptime = true
long_shell = true
physical_cores = true
show = [ "Host", "Machine", "OperatingSystem", "Terminal", "Shell", "Uptime" ]

44
home/.macchina/theme.toml Normal file
View File

@@ -0,0 +1,44 @@
hide_ascii = true
spacing = 1
padding = 0
separator = ""
key_color = "Cyan"
separator_color = "LightMagenta"
[bar]
glyph = "⭘"
symbol_open = ""
symbol_close = ""
visible = true
[box]
title = " Info "
border = "double"
visible = true
[box.inner_margin]
x = 1
y = 0
[randomize]
key_color = false
separator_color = false
[keys]
host = "Host"
kernel = "Kernel"
battery = "Battery"
os = "OS"
distro = "Distro"
terminal = "Terminal"
shell = "Shell"
packages = "Packages"
uptime = "Uptime"
memory = "Memory"
machine = "Machine"
local_ip = "IP"
backlight = "Brightness"
resolution = "Resolution"
cpu_load = "CPU Load"
cpu = "CPU"

View File

@@ -0,0 +1,93 @@
format = """\
$status\
$cmd_duration\
$hostname\
$directory\
$git_branch\
$git_commit\
$git_state\
$git_status\
$kubernetes\
$helm\
$golang\
$nodejs\
$terraform\
$package\
$custom\
$time\
$line_break\
$jobs\
$character\
"""
command_timeout = 1000
add_newline = true
[hostname]
ssh_only = true
format = "🌐 [$hostname](bold dimmed blue) \n"
disabled = false
[directory]
format = "┏  [$path]($style)[$read_only]($read_only_style) "
[character]
success_symbol = "┗ [✨](yellow)"
error_symbol = "┗ [✗](fg:204)"
[git_branch]
format = "⎮ [$symbol$branch]($style) "
symbol = "🌱 "
[git_commit]
only_detached = true
[git_status]
format = '\($all_status$ahead_behind\) '
up_to_date = "[✓](green)"
modified = "[!](bold fg:208)"
untracked = "[?](bold fg:75)"
staged = '[++\($count\)](green)'
[aws]
symbol = " "
format = "⎮ [$symbol$profile]($style) "
[golang]
symbol = " "
format = "⎮ [$symbol$version](fg:45) "
[kubernetes]
format = '⎮ [$symbol$context (\($namespace\))]($style) '
symbol = "ﴱ "
style = "bold blue"
disabled = false
[kubernetes.context_aliases]
"gs-(?P<cluster>.+)" = "$cluster [MC]"
[terraform]
format = "⎮ [$symbol$version]($style) "
[nodejs]
symbol = " "
[status]
symbol = "✗"
format = "[↪ $symbol $common_meaning$signal_name$maybe_int](fg:204)\n"
map_symbol = true
disabled = false
[helm]
format = "⎮ [$symbol$version]($style) "
symbol = " "
[cmd_duration]
format = " took [$duration]($style) \n"
[package]
symbol = "📦"
format = "⎮ [$symbol$version]($style) "
[jobs]
number_threshold = 1
format = "┣ [$symbol $number background jobs\n]($style)"

View File

@@ -0,0 +1,92 @@
"########################################
"########################################
" Tickle Contrast (rainglow)
"
" https://github.com/rainglow/vim
"
" Copyright (c) Dayle Rees.
"########################################
"########################################
"########################################
"# Settings. #
"########################################
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "tickle-contrast"
"########################################
"# Base Colors. #
"########################################
hi Cursor guifg=#181819 guibg=#f8f8f0 gui=NONE
hi Visual guifg=#85ffc7 guibg=#ffffff gui=NONE
hi CursorLine guifg=NONE guibg=#1f1f21 gui=NONE
hi CursorLineNr guifg=#636367 guibg=#060607 gui=NONE
hi CursorColumn guifg=NONE guibg=#060607 gui=NONE
hi ColorColumn guifg=NONE guibg=#000000 gui=NONE
hi LineNr guifg=#313133 guibg=#0b0b0c gui=NONE
hi VertSplit guifg=#313133 guibg=#313133 gui=NONE
hi MatchParen guifg=#40a5a5 guibg=NONE gui=underline
hi StatusLine guifg=#c1c1c1 guibg=#0b0b0c gui=bold
hi StatusLineNC guifg=#c1c1c1 guibg=#0b0b0c gui=NONE
hi Pmenu guifg=#c1c1c1 guibg=#0b0b0c gui=NONE
hi PmenuSel guifg=NONE guibg=#85ffc7 gui=NONE
hi IncSearch guifg=#c1c1c1 guibg=#afd1d1 gui=NONE
hi Search guifg=NONE guibg=NONE gui=underline
hi Directory guifg=#85ffc7 guibg=NONE gui=NONE
hi Folded guifg=#b4b4b4 guibg=#000000 gui=NONE
hi Normal guifg=#ff8552 guibg=#181819 gui=NONE
hi Boolean guifg=#ff8552 guibg=NONE gui=NONE
hi Character guifg=#86baba guibg=NONE gui=NONE
hi Comment guifg=#606063 guibg=NONE gui=NONE
hi Conditional guifg=#85ffc7 guibg=NONE gui=NONE
hi Constant guifg=NONE guibg=NONE gui=NONE
hi Define guifg=#85FFC7 guibg=NONE gui=NONE
hi DiffAdd guifg=#3d3d40 guibg=#a7da1e gui=bold
hi DiffDelete guifg=#3d3d40 guibg=#e61f44 gui=NONE
hi DiffChange guifg=#3d3d40 guibg=#f7b83d gui=NONE
hi DiffText guifg=#3d3d40 guibg=#f7b83d gui=bold
hi ErrorMsg guifg=#3d3d40 guibg=#e61f44 gui=NONE
hi WarningMsg guifg=#3d3d40 guibg=#f7b83d gui=NONE
hi Float guifg=#afd1d1 guibg=NONE gui=NONE
hi Function guifg=#85ffc7 guibg=NONE gui=NONE
hi Identifier guifg=#ffffff guibg=NONE gui=NONE
hi Keyword guifg=#85ffc7 guibg=NONE gui=NONE
hi Label guifg=#86baba guibg=NONE gui=NONE
hi NonText guifg=#5b5b5b guibg=#131314 gui=NONE
hi Number guifg=#afd1d1 guibg=NONE gui=NONE
hi Operator guifg=#c1c1c1 guibg=NONE gui=NONE
hi PreProc guifg=#86868a guibg=NONE gui=NONE
hi Special guifg=#c1c1c1 guibg=NONE gui=NONE
hi SpecialKey guifg=#c1c1c1 guibg=#85ffc7 gui=NONE
hi Statement guifg=#85ffc7 guibg=NONE gui=NONE
hi StorageClass guifg=#40a5a5 guibg=NONE gui=NONE
hi String guifg=#86baba guibg=NONE gui=NONE
hi Tag guifg=#85ffc7 guibg=NONE gui=NONE
hi Title guifg=#85ffc7 guibg=NONE gui=bold
hi Todo guifg=#86868a guibg=NONE gui=inverse,bold
hi Type guifg=NONE guibg=NONE gui=NONE
hi Underlined guifg=NONE guibg=NONE gui=underline
"########################################
"# Language Overrides #
"########################################
hi phpIdentifier guifg=#ffffff
hi phpMethodsVar guifg=#cacacc
hi xmlTag guifg=#85ffc7 guibg=NONE gui=NONE
hi xmlTagName guifg=#85ffc7 guibg=NONE gui=NONE
hi xmlEndTag guifg=#85ffc7 guibg=NONE gui=NONE
"########################################
"# Light Theme Overrides #
"########################################

6
home/.vimrc Normal file
View File

@@ -0,0 +1,6 @@
colorscheme tickle-contrast
set paste
set number
set linespace=3
set cursorline
syntax on

37
home/.zshrc Normal file
View File

@@ -0,0 +1,37 @@
DISABLE_AUTO_UPDATE="true"
PATH_DIRS=(
"${HOME}/.bin"
"${KREW_ROOT:-${HOME}/.krew}/bin"
"${GOPATH:-${HOME}/goworkspace}/bin"
"${HOME}/.cargo/bin"
"/home/linuxbrew/.linuxbrew/bin"
"/opt/homebrew/bin/"
"${HOME}/Library/Python/3.11/bin"
"/usr/local/bin"
"/usr/bin"
"/bin"
"/usr/sbin"
"/sbin"
"${PATH}"
)
export PATH=${"${PATH_DIRS[*]}"// /:}
export FPATH="$FPATH:/opt/homebrew/share/zsh/site-functions"
if [ ! -z ~/.additional_dotfiles/credentials ]; then
source ~/.additional_dotfiles/credentials
fi
for filename in ~/.dotfiles/*; do
source $filename
done
for filename in ~/.additional_dotfiles/*; do
source $filename
done
rm -f ~/.zcompdump; compinit
eval "$(starship init zsh)"
macchina --config ~/.macchina/config.toml --theme ~/.macchina/theme

254
install.sh Executable file
View File

@@ -0,0 +1,254 @@
#!/usr/bin/env bash
export PATH="/home/linuxbrew/.linuxbrew/bin:/opt/homebrew/bin/:$PATH"
[ -d ~/.additional_dotfiles ] || (mkdir -p ~/.additional_dotfiles && touch ~/.additional_dotfiles/credentials)
[ -d /usr/local/share/zsh/site-functions ] || (sudo mkdir -p /usr/local/share/zsh/site-functions && sudo chmod 777 /usr/local/share/zsh/site-functions)
# Install homebrew
echo ""
echo "🔵 Installing homebrew"
which brew >/dev/null || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "✅"
# Install oh-my-zsh
echo ""
echo "🔵 Setting up zsh"
printf "Cloning oh-my-zsh..."
[ -d ${HOME}/.oh-my-zsh ] || sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
printf " ✅\n"
# Install ZSH plugins
printf "Cloning zsh plugins..."
[ -d ${ZSH_CUSTOM:-${HOME}/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ] || git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-${HOME}/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
[ -d ${ZSH_CUSTOM:-${HOME}/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ] || git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-${HOME}/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
printf " ✅\n"
# Set correct permissions on compinit dir
sudo chmod -R 755 /usr/local/share/zsh/site-functions
# Install tools
BREW_TOOLS=(
git argocd bandwhich bat danielfoehrkn/switch/switch derailed/k9s/k9s
dive doggo duf dust eza fd fzf git-delta go helm htop jq kind krew curl
kubectl kustomize node procs progress ripgrep rs/tap/curlie rust starship
tektoncd/tools/tektoncd-cli tldr tailscale yq tabby vale jless macchina tz viddy
homeassistant-cli act dnsmasq gh kubebuilder golangci-lint gnu-sed s3cmd
pulumi/tap/pulumi kubeseal fluxcd/tap/flux ical-buddy baobab
watch crane openssh siderolabs/talos/talosctl civo/tools/civo raspberry-pi-imager
gron ssup2/tap/kpexec opentofu visual-studio-code 1password-cli scw smartmontools
firefox signal slack ffmpeg openscad tsh colima docker docker-buildx nordvpn
1password tailscale-app
)
# Brew tools only available / needed on Mac
MAC_BREW_TOOLS=(
pinentry-mac gpg gawk coreutils wget stats font-open-dyslexic-nerd-font
dimentium/autoraise/autoraiseapp the-unarchiver rar mas capcut
mqtt-explorer raycast bettertouchtool calibre kdenlive royal-tsx tableplus
homebrew/cask/todoist ultimaker-cura webtorrent pika pearcleaner spotmenu
jordanbaird-ice
)
CARGO_TOOLS=( bottom )
NODE_TOOLS=( git-split-diffs )
KREW_TOOLS=( outdated tree stern explore blame access-matrix cert-manager rbac-tool resource-capacity view-secret )
APT_TOOLS=( zsh gcc )
MAS_TOOLS=(
1263070803 # Lungo
1470584107 # Dato
1351639930 # Gifski
)
# Tools removed to be cleaned up
REMOVED_BREW_TOOLS=(
exa karabiner-elements kubectx hiddenbar
)
REMOVED_KREW_TOOLS=( gs )
echo ""
echo "🔵 Installing / updating tools"
# Install Debian/Ubuntu specific packages if apt exists
if command -v apt &>/dev/null; then
echo "'apt' found on system, assuming Ubuntu/Debian and installing pre-requisites..."
sudo apt install -y ${APT_TOOLS}
fi
# Homebrew
echo ""
echo "🔵 Homebrew tools"
export HOMEBREW_NO_INSTALL_CLEANUP=true
for tool in "${BREW_TOOLS[@]}"
do
printf "${tool}..."
brew upgrade ${tool} &>/dev/null || brew install ${tool} &>/dev/null
if [ $? -eq 0 ]; then
printf " ✅\n"
else
printf " ❌\n"
fi
done
# Cargo
echo ""
echo "🔵 Cargo tools"
for tool in "${CARGO_TOOLS[@]}"
do
printf "${tool}..."
cargo install ${tool} &>/dev/null
if [ $? -eq 0 ]; then
printf " ✅\n"
else
printf " ❌\n"
fi
done
# Krew
echo ""
echo "🔵 Krew tools"
kubectl-krew update &>/dev/null
for tool in "${KREW_TOOLS[@]}"
do
printf "${tool}..."
kubectl-krew upgrade ${tool} &>/dev/null || kubectl-krew install ${tool} &>/dev/null
if [ $? -eq 0 ]; then
printf " ✅\n"
else
printf " ❌\n"
fi
done
fulllink() {
if [ ! -z `which greadlink` ]
then
greadlink -f $1
else
readlink -f $1
fi
}
echo ""
echo "🔵 OS Specific setup"
echo "Detected OS type: ${OSTYPE}"
case "${OSTYPE}" in
*linux*)
# Do stuff
;;
*darwin*)
# Mac specific setup
echo ""
echo "Instaling Mac-specific Brew tools..."
for tool in "${MAC_BREW_TOOLS[@]}"
do
printf "${tool}..."
brew upgrade ${tool} &>/dev/null || brew install ${tool} &>/dev/null
if [ $? -eq 0 ]; then
printf " ✅\n"
else
printf " ❌\n"
fi
done
# Mac App Store
echo ""
echo "Instaling Mac-specific App Store tools..."
for tool in "${MAS_TOOLS[@]}"
do
printf "MAS ID: ${tool}..."
mas install ${tool} &>/dev/null
if [ $? -eq 0 ]; then
printf " ✅\n"
else
printf " ❌\n"
fi
done
echo ""
echo "Setting up config files"
FILES=$(/usr/bin/find ./os-specific/darwin/home -maxdepth 1 -mindepth 1 | tr '\n' ' ')
for file in $FILES
do
f=$(fulllink "${file}")
dst="${HOME}/$(basename "./os-specific/darwin/home/${file}")"
printf "Linking ${f}=>${dst}"
ln -sfn ${f} ${dst}
printf " ✅\n"
done
[ -f "/usr/local/bin/pinentry-mac" ] || sudo ln -s `which pinentry-mac` /usr/local/bin/pinentry-mac
gpgconf --kill gpg-agent
if [ $(gpg --list-secret-keys --keyid-format=long 2>/dev/null | wc -l | xargs) -eq 0 ]; then
echo "⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️"
echo "⚠️ You'll need to create a new GPG key ⚠️"
echo "⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️"
fi
# Handle other files outside of the user's home directory
echo ""
echo "🔵 Handiling non-standard files:"
# 1. Tabby config
mkdir -p "/Users/${USER}/Library/Application Support/tabby"
f=$(fulllink "./other-files/tabby/config.yaml")
dst="/Users/${USER}/Library/Application Support/tabby/config.yaml"
printf "Linking ${f}=>${dst}"
ln -sfn "${f}" "${dst}"
printf " ✅\n"
# 2. dnsmasq
f=$(fulllink "./other-files/dnsmasq/dnsmasq.conf")
dst="$(brew --prefix)/etc/dnsmasq.conf"
printf "Copying ${f}=>${dst}"
cp ${f} ${dst}
printf " ✅\n"
printf "Setting DNS server for 'Wi-Fi' interface to use dnsmasq"
sudo networksetup -setdnsservers "Wi-Fi" 127.0.0.1
printf " ✅\n"
;;
esac
echo ""
echo "🔵 Adding configuration"
FILES=$(/usr/bin/find ./home -maxdepth 1 -mindepth 1 | tr '\n' ' ')
for file in $FILES
do
f=$(fulllink "${file}")
dst="${HOME}/$(basename "./home/${file}")"
printf "Linking ${f} => ${dst}"
ln -sfn ${f} ${dst}
printf " ✅\n"
done
echo ""
echo "🔵 Updating installed tools..."
brew upgrade
mas upgrade
echo ""
echo "🔵 Removing old Homebrew tools"
export HOMEBREW_NO_INSTALL_CLEANUP=true
for tool in "${REMOVED_BREW_TOOLS[@]}"
do
printf "${tool}..."
brew uninstall ${tool} &>/dev/null
if [ $? -eq 0 ]; then
printf " ✅\n"
else
printf " ❌\n"
fi
done
echo ""
echo "🔵 Removing old Krew tools"
for tool in "${REMOVED_KREW_TOOLS[@]}"
do
printf "${tool}..."
kubectl-krew uninstall ${tool} &>/dev/null
if [ $? -eq 0 ]; then
printf " ✅\n"
else
printf " ❌\n"
fi
done

View File

@@ -0,0 +1,5 @@
pinentry-program /opt/homebrew/bin//pinentry-mac
default-cache-ttl 0
max-cache-ttl 600
default-cache-ttl-ssh 0
max-cache-ttl-ssh 0

View File

@@ -0,0 +1 @@
pinentry-mode loopback

View File

@@ -0,0 +1,12 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Brand
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
open 'smb://nas._smb._tcp.local/Nextcloud/Pictures/Brand'

View File

@@ -0,0 +1,16 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Litra Glow Off
# @raycast.mode silent
# Optional parameters:
# @raycast.icon ⚫️
# Documentation:
# @raycast.description Turn off Litra Glow light
cd ~/.bin/
./litractl off

View File

@@ -0,0 +1,15 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Litra Glow On
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 💡
# Documentation:
# @raycast.description Turn on Litra Glow light
cd ~/.bin/
./litractl on

View File

@@ -0,0 +1,12 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Nextcloud
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
open 'smb://nas._smb._tcp.local/Nextcloud'

View File

@@ -0,0 +1,11 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Reaction Gifs
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
open 'smb://nas._smb._tcp.local/Nextcloud/Pictures/ReactionGifs'

View File

@@ -0,0 +1,15 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Restart BusyCal Menu
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
# Documentation:
# @raycast.description Kills the BusyCal process
pkill busycal-setapp.alarm
open /Applications/Setapp/BusyCal.app

View File

@@ -0,0 +1,14 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Restart Logi daemon
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
# Documentation:
# @raycast.description Kills the LogiMgr process to allow a new one to spawn
pkill LogiMgr

View File

@@ -0,0 +1,12 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Things
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
open 'smb://nas._smb._tcp.local/Things'

View File

@@ -0,0 +1,34 @@
#!/usr/bin/osascript
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Toggle Microphone
# @raycast.mode silent
# @raycast.packageName System
# Optional parameters:
# @raycast.icon 🎙
# Documentation:
# @raycast.author Matthew Morek
# @raycast.authorURL https://github.com/matthewmorek
# @raycast.description Toggles microphone.
on getMicrophoneVolume()
input volume of (get volume settings)
end getMicrophoneVolume
on disableMicrophone()
set volume input volume 0
log "Microphone turned off 🔴"
end disableMicrophone
on enableMicrophone()
set volume input volume 100
log "Microphone turned on 🟢"
end enableMicrophone
if getMicrophoneVolume() is greater than 0 then
disableMicrophone()
else
enableMicrophone()
end if

View File

@@ -0,0 +1,11 @@
server=/cluster.local/192.168.1.3
server=192.168.1.3
server=192.168.1.4
server=192.168.1.5
server=1.1.1.1
port=53
listen-address=127.0.0.1
bogus-priv
no-resolv
bind-interfaces
auth-ttl=0

View File

@@ -0,0 +1,218 @@
version: 7
profiles: []
hotkeys:
copy-current-path: []
ctrl-c:
- Ctrl-C
copy:
- ⌘-C
paste:
- ⌘-V
clear:
- ⌘-K
select-all:
- ⌘-A
zoom-in:
- ⌘-=
- ⌘-Shift-=
zoom-out:
- ⌘--
- ⌘-Shift--
reset-zoom:
- ⌘-0
home:
- ⌘-Left
- Home
end:
- ⌘-Right
- End
previous-word:
- ⌥-Left
next-word:
- ⌥-Right
delete-previous-word:
- ⌥-Backspace
delete-next-word:
- ⌥-Delete
search:
- ⌘-F
pane-focus-all:
- ⌘-Shift-I
restart-telnet-session: []
restart-ssh-session: []
launch-winscp: []
settings:
- ⌘-,
serial:
- Alt-K
restart-serial-session: []
new-window:
- ⌘-N
new-tab:
- ⌘-T
profile: {}
profile-selectors: {}
toggle-fullscreen:
- Ctrl+⌘+F
close-tab:
- ⌘-W
reopen-tab:
- ⌘-Shift-T
toggle-last-tab: []
rename-tab:
- ⌘-R
next-tab:
- Ctrl-Tab
previous-tab:
- Ctrl-Shift-Tab
move-tab-left:
- ⌘-Shift-Left
move-tab-right:
- ⌘-Shift-Right
rearrange-panes:
- ⌘-Shift
tab-1:
- ⌘-1
tab-2:
- ⌘-2
tab-3:
- ⌘-3
tab-4:
- ⌘-4
tab-5:
- ⌘-5
tab-6:
- ⌘-6
tab-7:
- ⌘-7
tab-8:
- ⌘-8
tab-9:
- ⌘-9
tab-10:
- ⌘-0
duplicate-tab: []
tab-11: []
tab-12: []
tab-13: []
tab-14: []
tab-15: []
tab-16: []
tab-17: []
tab-18: []
tab-19: []
tab-20: []
split-right:
- ⌘-Shift-D
split-bottom:
- ⌘-D
split-left: []
split-top: []
pane-nav-right:
- ⌘-⌥-Right
pane-nav-down:
- ⌘-⌥-Down
pane-nav-up:
- ⌘-⌥-Up
pane-nav-left:
- ⌘-⌥-Left
pane-nav-previous:
- ⌘-⌥-[
pane-nav-next:
- ⌘-⌥-]
pane-maximize:
- ⌘-⌥-Enter
close-pane:
- ⌘-Shift-W
profile-selector:
- ⌘-E
switch-profile:
- ⌘-Shift-E
toggle-window: []
scroll-to-bottom: []
delete-line:
- ⌘-Backspace
settings-tab: {}
explode-tab:
- ⌘-Shift-.
combine-tabs:
- ⌘-Shift-,
pane-nav-1: []
pane-nav-2: []
pane-nav-3: []
pane-nav-4: []
pane-nav-5: []
pane-nav-6: []
pane-nav-7: []
pane-nav-8: []
pane-nav-9: []
pane-increase-vertical: []
pane-decrease-vertical: []
pane-increase-horizontal: []
pane-decrease-horizontal: []
focus-all-tabs:
- ⌘-⌥-Shift-I
scroll-to-top:
- Shift-PageUp
scroll-up:
- ⌥-PageUp
scroll-down:
- ⌥-PageDown
restart-tab: []
reconnect-tab: []
disconnect-tab: []
command-selector:
- ⌘-Shift-P
terminal:
searchOptions: {}
colorScheme:
name: hyper-chesterish
foreground: '#CDD2E9'
background: '#293340'
cursor: '#2C85F7'
colors:
- '#293340'
- '#E17E85'
- '#61BA86'
- '#FFEC8E'
- '#4CB2FF'
- '#BE86E3'
- '#2DCED0'
- '#CDD2E9'
- '#546386'
- '#E17E85'
- '#61BA86'
- '#FFB68E'
- '#4CB2FF'
- '#BE86E3'
- '#2DCED0'
- '#CDD2E9'
font: OpenDyslexicMono Nerd Font
ligatures: true
cursor: beam
pasteOnMiddleClick: false
customColorSchemes: []
background: colorScheme
autoOpen: true
ssh: {}
configSync:
parts: {}
clickableLinks:
modifier: metaKey
appearance:
dockFill: 0.23
css: ''
pluginBlacklist: []
enableAnalytics: false
enableWelcomeTab: false
profileDefaults: {}
recoverTabs: false
electronFlags:
- - force_discrete_gpu
- '0'
accessibility: {}
hacks: {}
groups: []
providerBlacklist: []
commandBlacklist: []
profileBlacklist: []