Skip to content

Instantly share code, notes, and snippets.

@William-Yeh
William-Yeh / Build.scala
Last active August 29, 2015 14:08
modified spray-can example from https://github.com/spray/spray
import sbt._
import Keys._
import com.typesafe.sbt.osgi.SbtOsgi._
import sbtunidoc.Plugin._
import UnidocKeys._
import sbtassembly.Plugin._
import AssemblyKeys._
object Build extends Build {
@William-Yeh
William-Yeh / DOCKER.pl
Last active August 29, 2015 14:13
Simple Docker CLI wrapper to "pull" public registry images from private registry.
#!/usr/bin/env perl
#
# Simple Docker CLI wrapper:
# - let "docker pull" to pull public registry images
# from private registry.
# - let other "docker" commands to act as before.
#
# Will use environment variable PRIVATE_DOCKER_REGISTRY
# to pull images.
#
@William-Yeh
William-Yeh / Vagrantfile
Last active August 29, 2015 14:16
Node.js mcrypt example in CentOS 6.6
Vagrant.configure(2) do |config|
config.vm.box = "chef/centos-6.6"
config.vm.provision "shell", inline: <<-SHELL
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y install libmcrypt-devel nodejs npm
npm install mcrypt
# vagrant ssh ; cd /vagrant
# node example.js
SHELL
@William-Yeh
William-Yeh / Dockerfile
Created May 19, 2015 08:06
nodejs + docker example for Alice Chuang
FROM node:0.10.36-slim
WORKDIR /opt
COPY . /opt
EXPOSE 8080
CMD [ "node", "hello.js" ]
@William-Yeh
William-Yeh / vagrant.py
Created October 24, 2015 13:17 — forked from majidaldo/vagrant.py
returns vagrant hosts for ansible inventory
#!/usr/bin/env python
# Adapted from Mark Mandel's implementation
# https://github.com/ansible/ansible/blob/devel/plugins/inventory/vagrant.py
import argparse
import json
import paramiko
import subprocess
import sys
@William-Yeh
William-Yeh / Dockerfile
Created April 12, 2016 04:22
Docker run from external volume
FROM alpine
VOLUME ["/livecode"]
CMD ["/livecode/hello.sh"]
@William-Yeh
William-Yeh / k8s in 5 minutes
Last active February 18, 2019 10:12
k8s in 5 minutes
1. Install Docker CE and enable Kubernetes:
See Figure 1 and 2 in https://medium.com/slalom-technology/get-kubernetes-running-locally-on-osx-and-windows-b3b5f176b5bb
2. (Optionally) Install k8s dashboard:
```
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
$ kubectl proxy
```
@William-Yeh
William-Yeh / ambassador-rbac.yaml
Last active March 29, 2019 10:41
Simple Ambassador demo
---
#
# Ambassador version: 0.52.0
#
# Adapted from: https://getambassador.io/yaml/ambassador/ambassador-rbac.yaml
# See: https://www.getambassador.io/user-guide/getting-started/
#
apiVersion: v1
kind: Service
@William-Yeh
William-Yeh / Dockerfile
Created June 21, 2019 04:46
Modify the "TodoFrontend/Dockerfile" file in Lab 5.0 ~ 7.0
#
# http static server one-liners
#
FROM busybox:1.30
WORKDIR /app
COPY . .
RUN chmod +x run.sh
@William-Yeh
William-Yeh / k8s-dev-env.md
Created August 13, 2019 09:30
【打造順暢的 K8s Dev 環境】行前須知

【打造順暢的 K8s Dev 環境】行前須知

(將於 10 月 1 日完成)

行前準備

為了活動進行順利,請在出席活動前,確實備妥下列事項。

...