Skip to content

Instantly share code, notes, and snippets.

@pando85
pando85 / merge_dict.py
Last active February 11, 2020 08:59
Python deep merge dict
import pytest
def merge_dict(a, b):
for key in b:
if key in a:
if isinstance(a[key], dict) and isinstance(b[key], dict):
merge_dict(a[key], b[key])
elif a[key] == b[key]:
pass
@pando85
pando85 / release_management.md
Created October 1, 2019 21:27
how to manage releases
@pando85
pando85 / user_data_jenkins_slave.sh
Created May 30, 2019 08:57
User Data for jenkins slave in Openstack
#!/bin/bash
curl ${SLAVE_JAR_URL} -o /var/lib/jenkins/agent.jar
#/etc/systemd/system/sebasshtian.service
cat << EOF > /etc/systemd/system/jenkins-slave.service
[Unit]
Description=Jenkins-slave
After=network.target
@pando85
pando85 / docker_arm.md
Last active January 16, 2020 19:05
Docker arm images

Docker in ARM

Buildx

docker buildx build --platform linux/amd64,linux/arm64 \
    -t registry.k8s.grigri/pypiserver:v1.3.2 -f Dockerfile  --output type=registry .
@pando85
pando85 / notify
Created December 22, 2018 09:35
notify to telegram with simple curl
#!/bin/sh
TOKEN=
CHAT_ID=
curl -s -X POST https://api.telegram.org/bot${TOKEN}/sendMessage -d chat_id=$CHAT_ID -d text="$1"
@pando85
pando85 / mariadb.md
Last active May 17, 2018 07:57
mariadb

MariaDB Galera

MariaDB in multi-master configuration. Allow scalability.

It works, inclusive, over the WAN network.

Requirements

  • Minimum 3 masters
@pando85
pando85 / fzf.md
Last active January 2, 2022 12:13
fzf.md

fzf

install

config

# Setup fzf
# ---------
@pando85
pando85 / compose.py
Created August 17, 2017 09:23
compose functions in python like haskell
class Composable(object):
''' A function decorator that allows you to use Haskell style dot notation for function composition '''
fns = {}
def __init__(self, fn):
self.fn = fn
Composable.fns[fn.__name__] = fn
def __call__(self, *args, **kwargs):
''' simply calls the function '''