Skip to content

Instantly share code, notes, and snippets.

View voxmaster's full-sized avatar
🇺🇦

Oleksii Marchenko voxmaster

🇺🇦
View GitHub Profile
#!/usr/local/bin/python3
from kubernetes import client, config
import sys
config.load_kube_config()
def print_help():
print('I need the namespace(s) as an argument')
if len(sys.argv) <= 1:
@redmcg
redmcg / kubedf
Last active July 3, 2024 20:55
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")) | '\
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 17, 2024 18:10
set -e, -u, -o, -x pipefail explanation
@jukben
jukben / Fastlane
Created March 29, 2018 12:30
Fastlane – example how to increment versions based on package.json
# ios
match(...)
package = load_json(json_path: "../package.json")
increment_version_number(version_number: package["version"])
increment_build_number(build_number: ENV["CIRCLE_BUILD_NUM"] || 1)
# android
package = load_json(json_path: "../package.json")
@stroebs
stroebs / make-chr.sh
Last active July 6, 2024 16:36
Install Mikrotik CHR on a Digital Ocean droplet (Ubuntu 20.04 tested working 29/03/2022)
#!/bin/bash
#
# Digital Ocean Ubuntu 18.04 x64 Droplet with "Regular Intel" CPU.
# Running:
# git clone https://gist.github.com/54fc09734a3911e91eeeb43434f117df.git
# cd 54fc09734a3911e91eeeb43434f117df/
# chmod +x make-chr.sh
# ./make-chr.sh
#
# Once the reboot is done, login with root/CHANGEME and change the password!
@mrinterweb
mrinterweb / thin.sh
Created November 23, 2010 22:45
/etc/init.d/thin
#!/bin/sh
# This is a pretty bad, but effective workaround for starting thin as a service per application.
DAEMON=/usr/local/lib/ruby/gems/1.9.1/bin/thin
# DAEMON=/usr/local/bin/bundler thin
SCRIPT_NAME=/etc/init.d/thin
CONFIG_PATH=/etc/thin
# Exit if the package is not installed