Skip to content

Instantly share code, notes, and snippets.

@harsh4870
harsh4870 / simper-node.js
Last active January 9, 2018 13:52
simple node js server
http.createServer(function (request, response) {
// Send the HTTP header
// HTTP Status: 200 : OK
// Content Type: text/plain
response.writeHead(200, {'Content-Type': 'text/plain'});
// Send the response body as "Hello World"
response.end('Hello World\n');
}).listen(8081);
@harsh4870
harsh4870 / gist:ca863cf1bc14070166b6585c9c2d0d47
Created April 10, 2019 17:42
Digital-ocean-auto volume backup
#!/bin/bash
DIGITALOCEAN_TOKEN=''
VOLUME_ID=''
SNAPSHOT_NAME=''
DATE=`date '+%Y%m%d-%H%M%S'`
curl -X POST \
"https://api.digitalocean.com/v2/volumes/$VOLUME_ID/snapshots" \
@harsh4870
harsh4870 / redis-statfulset.yaml
Created June 9, 2019 20:24
Redis rejson statefulset deployment on kubernetes
apiVersion: v1
kind: Service
metadata:
name: redis
spec:
ports:
- port: 6379
name: redis
clusterIP: None
selector:
Table of content
| Statefulsets | Image version | PVC mountpath |
| ------------- |:-------------:| -----:|
| Elasticsearch | elasticsearch:6.5.0 | /usr/share/elasticsearch/data |
| Graylog | graylog/graylog:3.0.1 | /usr/share/graylog/data/journal |
| MongoDB | mongo:3 | /data/db |
apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
name: sonarqube
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: it-support@example.com
privateKeySecretRef:
name: sonarqube
@harsh4870
harsh4870 / values.yaml
Created May 11, 2020 18:18
kong-values.yaml
# Default values for Kong's Helm Chart.
# Declare variables to be passed into your templates.
#
# Sections:
# - Kong parameters
# - Ingress Controller parameters
# - Postgres sub-chart parameters
# - Miscellaneous parameters
# - Kong Enterprise parameters
@harsh4870
harsh4870 / values.yaml
Created May 11, 2020 18:22
kong-values.yaml with postgres setup
# Default values for Kong's Helm Chart.
# Declare variables to be passed into your templates.
#
# Sections:
# - Kong parameters
# - Ingress Controller parameters
# - Postgres sub-chart parameters
# - Miscellaneous parameters
# - Kong Enterprise parameters
@harsh4870
harsh4870 / php-fpm-deployment.yaml
Created August 22, 2020 08:25
php-fpm kubernetes wordpress with nginx
apiVersion: extensions/v1
kind: Deployment
metadata:
labels:
app: wordpress-site
name: wordpress-site
namespace: development
spec:
progressDeadlineSeconds: 600
replicas: 1
@harsh4870
harsh4870 / deployment.yaml
Created February 24, 2021 13:47
Keycloak Kubernetes docker setup yaml
apiVersion: v1
kind: Service
metadata:
name: keycloak
labels:
app: keycloak
spec:
ports:
- name: http
port: 8080
@harsh4870
harsh4870 / nginx-1.10.3.sh
Created March 2, 2021 06:02
Shell Script to Install nginx from source.
#!/bin/sh
# nginx install from source shell
echo "\033[32m-nginx-> cUrling nginx v1.10.3 into current directory.\033[0m"
curl -O http://nginx.org/download/nginx-1.10.3.tar.gz
echo "\033[32m-nginx-> nginx tar downloaded, unarchiving...\033[0m"
tar -zxf nginx-1.10.3.tar.gz
cd nginx-1.10.3
echo "\033[32m-nginx-> ./configure\033[0m"
./configure