Skip to content

Instantly share code, notes, and snippets.

View kumbasar's full-sized avatar
💭
I may be slow to respond.

Volkan K. kumbasar

💭
I may be slow to respond.
View GitHub Profile
@kumbasar
kumbasar / getCoverageAndLines.groovy
Created October 22, 2018 08:44
A groovy code to get code coverage and line size
import groovy.json.JsonSlurper
def sonarqube_host = "http://SONARQUBE_URL:9000"
def projectname = "MY_PROJECT"
def SONARCUBE_URL = "${sonarqube_host}/api/measures/component?componentKey=${projectname}&metricKeys=coverage,ncloc"
def son_ncloc = 'N/A'
def son_coverage = 'N/A'
def authString = "amin:admin".getBytes().encodeBase64().toString()
@kumbasar
kumbasar / deleteGitTags.sh
Created November 6, 2018 08:09
delete remote and local git tags based on regex
#!/bin/bash
pattern="${1}"
git fetch
#Delete remote tags
git tag | grep "${pattern}" | xargs -n 1 -i% git push origin :refs/tags/%
#Delete local tags
@kumbasar
kumbasar / getLatestReleaseBuild.py
Created November 14, 2018 09:18
Download the latest sub folder content from Artifactory using Python and wget
#!/usr/bin/env python3
# pip3 install artifactory
import os
from artifactory import ArtifactoryPath
from pathlib import Path
ARTIFACTORY_URL = "https://localhost:8081/artifactory"
ARTIFACTORY_USER = 'admin'
@kumbasar
kumbasar / gist:1b1a1e61171b9e18aeee0ef9281bfa34
Created November 15, 2018 05:52
How to Prune Local Tracking Git Branches that Do Not Exist on Remote/Origin Anymore
git fetch --prune
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
@kumbasar
kumbasar / Jenkinsfile
Created December 4, 2018 12:15
Set SonarQube Quality Gate Status to Jenkins Build Result
def scannerHome = tool 'SonarQube Scanner 3';
withSonarQubeEnv(config.sonarqube_id) {
sh "${scannerHome}/bin/sonar-scanner"
}
def props = readProperties file: '.scannerwork/report-task.txt'
echo "properties=${props}"
def sonarServerUrl=props['serverUrl']
def ceTaskUrl= props['ceTaskUrl']
def projectKey = props['projectKey']
@kumbasar
kumbasar / Jenkinsfile
Created December 24, 2018 06:32
virtualenv in Jenkinsfile
sh """
#!/bin/bash
PATH=${WORKSPACE}/venv/bin:/usr/local/bin:\$PATH
rm -rf venv
virtualenv -p python3 venv
. venv/bin/activate
pip3 install pylint
venv/bin/pylint test/tests/ -r n --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" > pylint-report.txt || exit 0
"""
@kumbasar
kumbasar / osx_wifi_strenght_command_line.sh
Last active January 2, 2019 17:01 — forked from miglen/osx_wifi_strenght_command_line.sh
Mac OS X Wifi Signal strength meter command line
#!/bin/bash
# Simple command to display the wireless strenght signal
#
clear
while true
do /System/Library/PrivateFrameworks/Apple*.framework/Versions/Current/Resources/airport -I \
| grep CtlRSSI \
| sed -e 's/^.*://g' \
| xargs -I SIGNAL printf "\nWiFi dBm: SIGNAL"
sleep 1
@kumbasar
kumbasar / dateformat.groovy
Created January 3, 2019 07:37
SimpleDateFormat in groovy
import java.text.SimpleDateFormat
def date = new Date()
sdf = new SimpleDateFormat("MMddyyyy-hhmmss")
println sdf.format(date)
@kumbasar
kumbasar / jenkins.py
Created January 7, 2019 08:07
A python script to get the junit data
#!/usr/bin/env python3
import requests
import urllib3
import json
from requests.auth import HTTPBasicAuth
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
@kumbasar
kumbasar / http-proxy.conf
Created January 15, 2019 06:02
docker.service.d proxy
cat /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:9400" "HTTPS_PROXY=http://127.0.0.1:9400" "NO_PROXY=localhost,127.0.0.1"