Skip to content

Instantly share code, notes, and snippets.

View shotu's full-sized avatar

Manish Atri shotu

View GitHub Profile
@shotu
shotu / simple-express-server-js-service.yaml
Last active August 3, 2020 10:57
A simple service file for node js deplyoment
apiVersion: v1
kind: Service # What kind of object you want to create
metadata:
name: simple-express-js-server
spec:
selector:
app: simple-express-js-server
ports:
- port: 80
targetPort: 3000
@shotu
shotu / simple-express-server-js-deployment.yaml
Last active July 17, 2020 10:13
A simple express server deployment file
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment # What kind of object you want to create
metadata:
name: simple-express-js-server
spec:
replicas: 1 # tells deployment to run 1 pods matching the template
selector:
matchLabels:
app: simple-express-js-server
template: # content from this line is pod spec , which image to use, lables for the pods , and the container info
@shotu
shotu / server.js
Created July 17, 2020 07:45
express server.js file
const express = require("express")
const app = express()
app.get("/", function(req, res) {
res.send("Hello World")
})
app.listen(3000, function(req,res){
console.log("App is listening at port : 3000! ")
})
@shotu
shotu / Dockerfile
Last active July 17, 2020 08:07
Node js docker image
# using base image with node version 12 installed
FROM node:12
# Create working app directory
WORKDIR /usr/src/app
# copy packages
# Install app dependencies
COPY package*.json ./
RUN npm install
@shotu
shotu / gist:5dd10655e408728051b952a4e985cb92
Created July 14, 2020 11:27
simple-express-js-server.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: simple-express-js-server
spec:
replicas: 1
selector:
matchLabels:
app: simple-express-js-server
template:
@shotu
shotu / read-access.sql
Created September 21, 2018 11:18 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@shotu
shotu / LampSetup.md
Last active December 16, 2015 09:50 — forked from anistark/LampSetup.md
LAMP Setup

Install Apache

sudo apt-get update
sudo apt-get install apache2

Install Mysql