Skip to content

Instantly share code, notes, and snippets.

View jb68's full-sized avatar

Julian Buliga jb68

View GitHub Profile
@jb68
jb68 / jen_del_blds.groovy
Created August 23, 2019 20:29
Delete old builds in jenkins and last 5. This script needs to be exec in jenkins script console
def jobName = "aa"
def noOfJobsToKeep=5
def job = Jenkins.instance.getItem(jobName)
job.getBuilds().findAll { it.number < job.getBuilds().number.max() - noOfJobsToKeep }.each { it.delete() }
@jb68
jb68 / rpm-digital-signature.sh
Created September 6, 2018 23:58 — forked from fernandoaleman/rpm-digital-signature.sh
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
@jb68
jb68 / ThinkLight
Created November 6, 2017 23:26 — forked from vzaliva/ThinkLight
This script controll keyboard backlight on IBM ThinkPad X-series
#!/bin/bash
# Vadim Zaliva lord@crocodile.org
# based on https://gist.github.com/hadess/6847281
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@jb68
jb68 / user.py.diff
Last active August 4, 2020 08:52
freeipa user-add/remove/mod trigger a custom script
diff --git a/user.py b/user.py
index cb47cbb..6b9ff36 100644
--- a/user.py
+++ b/user.py
@@ -40,7 +40,7 @@ from ipalib import _, ngettext
from ipalib import output
from ipalib import x509
from ipaplatform.paths import paths
-from ipapython.ipautil import ipa_generate_password
+from ipapython.ipautil import ipa_generate_password, run
@jb68
jb68 / parse_yaml.sh
Created April 4, 2017 16:47 — forked from pkuczynski/parse_yaml.sh
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}