Skip to content

Instantly share code, notes, and snippets.

SUNNY sunnykrGupta

Block or report user

Report or block sunnykrGupta

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
View .gitlab-ci.yml
before_script:
- export GOPATH=$(pwd)
stages:
- build
- test
- deploy
validate-schema:
image: truongsinh/pg-client:9.4
View benchmark-commands.txt
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
@sunnykrGupta
sunnykrGupta / flask-uWSGI-nginx.md
Created Sep 25, 2017 — forked from bluekvirus/flask-uWSGI-nginx.md
How To Serve Flask Applications with uWSGI and Nginx on Ubuntu 14.04+
View flask-uWSGI-nginx.md

How To Serve Flask Applications with uWSGI and Nginx on Ubuntu 14.04

@credit Yan Zhu (https://github.com/nina-zhu)

Introduction

Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions, it can help you get your Python application or website off the ground. Flask includes a simplified development server for testing your code locally, but for anything even slightly production related, a more secure and powerful web server is required.

In this guide, we will demonstrate how to install and configure some components on Ubuntu 14.04 to support and serve Flask applications. We will configure the uWSGI application container server to interface with our applications. We will then set up Nginx to reverse proxy to uWSGI, giving us access to its security and performance features to serve our apps.

Prerequisites and Goals

View node-selector.yaml
#-------------- Node selector example
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
env: test
spec:
containers:
View po-limit.yaml
Convention
# RAM : Mi = MB, ie, 1024Mi is 1024 MB or 1GB
# CPU : m = milicpu , ie, 100m cpu is 100 milicpu, or say 0.1 CPU
apiVersion: v1
kind: Pod
metadata:
name: cpu-ram-demo
spec:
containers:
View kubectl-commands.sh
## To view Nodes in a cluster
$kubectl get nodes
NAME STATUS AGE
gke-test-cluster-default-pool-2d123aa1-012f Ready 2d
gke-test-cluster-default-pool-2d123aa1-e23k Ready 2d
## To view the Deployment we created run:
$ kubectl get deployments
View s-svc.yaml
###### cat sample-services.yaml
kind: Service
apiVersion: v1
metadata:
name: my-service
spec:
type: LoadBalancer
loadBalancerIP: 10.10.10.1
ports:
View s-deply.yaml
#sample-deployment.yaml
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
template:
metadata:
View ZZX-docker-ls-1.sh
I have three file in my directory named 'flask' :
➜ flask
── app.py
── Dockerfile
── requirement.txt
#----------------------------------------------
$ cat app.py
@sunnykrGupta
sunnykrGupta / centos_python.sh
Created Feb 1, 2017 — forked from selfboot/centos_python.sh
CentOS 6.8: Install Python 2.7.10, pip, virtualenv, and virtualenvwrapper on CentOS
View centos_python.sh
#!/bin/bash
# According to:
# How To Set Up Python 2.7.6 and 3.3.3 on CentOS 6.4
# https://www.digitalocean.com/community/tutorials/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4
yum -y update
yum groupinstall -y 'development tools'
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel
yum install xz-libs
wget http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz
You can’t perform that action at this time.