Skip to content

Instantly share code, notes, and snippets.

View ovitente's full-sized avatar

Ivan Kostrubin ovitente

  • 20:13 (UTC +03:00)
View GitHub Profile
@ovitente
ovitente / gist:a3c0be54879b5aec00b856bf3f3300e2
Last active April 9, 2021 12:45
testing dispatch triggers
gh pr create --title "testing dispatch triggers" --body "Testing dispatch triggers" --base main --head $(git rev-parse --abbrev-ref HEAD)
gcloud projects get-iam-policy gcp-project --flatten="bindings[].members" --format="table(bindings.role)" --filter="[email protected]"
@ovitente
ovitente / az-pipeline-run
Last active October 11, 2021 14:19
az pipeline run
az devops login --organization=https://dev.azure.com/YOUR_ORG/
az devops project list
az pipelines list --detect --org=https://dev.azure.com/YOUR_ORG/ --project=YOUR_AZURE_DEVOPS_PROJECT
az pipelines run --branch $(git rev-parse --abbrev-ref HEAD) --detect --org=https://dev.azure.com/YOUR_ORG/ --project=YOUR_AZURE_DEVOPS_PROJECT --name=YOUR_PIPELINE_NAME
# It will execute pipeline from your current active branch in the terminal
@ovitente
ovitente / gist:cace3759dc242f165c42d4704a311202
Created January 27, 2021 15:23
Using bash variables inside json body
"'$variable'"
@ovitente
ovitente / gist:47d4835660e91d577bb5b0bf9a2901dc
Last active January 8, 2021 14:36
create branch from task title
cbr() {
task_id=$1
feature=$2
title="$(tr '[:upper:]' '[:lower:]' <<< $3)"
git checkout -b "$task_id-$feature-${title// /_}"
}
heroku dyno:scale -a logo-changer worker=0
heroku dyno:scale -a logo-changer worker=1
@ovitente
ovitente / azure cloud resources cleanup
Created December 24, 2020 11:09
azure cloud resources cleanup
param($Timer)
$toll = Get-AzResourceGRoup | Where-Object ResourceGroupName -like 'sandbox*'
Write-Host "$toll.ResourceGroupName"
foreach ($item in $toll) {
Write-Host "Bye ($item.ResourceGroupName)"
Remove-AzResourceGroup -Name $item.ResourceGroupName -Force
}
kubectl get secret <secret_name> -o jsonpath='{.data}'
kubectl --namespace=<NAMESPACE> exec -it POD-app-deployment-5d4c4d9c85-vkqlt -- sh
git checkout <your-branch>
git reset --soft HEAD~<n> # this is the number of commits you want to squash down
git commit -m "<message>"
git push -f origin <your-branch>