Skip to content

Instantly share code, notes, and snippets.

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
```
@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
@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 / 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 / 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 / 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 / Git_tips_cheatsheet
Last active November 7, 2024 12:41
Git_tips
Working with your repository
I just want to clone this repository
If you want to simply clone this empty repository then run this command in your terminal.
git clone http://localhost:7990/scm/tes/mytestrepo.git
My code is ready to be pushed
If you already have code ready to be pushed to this repository then run this in your terminal.
@Sysa
Sysa / README.md
Created March 11, 2019 11:19 — forked from datagrok/README.md
What happens when you cancel a Jenkins job

When you cancel a Jenkins job

Unfinished draft; do not use until this notice is removed.

We were seeing some unexpected behavior in the processes that Jenkins launches when the Jenkins user clicks "cancel" on their job. Unexpected behaviors like:

  • apparently stale lockfiles and pidfiles
  • overlapping processes
  • jobs apparently ending without performing cleanup tasks
  • jobs continuing to run after being reported "aborted"
Multibranch projects relationships
to get the scrumb:
http://Jenkins_User:Jenkins_User_Secret_like_6f9dd2bf8e2a5e737d296@YourJenkinsHost:8080/crumbIssuer/api/xml?xpath=/*/crumb/text()
trigger Jenkins multibranch project from bitbucket:
Bitbucket side
@Sysa
Sysa / gist:6d4085e50c1bcadcba7252b8c147fac7
Created November 23, 2018 16:02
get and filter git branch in jenkins pipeline
stage("git remote"){
withCredentials([usernamePassword(credentialsId: 'git_worker', passwordVariable: 'PASS', usernameVariable: 'USERNAME')]) {
String filterBranch = "release/"
String sh_git_result = sh(script: "git ls-remote http://${USERNAME}:${PASS}@bitbucket.yourdomain.com/scm/rpl/client.git | grep ${filterBranch}", returnStdout: true).trim()
println sh_git_result
//regex to take only `release/01.02` from `refs/heads/release/01.02-fake-239` - (?<=heads\/).*(?<=\d{2}\.\d{2})
// to take only `release/*` -> (?<=heads\/).*
branch_result = (sh_git_result =~ /(?<=heads\/).*/)[0]