Skip to content

Instantly share code, notes, and snippets.

View philipz's full-sized avatar

philipz philipz

View GitHub Profile
@philipz
philipz / gist:fadd2ddb92c4cf07fb10
Created July 3, 2015 07:41
Nginx TCP Load balancing for Mysql(3306)

TCP LOAD BALANCING

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
@philipz
philipz / Readme.md
Last active April 5, 2022 18:53
GitLab Runner on a Kubernetes cluster
  1. Create namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: gitlab
  1. kubectl create -f ./namespace.yaml
@philipz
philipz / nginx-tuning.md
Created September 27, 2021 01:23 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@philipz
philipz / nodes.md
Created August 9, 2021 14:37
Documenting Software Architectures Views and Beyond

Seven Rules for Sound Documentation

  1. Write Documentation from the Reader’s Point of View
  2. Avoid Unnecessary Repetition
  3. Avoid Ambiguity 3.a Explain Your Notation
  4. Use a Standard Organization
  5. Record Rationale
  6. Keep Documentation Current but Not Too Current
  7. Review Documentation for Fitness of Purpose
@philipz
philipz / NN_R_notebook.md
Last active June 9, 2021 23:40
Neural Networks in R

#Reference

  1. Machine Learning with R
  2. SVM Docs in R

Read CSV

data<-read.csv("R_SVM.csv", header=T, sep=",")

Exploring and preparing the data

str(data)
'data.frame': 5379 obs. of 10 variables:
@philipz
philipz / readme.md
Last active June 5, 2021 07:04
Build a Website on Google Cloud: Challenge Lab

########################################################################################

Task 1: Download the monolith code and build your container

git clone https://github.com/googlecodelabs/monolith-to-microservices.git

cd ~/monolith-to-microservices
./setup.sh
@philipz
philipz / readme.md
Last active May 20, 2021 03:41
Create and Manage Cloud Resources: Challenge Lab

Task1

gcloud compute instances create nucleus-jumphost \
          --network nucleus-vpc \
          --zone us-east1-b  \
          --machine-type f1-micro  \
          --image-family debian-9  \
          --image-project debian-cloud
@philipz
philipz / gist:87ad761df64fb8c465a2
Last active March 9, 2021 18:47
QEMU QCOW2 Image
# Epitome
I want to have os image that can login with password.
download UEC image.
for example, this precise.
http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img
this image was forbidden to password login feature in terminal console.
it's reasonable for use of cloud image.
@philipz
philipz / readme.md
Last active February 12, 2021 12:07
Microk8s & Loft
  1. Need install rbac and storage by microk8s enable dns rbac storage
  2. Install loft
@philipz
philipz / Dockerfile.dev
Last active January 10, 2021 08:44
Quarkus Remote debug with Kubernetes
FROM adoptopenjdk/openjdk14-openj9:x86_64-alpine-jre-14_36.1_openj9-0.19.0
RUN apk add curl
ENV QUARKUS_LAUNCH_DEVMODE=true \
JAVA_ENABLE_DEBUG=true
COPY target/quarkus-app/lib/ /deployments/lib/
COPY target/quarkus-app/*.jar /deployments/
COPY target/quarkus-app/app/ /deployments/app/
COPY target/quarkus-app/quarkus/ /deployments/quarkus/