Skip to content

Instantly share code, notes, and snippets.

@groundnuty
groundnuty / charts_bench.sh
Created April 22, 2019 16:26
Benchmarking of k8s deployment
while IFS=',' read -r name sched ready compl initf ; do
name=$(echo $name | cut -d= -f2) ;
ready=$(echo $ready | cut -d= -f2);
sched=$(echo $sched | cut -d= -f2) ;
compl=$(echo $compl | cut -d= -f2) ;
initf=$(echo $initf | cut -d= -f2) ;
[ "$initf" = "null" ] && initf="" ;
s=$sched;
e=$ready;
[ "$initf" != "" ] && s=$initf ;
@groundnuty
groundnuty / config.yaml
Last active May 14, 2020 11:51
onedata github sync config
---
# Official Onedata Github
cluster-worker:
src: ssh://[email protected]:7999/vfs/cluster-worker.git
dst: ssh://[email protected]/onedata/cluster-worker.git
did: /onedata_github
sid: /onedata_github
branches:
- master
- develop
@groundnuty
groundnuty / monkey.sh
Last active September 25, 2020 09:23
monkey patching a docker container
docker run -n monkey -it --entrypoint bash docker.onedata.org/oneprovider:ID-62ae5b73f6
docker cp storage_sync_engine.beam monkey:/usr/lib/op_worker/lib/op_worker-20.02.0-beta3/ebin
docker commit --change='ENTRYPOINT ["/root/oneprovider.sh"]' monkey docker.onedata.org/oneprovider:ID-62ae5b73f6_kk
#TODO
f() { fpath=$(k exec -it $1 -- find /usr -iname $2 | tr -d $'\r' ) ; echo -n $fpath ; k cp $2 $1:/ ; m1=$(k exec -it $1 -- md5sum /$2) ; m2=$(k exec -it $1 -- md5sum $fpath) ; echo $m1 ; echo $m2 ; k exec -it $1 -- mv /$2 $fpath ; k exec -it $1 -- md5sum $fpath }
@groundnuty
groundnuty / summary.sh
Created April 20, 2021 13:15
K8S Resources Summary
k get node -lkubernetes.io\/role=standard -o json | jq -r '[.items[] | .status.allocatable .cpu | .[0:-1] | tonumber | .] | add'
k get node -lkubernetes.io\/role=standard -o json | jq -r '[.items[] | .status.allocatable .memory | .[0:-1] | tonumber | .] | add'c
@groundnuty
groundnuty / config.yml
Last active August 27, 2021 04:27
ytt anchor bug
#@ def group_alpha():
name: alpha
#@ end
groups: &all_groups
- #@ group_alpha()
foo:
groups: *all_groups
@groundnuty
groundnuty / docker-patch
Created December 6, 2022 20:04 — forked from u8sand/docker-patch
A helper script for patching docker images
#!/bin/bash
# Dependencies:
# - docker (obviously)
# - jq (json parsing)
docker_patch_usage() {
echo 'Usage: docker-patch'
echo ' CONTAINER=$(docker-patch start your/tag)'
echo ' # apply patch to $CONTAINER (docker container)'
echo ' docker-patch commit ${CONTAINER} your/patched-tag'
@groundnuty
groundnuty / install_kubectx_kubens_linux.txt
Created March 29, 2023 13:37 — forked from iamcryptoki/install_kubectx_kubens_linux.txt
Install kubectx and kubens on Linux.
sudo git clone https://github.com/ahmetb/kubectx /opt/kubectx
sudo ln -s /opt/kubectx/kubectx /usr/local/bin/kubectx
sudo ln -s /opt/kubectx/kubens /usr/local/bin/kubens
echo "source /opt/kubectx/completion/kubectx.bash" >> ~/.bashrc
echo "source /opt/kubectx/completion/kubens.bash" >> ~/.bashrc