Skip to content

Instantly share code, notes, and snippets.

philipz philipz

Block or report user

Report or block philipz

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
@philipz
philipz / readme.md
Last active Oct 20, 2019
Kafka Partitions and Consumer Group
View readme.md

A. Consumer > Partitions

consumer.properties

group.id=group1
  1. ./kafka-topics.sh --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 1 --topic test
  2. ./kafka-console-producer.sh --broker-list kafka:9092 --topic test
  3. ./kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic test --consumer.config ./consumer.properties
  4. ./kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic test --consumer.config ./consumer.properties
View gist:cc2877aaeb0158b86290122badb2d2c0
1. 管理型系統,如營運類系統,首選關聯式。
2. 大流量系統,如電商單品頁的某個服務,後台選關聯式,前台選內存式。
3. 日誌型系統,原始數據選列式,日誌搜尋選倒排索引。
4. 搜尋型系統,指站內搜尋,非通用搜尋,如商品搜尋,後台選關聯式,前台選倒排索引。
5. 交易型系統,如庫存、交易、記帳,選關聯式+快取+一致性協議,或新型關聯式資料庫。
6. 離線運算,如大量數據分析,首選列式,關聯式亦可。
7. 即時運算,如即時監控,可以選時序資料庫,或列式資料庫。
View readme.md

wget -qO - https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | sudo apt-key add -

@philipz
philipz / readme.md
Created May 2, 2019
Add user in Dockerfile
View readme.md

RUN groupadd -r mysql && useradd -r -g mysql mysql

@philipz
philipz / readme.md
Last active Jul 14, 2019
TriggerMesh Knative-local-registry "ErrImagePull"
View readme.md
@philipz
philipz / readme.md
Created Apr 28, 2019
Kaniko to Docker Hub
View readme.md

A quick look at Google's Kaniko project

docker run -v $PWD:/workspace -v ~/.docker/config.json:/kaniko/config.json \
 --env DOCKER_CONFIG=/kaniko \
 gcr.io/kaniko-project/executor:latest \
 -d philipz/hello-world:kaniko
@philipz
philipz / Dockerfile.md
Created Apr 27, 2019
Azure Function for Knative
View Dockerfile.md
@philipz
philipz / autoscale.yaml
Created Apr 27, 2019
Knative Auto Scaling
View autoscale.yaml
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
name: azurefunc
namespace: default
spec:
runLatest:
configuration:
revisionTemplate:
metadata:
@philipz
philipz / readme.md
Created Apr 25, 2019
Docker Save/Load Tgz
View readme.md
#for not running docker, use save:
docker save <dockernameortag> | gzip > mycontainer.tgz

#for running or paused docker, use export:
docker export <dockernameortag> | gzip > mycontainer.tgz

#load
gunzip -c mycontainer.tgz | docker load
@philipz
philipz / readme.md
Created Apr 15, 2019
Docker multi-stage build caching
View readme.md

Caching Docker layers on serverless build hosts with multi-stage builds, --target, and --cache-from

docker build --cache-from philipz/quark:builder --target builder -t philipz/quarkus:builder .
docker build --cache-from philipz/quarkus:builder --cache-from philipz/quarkus:nativebuilder --target nativebuilder -t philipz/quarkus:nativebuilder .
docker build --cache-from philipz/quarkus:builder --cache-from philipz/quarkus:nativebuilder --cache-from philipz/quarkus:lddpackage --target lddpackage -t philipz/quarkus:lddpackage .
docker build --cache-from philipz/quarkus:builder --cache-from philipz/quarkus:nativebuilder --cache-from philipz/quarkus:lddpackage --cache-from philipz/quarkus_hello  -t philipz/quarkus_hello .
You can’t perform that action at this time.