Skip to content

Instantly share code, notes, and snippets.

View sukrit007's full-sized avatar

Sukrit Khera sukrit007

View GitHub Profile
@sukrit007
sukrit007 / UntypedJsonDataConverter
Created February 18, 2014 05:26
Sample Implementation for UntypedJsonDataConverter
package com.meltmedia.cdp.orch.util
import com.amazonaws.services.simpleworkflow.flow.DataConverterException
import com.amazonaws.services.simpleworkflow.flow.JsonDataConverter
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.node.ArrayNode
import com.google.common.collect.Lists
import java.lang.reflect.Method
@sukrit007
sukrit007 / logstash.conf
Created July 7, 2014 19:54
Syslog Gist
input {
syslog {
}
}
@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/
#!/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 / 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"
@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 / 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