Skip to content

Instantly share code, notes, and snippets.

View sukrit007's full-sized avatar

Sukrit Khera sukrit007

View GitHub Profile
@sukrit007
sukrit007 / iam-assume-role.sh
Created December 14, 2019 01:58 — forked from ambakshi/iam-assume-role.sh
Assume an IAM role. An interesting way of doing IAM roles is to give the instance permissions to assume another role, but no actual permissions by default. I got this idea while setting up security monkey: http://securitymonkey.readthedocs.org/en/latest/quickstart1.html#setup-iam-roles.
#!/bin/bash
#
# Assume the given role, and print out a set of environment variables
# for use with aws cli.
#
# To use:
#
# $ eval $(./iam-assume-role.sh)
#
@sukrit007
sukrit007 / docker-compose.yml
Last active August 9, 2018 10:07
Sawtooth-Multi-Node
version: "2.1"
services:
settings-tp:
image: hyperledger/sawtooth-settings-tp:1.0
container_name: sawtooth-settings-tp-default
depends_on:
- validator
entrypoint: settings-tp -vv -C tcp://validator:4004
@sukrit007
sukrit007 / jshintrc.js
Last active October 3, 2016 20:33
My Recommended .jshintrc options for Server Side Development
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
// "maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : true, // true: Identifiers must be in camelCase
// "curly" : true, // true: Require {} for every new block or scope
@sukrit007
sukrit007 / boto-get-signed-url.py
Created April 16, 2015 04:51
AWS S3 Signed URL Script
#!/usr/bin/python
import boto
import argparse
parser = argparse.ArgumentParser(description='Generate an S3 signed URL')
parser.add_argument('-b', '--bucket', help='bucket name')
parser.add_argument('-k', '--key', help='prefix/key')
parser.add_argument('-s', '--seconds', type=int, help='time in seconds until the URL will expire')
args = parser.parse_args()
@sukrit007
sukrit007 / systemd-reload.service
Created February 6, 2015 01:00
Systemd Reload Hack for Fleet
[Unit]
Description=Systemd Reload Hack for coreos fleet
After=fleet.service
[Service]
Restart=always
RestartSec=20s
ExecStart=/bin/bash -c "while true; do if systemctl -all list-units | grep -e '@.*not-found.*inactive.*dead.*'; then systemctl daemon-reload; fi; systemctl -all list-units | grep '@[0-9].*loaded.*inactive.*dead.*' | awk '{print $1}' | xargs systemctl restart; sleep 120s; done"
#!/bin/bash -e
####
# Helper script to update the Last modified timestamp of files in a Git SCM
# Projects working Copy
#
# When you clone a Git repository, it sets the timestamp of all the files to the
# time when you cloned the repository.
#
# This becomes a problem when you want the cloned repository, which is part of a
# Web application have a proper cacheing mechanism so that it can re-cache files
#!/bin/bash -e
####
# Helper script to update the Last modified timestamp of files in a Git SCM
# Projects working Copy
#
# When you clone a Git repository, it sets the timestamp of all the files to the
# time when you cloned the repository.
#
# This becomes a problem when you want the cloned repository, which is part of a
# Web application have a proper cacheing mechanism so that it can re-cache files
#!/bin/bash -e
####
# Helper script to update the Last modified timestamp of files in a Git SCM
# Projects working Copy
#
# When you clone a Git repository, it sets the timestamp of all the files to the
# time when you cloned the repository.
#
# This becomes a problem when you want the cloned repository, which is part of a
# Web application have a proper cacheing mechanism so that it can re-cache files
#!/bin/bash -e
####
# Helper script to update the Last modified timestamp of files in a Git SCM
# Projects working Copy
#
# When you clone a Git repository, it sets the timestamp of all the files to the
# time when you cloned the repository.
#
# This becomes a problem when you want the cloned repository, which is part of a
# Web application have a proper cacheing mechanism so that it can re-cache files
@sukrit007
sukrit007 / gist:26b45ebf3316ac5c38ea
Created August 6, 2014 20:24
Ubuntu mirrors.txt using EC2 Mirrors
http://us-east-1.ec2.archive.ubuntu.com/ubuntu/
http://us-west-1.ec2.archive.ubuntu.com/ubuntu/
http://us-west-2.ec2.archive.ubuntu.com/ubuntu/