Skip to content

Instantly share code, notes, and snippets.

View L-U-C-K-Y's full-sized avatar

Lucky L-U-C-K-Y

  • JobDone
  • Zürich, Switzerland
View GitHub Profile
@L-U-C-K-Y
L-U-C-K-Y / kubernetes-nodes-with-stats.md
Last active June 4, 2023 19:22
kubectl get nodes with cpu, memory and storage without any plugins
kubectl get nodes -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.capacity.cpu}{"\t"}{.status.capacity.memory}{"\t"}{.status.capacity.ephemeral-storage}{"\n"}{end}' | awk '{print $1, "\t", $2, "\t", $3/1024/1024, "GB", "\t", $4/1024/1024, "GB"}'
@L-U-C-K-Y
L-U-C-K-Y / cloud-init.yaml
Created December 30, 2023 17:14 — forked from syntaqx/cloud-init.yaml
cloud init / cloud config to install Docker on Ubuntu
#cloud-config
# Option 1 - Full installation using cURL
package_update: true
package_upgrade: true
groups:
- docker
system_info:
@L-U-C-K-Y
L-U-C-K-Y / async-await-forEach-alternatives.md
Created February 13, 2024 07:17 — forked from joeytwiddle/async-await-forEach-alternatives.md
Do not use forEach with async-await

Do not use forEach with async-await

TLDR: Use for...of instead of forEach() in asynchronous code.

For legacy browsers, use for...i or [].reduce()

To execute the promises in parallel, use Promise.all([].map(...))

The problem