Skip to content

Instantly share code, notes, and snippets.

View goern's full-sized avatar
🥥
working on getting AI done...

Christoph Görn goern

🥥
working on getting AI done...
View GitHub Profile
Verifying that "cgoern.id" is my Blockstack ID. https://onename.com/cgoern
@goern
goern / openshift.md
Last active September 7, 2016 07:11 — forked from luebken/openshift.md
Getting started with OpenShift

Install

$ brew update
$ brew install --devel openshift-cli

# add 172.30.0.0/16 to the insecure registries
$ docker-machine ssh 
$ vi /var/lib/boot2docker/profile
# add --insecure-registry 172.30.0.0/16
$ docker-machine restart
oc login -u system:admin
cat <<-EOF > /tmp/pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0001
spec:
capacity:
storage: 1Gi
# DISCLAIMER docker-machine on OSX is not my friend
VBoxManage unregistervm openshift --delete
rm -rf $HOME/.docker/machine/
docker-machine create --driver virtualbox --engine-opt="--insecure-registry 172.30.0.0/16" openshift
eval $(docker-machine env openshift)
oc cluster up
@goern
goern / datanode.yaml
Created May 4, 2017 12:44
HADOOP on OpenShift
# A headless service to create DNS records.
apiVersion: v1
kind: Service
metadata:
name: hdfs-datanode
labels:
app: hdfs-datanode
spec:
ports:
- port: 50010
@goern
goern / gist:e6aae19a2d8145fa1f184e74f9fe48c9
Created July 6, 2017 06:56
Hawkular: visualize two deployments
1. Hawkular provides CPU, Mem, Net metrics for each Pod
1.1. we can map Pods to deployments, so we can aggregate a deployments resource consumption
2. Tag a point in time when a new deployment started, it ends when a rolling updates is finished.
3. show resource consumption of first deployment, overlayed with resource consumption of second deployment
4. show forcase of resource consumption of first deployment within the overlay diagram
echo "Starting..."
git clone https://git.example.com/source
make clean
curl -gO https://git.example.com/source/patch-1.diff
patch -p0 < patch-1.diff
rm bogus.c
make all
echo "done!"
@goern
goern / gist:c511b2fa029574286d77ce09a80a55e8
Created September 12, 2017 18:09
$PATH - `pipenv run` vs `pipenv shell`
[goern@tBook p (develop)]$ pipenv run python
Python 3.6.2 (default, Jul 17 2017, 16:44:47)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ["PATH"]
'/Users/goern/.rvm/gems/ruby-2.3.0/bin:/Users/goern/.rvm/gems/ruby-2.3.0@global/bin:/Users/goern/.rvm/rubies/ruby-2.3.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/usr/local/MacGPG2/bin:/usr/local/opt/go/libexec/bin:/Users/goern/.rvm/bin'
>>>
[goern@tBook piler-dev (develop)]$ pipenv shell
Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.
@goern
goern / ec2_group_project.yml
Last active April 10, 2018 15:25 — forked from carlessanagustin/ec2_group_project.yml
ANSIBLE: Change AWS EC2 Security Group configuration.
#!/usr/local/bin/ansible-playbook -v
---
- hosts: apache0
vars:
rule_list:
- { proto: icmp, type: 3, code: 4, src_cidr_ip: 0.0.0.0/0 }
ec2_group_region: 'us-east-2'
ec2_group_vpc: 'vpc-295720575'
ec2_group_description: 'change for AI Ops Recommendation by Red Hat Insights'
@goern
goern / gist:170469685532bf39ac7f10db9030fee2
Created June 27, 2018 08:25
regexp for a semver compliant pre-release
# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9alpha|beta|rc.-]+))?(?:\+([0-9a-zA-Z.-]+))?"
test_str = ("0.0.1\n"
"0.1.0-rc.3\n"
"0.1.0-alpha.12\n"