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
epcim /
Last active Sep 30, 2019
trusted certificates system update-ca-certificates

Adding trusted root certificates to the server

Mac OS X

sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/new-root-certificate.crt
sudo security delete-certificate -c "<name of existing certificate>"


certutil -addstore -f "ROOT" new-root-certificate.crt
epcim / hab clustered etcd
Created Sep 16, 2019
etcd habitat docker-compose hab
View hab clustered etcd
# See more:
# hab clustered etcd
## compose
cat <<EOF > docker-compose.yml
version: '3'
epcim /
Last active Sep 16, 2019
hab habitat hab-sup deployment etcd

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 31, 2017
keybase github git gpg pgp
epcim /
Created Aug 26, 2019 — forked from rgl/
Wait for an HTTP endpoint to return 200 OK with Bash and curl
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done'
# also check
epcim /
Last active Jun 18, 2019
split needle csplit
# example usage: to split yaml with multiple documents
needle() {
csplit -b "%03d.$SUFFIX" -zsf $(basename $1 .$SUFFIX) $1 /$NEEDLE/+1 {*}
needle vega-objects.yaml
#!/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 /
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
You can’t perform that action at this time.