Skip to content

Instantly share code, notes, and snippets.

🎯
Kubernetes & FaaS

Ta-Ching Chen life1347

🎯
Kubernetes & FaaS
View GitHub Profile
View libdnet_python.rb
require 'formula'
class LibdnetPython <Formula
depends_on 'libdnet'
url 'http://libdnet.googlecode.com/files/libdnet-1.12.tgz'
homepage 'http://code.google.com/p/libdnet/'
sha1 '71302be302e84fc19b559e811951b5d600d976f8'
def install
ENV["CFLAGS"] = "-O3 -w -pipe"
View vfw.sh
#!/bin/bash
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT
View vgw.sh
#!/bin/bash
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
View default.conf
server {
listen 80;
location / {
proxy_pass http://frontend;
access_log /var/log/nginx/access.log;
proxy_buffering on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
@life1347
life1347 / git-deployment.md
Created Jan 10, 2017 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks
View git-deployment.md

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

View gist:37ec56eab084dafba60c9ee2c501d918
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
labels:
svc: logger
name: logger
namespace: fission
spec:
selector:
matchLabels:
View crd.yaml
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
namespace: default
name: environments.fission.io
spec:
group: fission.io
names:
kind: Environment
View gist:5f04b2974461c4d99a2ff00e6dfcf542
# exec form
FROM ubuntu
ENTRYPOINT ["top", "-b"]
# exec form result
top - 03:41:47 up 19 min, 0 users, load average: 0.61, 0.34, 0.27
Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
%Cpu(s): 3.0 us, 2.3 sy, 0.0 ni, 94.4 id, 0.4 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 3938828 total, 1300384 free, 582236 used, 2056208 buff/cache
KiB Swap: 1023996 total, 1023996 free, 0 used. 2561664 avail Mem
View Router with optimization
+ kubectl -n fission delete pod -l svc=executor
pod "executor-7cf5d5c445-47xvl" deleted
+ sleep 60
+ kubectl -n fission delete pod -l svc=router
pod "router-75474bc6b9-krz4f" deleted
+ sleep 10
+ hey -c 100 -n 100 http://192.168.99.100:31314/hello-go
Summary:
Total: 0.0799 secs
View Router 0.9.2
+ kubectl -n fission delete pod -l svc=executor
pod "executor-7cf5d5c445-4f68r" deleted
+ sleep 60
+ kubectl -n fission delete pod -l svc=router
pod "router-b4cfbd5c7-2ksnd" deleted
+ sleep 10
+ hey -c 100 -n 100 http://192.168.99.100:31314/hello-go
Summary:
Total: 14.2395 secs
You can’t perform that action at this time.