Skip to content

Instantly share code, notes, and snippets.

Petr Michalec epcim

Block or report user

Report or block epcim

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
#!/bin/env python3
import gitlab
import sys
# private token or personal token authentication
gl = gitlab.Gitlab('', private_token='******')
if len(sys.argv) > 1:
if sys.argv[1].find("/") > 0:
epcim /
Last active May 24, 2019
hab habitat hab-sup deployment

Simple deployment script to install habitat container with the app as systemd service.

export ALT=500 # Prefix for all the service names/ports used (apply to habitat/ inner service service)
# cleanup
systemctl stop etcd-$ALT
sleep 3
rm -f /etc/systemd/system/etcd-$ALT.service /etc/default/etcd-$ALT*
rm -rf /srv/etcd-$ALT
epcim /
Created Mar 3, 2016
Search docker hub on CLI
for Repo in $* ; do
tags=$(curl -s -S "$Repo/tags/")
python - <<EOF
import json
tags = [t['name'] for t in json.loads('''$tags''')['results']]
epcim /
Last active May 20, 2019
salt states trends jq yq
epcim /
Created May 13, 2019
debian livecd netboot
# Create a Custom Debian Live Environment (CD or USB)

db2 query cfg

get dbm cfg show detail

db2 get snapshot for db on DAD
db2 get snapshot for bufferpools on DAD
db2 get snapshot for locks on DAD
db2 list active databases
View update from line
# rewrite part of the file from variable
sed -i "/^write_files:/{
epcim /
Last active Apr 29, 2019
kubectl kubernetes alias bash cli
# you can't live without 'k' and 'p'
# kubectl alias
alias k='kubectl'
# kubectl get pods alias
## store Kubernetes pod name & namespace to env variable
## expect servername has number behind last -
[[ -z $ZSH_NAME ]] || setopt SH_WORD_SPLIT
function get-pods() {
You can’t perform that action at this time.