Skip to content

Instantly share code, notes, and snippets.

View chaks03's full-sized avatar
🎯
Focusing

Shudarshon Chaki chaks03

🎯
Focusing
View GitHub Profile
@chaks03
chaks03 / nginx-tomcat-rev-proxy.conf
Created April 12, 2020 11:13
nginx tomcat reverse proxy basic configuration
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;
@chaks03
chaks03 / gist:81e0da2c4d915f64e360d7f023ebe726
Created February 19, 2019 07:23 — forked from timmartin/gist:556b8552735312c0093b4594053c6335
Terraform rules for CloudWatch events triggering CodeBuild
provider "aws" {
region = "us-east-1"
}
resource "aws_codecommit_repository" "test" {
repository_name = "BuildTestRepository"
}
resource "aws_codebuild_project" "build_test" {
name = "BuildTest"
@chaks03
chaks03 / awc-ecs-access-to-aws-efs.md
Created January 22, 2019 09:45 — forked from duluca/awc-ecs-access-to-aws-efs.md
Step-by-step Instructions to Setup an AWS ECS Cluster

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:

@chaks03
chaks03 / file
Last active January 10, 2019 19:25
test_file_ansible
---
- 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
@chaks03
chaks03 / docker-compose.yml
Created January 8, 2019 11:11
nginx proxy with docker compose
version: '2'
services:
proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
environment:
---
- hosts: all
become: yes
become_method: sudo
tasks:
- name: update package manager
package:
update_cache: yes
@chaks03
chaks03 / solution.sh
Created January 1, 2019 12:40
Codewars "Complementary DNA" bash solution
#!/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" ]
def capitalize(string):
return " ".join(i.capitalize() for i in string.split(' '))
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))