Skip to content

Instantly share code, notes, and snippets.

View Anupam02's full-sized avatar

Anupam Patel Anupam02

  • Bangalore, INDIA
View GitHub Profile

AWS region

regions all around the world

Each region has availabiliy zones

eg ( us-east-1 b , ) can go upto 6 availability zones

Each availability zone is a physical data center in the region, but separate from the other ones( so that they’re isolated from disasters)

AWS Consoles are region scoped ( except IAM and S3 )

@Anupam02
Anupam02 / basic.org
Created January 21, 2020 14:27
flask

flask

jinja2

werkzeug

wsgi

snakeeyes

start with a single app.py file to different well origanised files.

Visualizing the Application’s Architecture

gunicorn

@Anupam02
Anupam02 / basic.org
Last active January 21, 2020 14:24
design pattern python

Solid Design Principles

Single Responsibility Pattern (SRP)

also known as Seperation of Concerns (SOC)

It prevents from making a GOD object ( creating every functionality in one class)

class Journal:
    def __init__(self):
        self.entries = []
        self.count = 0

Terraform

Infrastructure as code

Automation of your infrastructure

Keep your infra in a certain state

e.g 2 web instances with 2 volumes and 1 load balancer

Make your infrastructure auditable

You can keep your infra change history in a version control system like GIT

Ansible , Chef, Puppet, Saltstack have a focus on automating the installation and configuration of software

Keeping the machines in compliance, in a certain state.

Terraform can automate provisioning of the insfrastructure itself

@Anupam02
Anupam02 / install-docker.sh
Created June 20, 2018 09:57 — forked from dweldon/install-docker.sh
Install docker CE on Linux Mint 18.3
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
@Anupam02
Anupam02 / structure.c
Created September 2, 2016 12:26
structure
#include <stdio.h>
#include <stdlib.h>
typedef struct node {
int data;
struct node * next;
} node;
void push(node **header_ref , int data){
/** function to push data ( node ) at the head
#include<iostream>
using namespace std;
int main() {
string name;
bool performedGood = false;
int n, lower , upper;
cin>>n;
while(n--) {
cin>>name>>lower>>upper;
#include <iostream>
using namespace std;
inline int checkThePoint(int a, int x, int y) {
if(x > 0 && x < a && y > 0 && y < a) return 0;;
if(((x == 0 || x == a) && ( y >= 0 && y <= a)) || ((y == 0 || y == a) && ( x >= 0 && x <= a))) return 1;
return 2;
}
int main() {
#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
using namespace std;
template <typename T>
void bubble(vector<T> & V, int size) {
for (int i = size-1; i >= 0 ; i--) {
for (int j = 0; j <= i;j++ ) {
#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
using namespace std;
template <typename T>
void insertionSort(vector<T> &V, int n) {
int i,j;
T key;