Skip to content

Instantly share code, notes, and snippets.

View minyk's full-sized avatar
😀
Containerize! all the things!

Drake Youngkun Min minyk

😀
Containerize! all the things!
View GitHub Profile
@minyk
minyk / Vagrantfile
Created October 17, 2016 02:29
Vagrant within another machinefolder
machine.vm.provider 'virtualbox' do |v, override|
v.name = machine.vm.hostname
v.cpus = machine_type['cpus'] || 2
v.memory = machine_type['memory'] || 2048
v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
v.customize ['setproperty', 'machinefolder','/data/vagrant/vmz']
override.vm.network :private_network, ip: machine_type['ip']
end
@minyk
minyk / si7021.py
Created November 8, 2016 04:49
Si7021 Sensor Module for Micropython-ESP8266
from time import sleep_ms
from machine import Pin, I2C
# Default Address
SI7021_I2C_DEFAULT_ADDR = 0x40
# Commands
CMD_MEASURE_RELATIVE_HUMIDITY_HOLD_MASTER_MODE = 0xE5
CMD_MEASURE_RELATIVE_HUMIDITY = 0xF5
CMD_MEASURE_TEMPERATURE_HOLD_MASTER_MODE = 0xE3
@minyk
minyk / Dockerfile
Created December 14, 2016 02:28
Dockerfile for Apache Zeppelin + Numpy + Scipy
FROM dit4c/dit4c-container-zeppelin:latest
RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk add --update python-dev gfortran build-base py-numpy@community py-scipy@testing
@minyk
minyk / find-etcd.sh
Last active April 3, 2017 23:41
Find ETCD host on DC/OS using shell and jq
#!/bin/bash
ETCD_SERVICE_NAME=$1
SRV_RECORDS=`curl -s http://leader.mesos:8123/v1/services/_etcd-server._client.${ETCD_SERVICE_NAME}.mesos`
ETCD_INSTANCES=`echo $SRV_RECORDS | jq '.|length'`
SELECTED_INSTANCE=$(($RANDOM % ${ETCD_INSTANCES} ))
echo ${SRV_RECORDS} | jq --argjson index ${SELECTED_INSTANCE} '[.[$index].host[:40], ":", .[$index].port]|add'
Apr 06 15:23:24 master.dcos.ajway.kr systemd[1]: Starting Navstar: A distributed systems & network overlay orchestration engine...
Apr 06 15:23:24 master.dcos.ajway.kr check-time[31520]: Checking whether time is synchronized using the kernel adjtimex API.
Apr 06 15:23:24 master.dcos.ajway.kr check-time[31520]: Time can be synchronized via most popular mechanisms (ntpd, chrony, systemd-timesyncd, etc.)
Apr 06 15:23:24 master.dcos.ajway.kr check-time[31520]: Time is in sync!
Apr 06 15:23:24 master.dcos.ajway.kr ping[31524]: PING ready.spartan (127.0.0.1) 56(84) bytes of data.
Apr 06 15:23:24 master.dcos.ajway.kr ping[31524]: 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.015 ms
Apr 06 15:23:24 master.dcos.ajway.kr ping[31524]: --- ready.spartan ping statistics ---
Apr 06 15:23:24 master.dcos.ajway.kr ping[31524]: 1 packets transmitted, 1 received, 0% packet loss, time 0ms
Apr 06 15:23:24 master.dcos.ajway.kr ping[31524]: rtt min/avg/max/mdev = 0.015/0.015/0.015/0.000 ms
Apr 06 15:23:24 master.dco
@minyk
minyk / config-1.8.8.yaml
Created April 13, 2017 00:46
DC/OS 1.8.8 -> 1.9.0 configs
---
agent_list:
- 192.168.10.229
- 192.168.10.230
- 192.168.10.231
public_agent_list:
- 192.168.10.228
bootstrap_url: http://192.168.10.226:8080
cluster_name: 'dcos.ajway.kr'
exhibitor_storage_backend: static
@minyk
minyk / etcd-viewer.json
Created April 13, 2017 00:51
DC/OS 1.8.8 app json file.
{
"id": "/etcd-viewer",
"env": {
"TZ": "Asia/Seoul",
"ETCD_CLIENT_URL": "http://etcd-server-oyi7a-s2.etcd-erp-prod.mesos:1026/"
},
"cpus": 1,
"mem": 2048,
"container": {
"docker": {
@minyk
minyk / plugin-agent.log
Last active April 13, 2017 14:13
DC/OS metrics prometheus plugins
time="2017-04-13T17:23:06+09:00" level=info msg="Getting metrics from metrics service" plugin=default
time="2017-04-13T17:23:06+09:00" level=info msg="Setting plugin endpoints for role agent" plugin=default
time="2017-04-13T17:23:06+09:00" level=info msg="Discovered new container endpoint /system/v1/metrics/v0/containers/cb1dcfd0-a808-4342-87da-2d077f1db35b" plugin=default
time="2017-04-13T17:23:06+09:00" level=info msg="Discovered new container endpoint /system/v1/metrics/v0/containers/10b2e953-a929-4399-9ee6-bbdfef66876f" plugin=default
time="2017-04-13T17:23:06+09:00" level=info msg="Discovered new container endpoint /system/v1/metrics/v0/containers/e83c928c-e72a-4b94-9fd6-0cd5cbf299b8" plugin=default
time="2017-04-13T17:23:06+09:00" level=info msg="Discovered new container endpoint /system/v1/metrics/v0/containers/9655954a-dcd6-471c-9a7d-cfbb19bd1344" plugin=default
time="2017-04-13T17:23:06+09:00" level=info msg="Discovered new container endpoint /system/v1/metrics/v0/containers/a607ab0b-44cd-406b-a64b-f
@minyk
minyk / a1.log
Last active April 18, 2017 05:45
dcos-navstar.log
Apr 18 01:38:22 a1.dcos systemd[1]: Started Navstar: A distributed systems & network overlay orchestration engine.
Apr 18 01:38:22 a1.dcos navstar-env[6270]: Exec: /opt/mesosphere/packages/navstar--1128db0234105a64fb4be52f4453cd6aa895ff30/navstar/erts-8.2.2/bin/erlexec -noshell -noinput +Bd -boot /opt/mesosphere/packa
Apr 18 01:38:22 a1.dcos navstar-env[6270]: Root: /opt/mesosphere/packages/navstar--1128db0234105a64fb4be52f4453cd6aa895ff30/navstar
Apr 18 01:38:22 a1.dcos navstar-env[6270]: /opt/mesosphere/packages/navstar--1128db0234105a64fb4be52f4453cd6aa895ff30/navstar
Apr 18 01:38:22 a1.dcos navstar-env[6270]: Setup running ...
Apr 18 01:38:22 a1.dcos navstar-env[6270]: Directories verified. Res = {[ok],[]}
Apr 18 01:38:22 a1.dcos navstar-env[6270]: Setup finished processing hooks ...
Apr 18 01:38:28 a1.dcos navstar-env[6270]: [warning] <0.780.0> lager_error_logger_h dropped 99 messages in the last second that exceeded the limit of 50 messages/sec
Apr 18 01:38:31 a1.dcos navstar-env[6270]: [warning] <0.931
@minyk
minyk / Dockerfile
Created July 6, 2017 05:16
DC/OS Overlay Network Iperf3 Test
FROM alpine:3.6
RUN set -ex && \
apk upgrade --update && \
apk add --no-cache --update libstdc++ curl ca-certificates bash iperf3
ADD entrypoint.sh /entrypoint.sh
ENV IPERF_MODE server
ENV IPERF_PORT 5201