Skip to content

Instantly share code, notes, and snippets.

View Puneeth-n's full-sized avatar
💭
git clean -ffdx

Puneeth Puneeth-n

💭
git clean -ffdx
View GitHub Profile
- hosts: localhost
connection: local
gather_facts: true
become: true
tasks:
- name: Get empty devices
set_fact:
additional_disk_devices: "{{ additional_disk_devices|default([]) }} + [ '/dev/{{ item }}' ]"
when: '"nvme" in item and (ansible_devices[item].partitions | length) == 0'
@Puneeth-n
Puneeth-n / modernie.md
Created May 15, 2019 21:15 — forked from hiasinho/modernie.md
Internet Explorer on Vagrant

The Modern.ie Virtual Machine Images – VMs used for testing several versions of IE – are now also available as vagrant boxes. Here’s the list:

@Puneeth-n
Puneeth-n / iam_auth_psql.sh
Created November 28, 2018 21:08 — forked from quiver/iam-policy.json
How to connect to Amazon RDS PostgreSQL with IAM credentials
#! /bin/bash
# helper script to connect to Amazon RDS PostgreSQL with IAM credentials
# https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html
REGION=us-east-1
AWS_ACCOUNT_ID=123456789012
ROLE=EC2WebRole
ROLE_SESSION_NAME=ROLE_SESSION_NAME
DURATION=900
@Puneeth-n
Puneeth-n / docker-compose.json
Created July 26, 2018 13:51 — forked from fmarten/docker-compose.json
Packer Template for Ubuntu 16.04 with Docker Compose as Amazon Machine Image (AMI)
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}"
},
"builders": [
{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",

Unfortunately as of writing this (Oct 18, 2017) there is no built in integration for multiple target groups per AWS ECS service. Here are a few things you can try:

  1. If your application just serves port 80 (HTTP) & port 443 (HTTPS) then you should consider using the application load balancer and terminating SSL at the load balancer. This will allow your application to function using just port 80.

  2. If your application serves different ports that are backed by different components, perhaps speaking different protocols then you should consider splitting the application into multiple ECS services. This has the benefit of allowing the different components to independently scale

@Puneeth-n
Puneeth-n / cleanupJenkinsWorkspaces.groovy
Created June 20, 2018 13:27 — forked from EvilBeaver/cleanupJenkinsWorkspaces.groovy
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
@Puneeth-n
Puneeth-n / ecs-run
Created April 25, 2018 09:18 — forked from vcastellm/ecs-run
Run task and wait for result in AWS ECS
#!/usr/bin/env bash
set -e
function usage() {
set -e
cat <<EOM
##### ecs-run #####
Simple script for running tasks on Amazon Elastic Container Service
One of the following is required:
Required arguments:
@Puneeth-n
Puneeth-n / snake.py
Created April 24, 2018 19:26 — forked from sanchitgangwar/snake.py
Snakes Game using Python
# SNAKES GAME
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
curses.initscr()
win = curses.newwin(20, 60, 0, 0)
@Puneeth-n
Puneeth-n / simple-promise-retry.js
Created March 5, 2018 22:27 — forked from briancavalier/simple-promise-retry.js
A few general patterns for retries using promises
function keepTrying(otherArgs, promise) {
promise = promise||new Promise();
// try doing the important thing
if(success) {
promise.resolve(result);
} else {
setTimeout(function() {
keepTrying(otherArgs, promise);
@Puneeth-n
Puneeth-n / package-plugin-lifecycle.md
Created May 24, 2017 09:07 — forked from HyperBrain/package-plugin-lifecycle.md
Serverless - Package/Deploy plugin lifecycle changes

Overview

Currently the Serverless framework only offers lifecycle events that are bound to commands and also are very coarse. Each core plugin only exposes the events that are defined by the framework. This is suboptimal for plugin authors as they want to hook special events within the deployment process.

The PR adds fine grained lifecycles to the AWS deployment process (see below for the current implementation process) and makes the package/deploy plugin implementation non-breaking.