Skip to content

Instantly share code, notes, and snippets.

View 62mkv's full-sized avatar

Kirill M 62mkv

  • Breakwater Technology
  • Tallinn, Estonia
View GitHub Profile
62mkv / remove-merged-branches
Last active October 12, 2022 09:19
Oneliner to remove remote branches from "origin", that are already merged into "master" (runs in MINGW shell under Windows 10)
git branch -r --merged master | grep -v master | grep -v develop | grep -w "origin" | awk '{print gensub(/origin\//,"","g",$1)}' | xargs git push origin --delete
git remote prune origin
62mkv /
Last active October 26, 2016 06:09
Bash script to remove merged branches both locally and remotely (from "origin" only). Parses all REPOs within current folder, checkouts "master" on each of the REPOs
function remove_remote_branch() {
git push origin --delete $branch
function remove_local_branch() {
git branch -d $branch
62mkv / .profile
Created March 2, 2016 07:35
What do I add on $HOME/.profile in order to have decent mc via Putty
# add this to the end of .profile file in your home directory
export LC_LANG="en_US.UTF8"
62mkv / copy_as_textile.groovy
Last active February 9, 2017 09:21
Groovy script to copy FreePlane branch as Textile for easy creation of Redmine issues
import java.awt.datatransfer.*;
import java.awt.Toolkit;
* Export Freeplane mindmap branch to nested list in textile format e.g. for use in Redmine wiki
* - Save as <filename>.groovy in <freeplane directory>/scripts/
- Select node and start script from menu: Tools -> Scripts -> <filename>
* (c) 2014 Fabian Kretzer
* (c) 2016 62mkv
62mkv /
Created May 16, 2016 06:27
Bash script to convert all 2nd level wav files (without extension) to 16-bit wav files
FILELIST=$(find . -maxdepth 2| xargs file | grep WAVE | awk -F':' '{ print $1}' | awk -F'/' '{ print $2, $3}')
while read -r line; do
FOLDER=$(echo $line | awk '{print $1}')
FILE=$(echo $line | awk '{print $2}')
62mkv /
Created October 11, 2016 05:01
Python script to calculate SIP REGISTER Digest authentication (in order to check password validity)
from md5 import md5
# header from 401 response on REGISTER
# Authorization: Digest username="883140776410950", realm="gw_youmagic", algorithm=MD5, uri="sip:GW_Youmagic", nonce="1476157437:0a1418a40f8ee1c9a55f1587ab931c14", response="3ff479ccc24874f66aae45dac889d099"
login = '883140776410950'
uri = 'sip:GW_Youmagic'
nonce = '1476157437:0a1418a40f8ee1c9a55f1587ab931c14'
realm = 'gw_youmagic'
password = '----------'
62mkv / Jenkinsfile
Created October 12, 2016 12:18
Pipeline script for Android application with branch-specific config
def branch_config = [ master: [target: 'assembleStoreRelease'], qa: [target: 'assembleQaDebug']]
node {
def branch = env.gitlabSourceBranch
stage 'checkout'
checkout([$class: 'GitSCM', branches: [[name: "origin/$branch"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'cbd4ea7d-0718-48ae-a1dd-9dea23ac65bc', url: '']]])
stage 'build'
62mkv / extract-property-from-xml.ps1
Created October 26, 2016 06:04
Select only one property of every element of a given type in an XML-file (in PowerShell)
Select-XML -XPath "response/action/provider/@fullName" -Path providers.xml | Select-Object -ExpandProperty Node
62mkv / gist:26be598fe65251ebdc5fbc424f75031d
Created November 3, 2016 02:45
Show size of each subfolder
du -BM -s * | sort
62mkv /
Created November 19, 2016 13:22
check if web-server responds on request
curl -v http://u.rl/path/; echo $?
# -v prints headers; $? is an exit code of last called command