Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Shudarshon Chaki shudarshon

🎯
Focusing
View GitHub Profile
@shudarshon
shudarshon / nginx-tomcat-rev-proxy.conf
Created Apr 12, 2020
nginx tomcat reverse proxy basic configuration
View nginx-tomcat-rev-proxy.conf
server {
listen 80;
server_name _;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8080;
@shudarshon
shudarshon / gist:81e0da2c4d915f64e360d7f023ebe726
Created Feb 19, 2019 — forked from timmartin/gist:556b8552735312c0093b4594053c6335
Terraform rules for CloudWatch events triggering CodeBuild
View gist:81e0da2c4d915f64e360d7f023ebe726
provider "aws" {
region = "us-east-1"
}
resource "aws_codecommit_repository" "test" {
repository_name = "BuildTestRepository"
}
resource "aws_codebuild_project" "build_test" {
name = "BuildTest"
@shudarshon
shudarshon / awc-ecs-access-to-aws-efs.md
Created Jan 22, 2019 — forked from duluca/awc-ecs-access-to-aws-efs.md
Step-by-step Instructions to Setup an AWS ECS Cluster
View awc-ecs-access-to-aws-efs.md

Configuring AWS ECS to have access to AWS EFS

If you would like to persist data from your ECS containers, i.e. hosting databases like MySQL or MongoDB with Docker, you need to ensure that you can mount the data directory of the database in the container to volume that's not going to dissappear when your container or worse yet, the EC2 instance that hosts your containers, is restarted or scaled up or down for any reason.

Don't know how to create your own AWS ECS Cluster? Go here!

New Cluster

Sadly the EC2 provisioning process doesn't allow you to configure EFS during the initial config. After your create your cluster, follow the guide below.

New Task Definition for Web App

If you're using an Alpine-based Node server like duluca/minimal-node-web-server follow this guide:

@shudarshon
shudarshon / file
Last active Jan 10, 2019
test_file_ansible
View file
---
- name: Installing PHP packages
apt: update_cache=yes state=latest name={{ item }} state=latest
with_items:
- php5
- php5-fpm
- php5-mysql
- php5-curl
- php5-mcrypt
- php5-gd
@shudarshon
shudarshon / docker-compose.yml
Created Jan 8, 2019
nginx proxy with docker compose
View docker-compose.yml
version: '2'
services:
proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
environment:
View gist:598084ff1aa987a1d303ce19ca5e637a
---
- hosts: all
become: yes
become_method: sudo
tasks:
- name: update package manager
package:
update_cache: yes
@shudarshon
shudarshon / solution.sh
Created Jan 1, 2019
Codewars "Complementary DNA" bash solution
View solution.sh
#!/bin/bash
# problem url https://www.codewars.com/kata/complementary-dna/shell
i=1
c=""
while [ $i -le ${#1} ]
do
var=$(echo $1 | cut -c $i)
if [ $var == "A" ]
View hackerrank_capitalize.py
def capitalize(string):
return " ".join(i.capitalize() for i in string.split(' '))
View hackerrank_zip.py
n,x=map(int, raw_input().split())
marks=[]
for i in range(x):
arr=map(float,raw_input().split())
marks.append(arr)
for points in zip(*marks):
print "%s" %(sum(points)/len(points))