Skip to content

Instantly share code, notes, and snippets.

View ilyam8's full-sized avatar
👉
Don't Use The ELSE Keyword

Ilya Mashchenko ilyam8

👉
Don't Use The ELSE Keyword
View GitHub Profile
@ilyam8
ilyam8 / kubedf
Created March 23, 2023 10:36 — forked from redmcg/kubedf
Bash script to show k8s PVC usage
#!/usr/bin/env bash
NODESAPI=/api/v1/nodes
function getNodes() {
kubectl get --raw $NODESAPI | jq -r '.items[].metadata.name'
}
function getPVCs() {
jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\
name: CI
on: [push, pull_request]
jobs:
deploy:
name: "SSH test"
runs-on: ubuntu-latest
steps:
- name: Install needed packages
run: sudo apt-get install socat psmisc
- name: Configure SSH
@ilyam8
ilyam8 / ctx.yml
Last active May 27, 2022 08:30
Netdata Menu Context WIP
# MAIN GUIDELINES
# * All metrics related to system resources are put under `system` as a root, this implies a merging of System with CPU, Disk, Network, Memory, etc.
# * There wasn't (much) of a concern to keep the hierarhy/section levels to a minimum, logic was priortized against outcome
# * Netdata Overview screen with in-section filter capabilites, as well as, better and easier Custom Dashboard creation/management features are considered to allow better UX
# * POC was focused on doing some sections to proof the logic, System, Virtualization, ...
# * OpenTelemety Metric Semantic Convetions were followed to the best of our understanding (even they seem to have different approaches in different domains) - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/README.md
# - same metric attributes were purposefuly set as part of the context name to better present things to the user, e.g. system.cpu.core.utilization where `core` should be an attribut
#!/usr/bin/env bash
NETDATA_CONF_URL="http://127.0.0.1:19999/netdata.conf"
DASHBOARD_RELEASE_TAG="${1}"
DASHBOARD_LATEST_RELEASE_URL="https://api.github.com/repos/netdata/dashboard/releases/latest"
DASHBOARD_DOWNLOAD_URL="https://github.com/netdata/dashboard/releases/download/TAG/dashboard.tar.gz"
DASHBOARD_FILE="dashboard.tar.gz"
RCol='\e[0m'
@ilyam8
ilyam8 / Calisthenics.md
Created January 9, 2020 16:11 — forked from bobuss/Calisthenics.md
The 9 Rules of Object Calisthenics

Object Calisthenics outlines 9 basic rules to apply when performing the exercise:

  • One level of indentation per method.
  • Don't use the ELSE keyword.
  • Wrap all primitives and Strings in classes.
  • First class collections.
  • One dot per line.
  • Don't abbreviate.
  • Keep all classes less than 50 lines.
  • No classes with more than two instance variables.
import datetime
import json
from collections import defaultdict
from bases.FrameworkServices.UrlService import UrlService
update_every = 5