Skip to content

Instantly share code, notes, and snippets.

@Sysa
Sysa / kubectl_cheatsheet.txt
Last active September 10, 2024 13:33
kubectl_cheatsheet
Set default namespace:
kubectl config set-context --current --namespace=service-ds-recs-model-inference-search-83int
Set the cluster:
kubectl config set-cluster NAME
Check Helm history of releases:
helm history -n NAMESPACE RELEASE_NAME
Switch context:
@Sysa
Sysa / conda_cheatsheet
Last active December 19, 2023 10:40
conda tricks
https://github.com/conda/conda/issues/8687
grep -rl "1\.0<2" /anaconda/envs/recs_servables/lib/python3.7/site-packages | xargs sed -i 's/1.0<2/1.0, <2/g'
### Updating current dependencies
To update python dependencies, run env update and export a list of new dependencies:
```bash
conda env update --prune --file conda.yml
conda env export -n pers_opt_search -f conda.lock.yml -vvv --no-builds
```
@Sysa
Sysa / linux_cheatsheet.txt
Last active May 3, 2024 10:52
linux/unix cheatsheet
disk usage (https://superuser.com/a/1573074/619805):
sudo du -hsx /* | sort -rh | head -n 40
du -schx .[!.]* * | sort -h
get proc envs:
sudo cat /proc/803/environ | xargs -0 env -i
get public IP from CLI:
dig +short myip.opendns.com @resolver1.opendns.com
@Sysa
Sysa / python_helpers
Last active August 14, 2024 08:57
python helpers
python linter ruff:
# to add 'noqa' to the failing lines and not to check in the future. useful for pytest or pb_utils
ruff check .
ruff check . --add-noqa
get list of sub-dependencies:
pip3 freeze | awk '{print $1}' | cut -d '=' -f1 | xargs pip3 show > conda.out
@Sysa
Sysa / tf_cheatlist
Last active January 24, 2024 12:12
terraform cli commands and more
terraform cheatlist
terraform fmt - formatter
terraform init - initialize tf backend (local one)
terraform plan -
terraform apply -
terraform apply -refresh-only
terraform state list
expanded folder tree + mode indent
settings.json (ctrl+shift+p) Open Settings (JSON):
```
"workbench.tree.indent": 32,
"workbench.tree.renderIndentGuides": "always",
"workbench.colorCustomizations": {
"tree.indentGuidesStroke": "#008070"
},
"explorer.compactFolders": false
```