Skip to content

Instantly share code, notes, and snippets.

View paladin-dranser's full-sized avatar

Antoś Bućko paladin-dranser

View GitHub Profile
@paladin-dranser
paladin-dranser / get_currency_rate.py
Created December 5, 2021 05:41
Get official NBRB currency rata based on ISO 4217 currency code (1 <currency_code> = <N> BYN)
#!/usr/bin/python3
"""
Get official NBRB currency rata based on ISO 4217 currency code (1 <currency_code> = <N> BYN)
API Documentation: https://www.nbrb.by/bel/apihelp/exrates
"""
import argparse
@paladin-dranser
paladin-dranser / authorizeProjectConfiguration.groovy
Last active January 14, 2021 16:45
Jenkins: Groovy script to configure Authorize Project settings
/**
* The script removes Build Authorization settings
* (Jenkins - Configure Global Security - Access Control for Builds)
* and creates:
* - Per-project 'Run as Specific User'
* - Default Project 'Run as User Who Triggered Build'
*
* Issue:
* Authorize Project plugin doesn't full support JCasC plugin configuration
* For more details, see: https://github.com/jenkinsci/authorize-project-plugin/pull/44
@paladin-dranser
paladin-dranser / deleteEmptyViews.groovy
Last active September 24, 2020 17:07
Jenkins: Groovy script to delete empty views
/**
* This script deletes empty views
*/
import jenkins.model.Jenkins
import hudson.model.View
Jenkins instance = Jenkins.get()
ArrayList<View> views = instance.getViews()
@paladin-dranser
paladin-dranser / cleanupJenkinsWorkspaces.groovy
Last active September 24, 2020 17:17 — forked from EvilBeaver/cleanupJenkinsWorkspaces.groovy
Jenkins: Groovy script to clean up workspace on Jenkins agents
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
void performCleanup(node, items) {
for (item in items) {