Skip to content

Instantly share code, notes, and snippets.

View urjitbhatia's full-sized avatar

Urjit Singh Bhatia urjitbhatia

View GitHub Profile
@urjitbhatia
urjitbhatia / docker_killer.py
Last active May 13, 2019 21:16
Python script to force kill docker containers older than a certain number of minutes
#!/usr/bin/python
# Quick and dirty script to kill containers older than some number of minutes
# Kills all containers older than 60 minutes by default!
import sys
import subprocess
from sets import Set
CMD_DOCKER_CONTAINERS_WITH_AGE = 'docker ps -a --format "{{.ID}} {{.Status}}"'
@urjitbhatia
urjitbhatia / darn.sh
Created January 10, 2017 19:21
Running multiple instances of yarnpkg jobs on CI servers
#!/bin/bash
# Place this file in your /usr/local/bin and then use darn instead of calling yarn
# This will wrap all your yarn calls to go through the same network mutex
# Calling yarn as before still works too if needed.
# --- Motivation ---
# Running multiple build jobs on CI servers like Jenkins will cause contention of
# shared yarnpkg resources (cache). This is going to end up badly for builds going
# out for deployment. This problem is usually not seen locally because devs rarely build
@urjitbhatia
urjitbhatia / gist:0b3e64c0b7a886c23b3d1890f9cf612b
Created July 21, 2016 22:35
Terraform_Debug_output_enabledMetrics
2016/07/21 15:30:18 [DEBUG] terraform-provider-aws: Action=DescribeAutoScalingGroups&AutoScalingGroupNames.member.1=<redacted>&Version=2011-01-01
2016/07/21 15:30:18 [DEBUG] terraform-provider-aws: -----------------------------------------------------
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: 2016/07/21 15:30:19 [DEBUG] [aws-sdk-go] DEBUG: Response autoscaling/DescribeAutoScalingGroups Details:
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: ---[ RESPONSE ]--------------------------------------
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: HTTP/1.1 200 OK
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: Connection: close
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: Transfer-Encoding: chunked
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: Content-Type: text/xml
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: Date: Thu, 21 Jul 2016 22:30:19 GMT
2016/07/21 15:30:19 [DEBUG] terraform-provider-aws: Vary: Accept-Encoding
@urjitbhatia
urjitbhatia / beanstalkd
Last active October 9, 2015 20:04
Beanstalkd upstart config with binary log file for Ubuntu. Place in /etc/init.d/
#!/bin/sh
#
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
#
# This is distributed in the hope that it will be useful, but