Skip to content

Instantly share code, notes, and snippets.

View ovitente's full-sized avatar

Ivan Kostrubin ovitente

  • 00:20 (UTC +03:00)
View GitHub Profile
@ovitente
ovitente / github actions debug
Created January 21, 2020 13:14
A way to debug Github Actions workflows
---
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners
name : debug
on :
push :
branches : [ "master" ]
@ovitente
ovitente / gist:19a1a8769ca84b37f50e792103dbe79e
Created November 10, 2020 13:31
push new version of tf vars into gsm secret in one string
cp dev.tf variables.tf && gcloud secrets --project=MYGCP_PROGECT versions add terraform_variables_file --data-file=variables.tf
#!/usr/bin/ruby
#
# This tool is only used to "decrypt" the github enterprise source code.
#
# Run in the /data directory of the instance.
require "zlib"
require "byebug"
KEY = "This obfuscation is intended to discourage GitHub Enterprise customers "+
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>
kubectl --namespace=<NAMESPACE> exec -it POD-app-deployment-5d4c4d9c85-vkqlt -- sh
kubectl get secret <secret_name> -o jsonpath='{.data}'
@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
}
heroku dyno:scale -a logo-changer worker=0
heroku dyno:scale -a logo-changer worker=1
@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// /_}"
}
@ovitente
ovitente / gist:cace3759dc242f165c42d4704a311202
Created January 27, 2021 15:23
Using bash variables inside json body
"'$variable'"