Skip to content

Instantly share code, notes, and snippets.

View checkaayush's full-sized avatar

Aayush Sarva checkaayush

View GitHub Profile
@checkaayush
checkaayush / .gitignore
Created April 2, 2018 10:54
Python project .gitignore file
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
@checkaayush
checkaayush / Dockerfile
Created March 30, 2018 15:12
Dockerfile for Python Hug Based Applications served using gunicorn
FROM python:3.6-slim
LABEL maintainer="Aayush Sarva" email="[email protected]"
WORKDIR /usr/src/app
COPY ./requirements.txt /usr/src/app
RUN pip install --no-cache-dir -r requirements.txt
COPY . /usr/src/app
EXPOSE 5000
CMD gunicorn -b :5000 --timeout 300 <path_to_hug_api>:__hug_wsgi__
@checkaayush
checkaayush / setup.py
Last active March 28, 2018 13:24
Sample setup.py
# Reference: https://github.com/pypa/sampleproject/blob/master/setup.py
from setuptools import setup, find_packages
def requirements():
"""Returns packages required by current project."""
reqs = []
with open('requirements.txt', 'r') as f:
for line in f:
@checkaayush
checkaayush / pm2-ubuntu.service
Created January 23, 2018 10:43
PM2 systemd script
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target
[Service]
Type=forking
User=ubuntu
LimitNOFILE=infinity
LimitNPROC=infinity
@checkaayush
checkaayush / Makefile
Last active May 30, 2019 10:54
Makefile to setup MongoDB Replica Set for development
# Setup local MongoDB Replica Set for development.
DB_ROOT ?= /tmp
DB1_PATH ?= ${DB_ROOT}/db1
DB2_PATH ?= ${DB_ROOT}/db2
DB3_PATH ?= ${DB_ROOT}/db3
DB1_PORT ?= 30000
DB2_PORT ?= 40000
DB3_PORT ?= 50000
@checkaayush
checkaayush / vscodeUserSettings.json
Last active January 17, 2018 09:31
My VSCode User Settings
{
"editor.tabSize": 2,
"workbench.colorTheme": "Monokai",
"editor.fontFamily": "'DejaVu Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
"window.zoomLevel": 0,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
@checkaayush
checkaayush / Postman.desktop
Created November 14, 2017 11:08 — forked from aviskase/Postman.desktop
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/opt/Postman/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
@checkaayush
checkaayush / mongodb_setting_up_a_replica_set.md
Last active December 6, 2017 08:22 — forked from leommoore/mongodb_setting_up_a_replica_set.md
MongoDB - Setting up a Replica Set

MongoDB - Setting up a Replica Set

cd \mongodbdir\

mkdir db1
mkdir db2
mkdir db3

Primary

mongod --dbpath ./db1 --port 30000 --replSet "demo"

@checkaayush
checkaayush / http_status.py
Created October 15, 2017 20:37 — forked from toast38coza/http_status.py
HTTP status codes as a dict. Source: https://httpstatuses.com/
STATUS_CODES = {
100: "100 Continue",
101: "101 Switching Protocols",
102: "102 Processing",
200: "200 OK",
201: "201 Created",
202: "202 Accepted",
203: "203 Non-authoritative Information",
204: "204 No Content",
@checkaayush
checkaayush / README-Template.md
Created July 30, 2017 14:13 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites