Skip to content

Instantly share code, notes, and snippets.

Bogdan metallica127

Block or report user

Report or block metallica127

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
metallica127 / jenkins_scritpted_cron_trigger.groovy
Created Sep 24, 2019
Jenkins scripted pipeline: cron trigger
View jenkins_scritpted_cron_trigger.groovy
node {
properties ([pipelineTriggers([cron('0 0 * * *')])])
stage('Clone repositories') {
sh 'echo test'


We need a global docker network in order to communicate between docker-compose setups on different hosts

Step 1: Install and run Consul (as a key-value storage for docker)

Step 2: Edit docker configuration (on each docker host)

metallica127 / parse_json_yaml_to_map.go
Created Sep 14, 2019
GoLang: Parse json yaml to map[string]interface{}
View parse_json_yaml_to_map.go
func main() {
jsonStr := `{"isSchemaConforming":true,"schemaVersion":0,"unknown.0":[{"email_address":""},{"email_address":""}]}`
dynamic := make(map[string]interface{})
json.Unmarshal([]byte(jsonStr), &dynamic)
#!/usr/bin/env bash
function create_session(){
local session_id=$(curl -s -XPUT "${CONSUL_ADDR}/v1/session/create" \
-d "{\"Name\": \"backup\"}" | jq -r '.ID' )
echo ${session_id}
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
metallica127 /
Created Jul 13, 2019
Makefile check if variable is defined

Check if variable is defined in a Makefile

Using ifndef

ifndef MY_FLAG
$(error MY_FLAG is not set)
metallica127 /
Created Jan 24, 2019
Vault error x509: certificate signed by unknown authority
$ vault status
Error checking seal status: Get x509: certificate signed by unknown authority



The kubelet in Openshift is run using hyperkube.
It is evaluated as a systemd service called origin-node.

  • To view the logs you can use:
$ journalctl -u origin-node
  • To check the status simply run:
metallica127 /
Created Jan 18, 2019
Inspect struct object golang

To inspect the strcut you can use the %+v interpolation:

fmt.Println(fmt.Sprintf("%+v", myStruct))
metallica127 /
Last active Jan 13, 2019
Intall Consul on Linux [Ubuntu, Debian, CentOS]

Install consul on Linux

This snippet will help you to easily install consul on linux! Simply run the following:

curl -s -L | sudo bash -s

The will be downloaded and evaluated.

You can’t perform that action at this time.