Skip to content

Instantly share code, notes, and snippets.

View redbearder's full-sized avatar
🎯
Focusing

redbearder

🎯
Focusing
  • BJ, China
View GitHub Profile
# variables - credentials info
USERNAME='my-username'
PASSWORD='my-clear-password'
USER_PASS="${USERNAME}:${PASSWORD}"
# variables - jenkins project and roles
TYPE='projectRoles'
## example of jenkins permission required to execute the Jenkins Job
PERMISSIONIDS='hudson.model.Item.Read,hudson.model.Item.Build'
ROLENAME='my-rolename'
@redbearder
redbearder / gen_jenkins_job_relation.py
Last active October 25, 2021 11:17
gen_jenkins_job_relation.py
import re
import os
from bs4 import BeautifulSoup
from graphviz import Digraph
def get_job_downstream_list(job_name, job_root) -> list:
downstream_list = []
if os.path.isfile(os.path.join(job_root, job_name, 'config.xml')):
with open(os.path.join(job_root, job_name, 'config.xml'), 'r') as f:
@redbearder
redbearder / delete-gitlab-expired-image.py
Last active October 12, 2021 11:05
delete-gitlab-expired-image.py
gitlab_token = ''
namespace = ''
dn = ''
expire_days = 7
del_regex_str = '.*-[ab][0-9]+-.*'
if __name__ == '__main__':
import json
import requests
import urllib.parse
@redbearder
redbearder / Jenkins-label-to-ansible-hosts.groovy
Last active April 7, 2022 07:30
Jenkins labelAndNode to ansible hosts conig
// def labelAndNodeList = []
// for (label in Jenkins.getInstance().getLabels()) {
// labelAndNodeList.add(label)
// println "[${label}]"
// }
import jenkins.model.*
def labelMap = [:]
@redbearder
redbearder / CMakeLists.txt
Created April 18, 2020 12:57
Redis 5 debug with Clion in MacOS
# import src as CMake project with Clion
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(redis VERSION 5.0)
set(CMAKE_BUILD_TYPE "Debug")
get_filename_component(REDIS_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
add_subdirectory(deps)
add_subdirectory(src/modules)
@redbearder
redbearder / CMakeLists.txt
Created April 18, 2020 12:51
Redis 5 debug with CLion in Ubuntu
# sudo apt install libevent-dev
# sudo apt install libkqueue-dev
# open CLion
# File->new CMake project from Sources->Redis src dir
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(redis VERSION 5.0)
set(CMAKE_BUILD_TYPE "Debug")
get_filename_component(REDIS_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
@redbearder
redbearder / sap_instance_copy.sh
Created April 4, 2020 14:32
copy to create new sap isntance from a existing one
#!/bin/bash
####---- attension ----####
# confirm sidadm uid number
# confirm sapsys uid number
# confirm other sap user and group id number
# change sidadm home dir files,
# i.e:.cshrc,.profile
@redbearder
redbearder / installcdo.sh
Created September 12, 2018 03:49 — forked from mainvoid007/installcdo.sh
install cdo with grib2, hdf5, netcdf4
#!/bin/bash
# Institut für Wetter- und Klimakommunikation GmbH / Qmet
# O. Maywald <maywald@klimagipfel.de>
# This should install CDO with grib2, netcdf and HDF5 support. Note that the binaries are in /opt/cdo-install/bin.
# For further information look:
# http://www.studytrails.com/blog/install-climate-data-operator-cdo-with-netcdf-grib2-and-hdf5-support/
# docker-command