Skip to content

Instantly share code, notes, and snippets.

@naveen-vijay
naveen-vijay / disable-ie.ps1
Created February 10, 2017 22:48
Powershell script to Disable IE Enhanced Security
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0
Stop-Process -Name Explorer
@naveen-vijay
naveen-vijay / template.json
Created October 23, 2016 00:35
CloudFormer in a separate new VPC (non-default)
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "A custom CloudFormer template forked from AWS provided to extend the capability to provide the ability to specify the VPC. Creates a Separate Stand-Alone VPC, Subnet - 10.0.0.0/16 to launch the CloudFormer Instance. AWS CloudFormer Beta - template creation prototype application. This tool allows you to create an AWS CloudFormation template from the AWS resources in your AWS account. **Warning** This template creates a single EC2 instance in your account to run the application - you will be billed for the instance at normal AWS EC2 rates.",
"Parameters" : {
"Username" : {
"Description" : "Username to log in to CloudFormer",
"Type" : "String"
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Lambda Delay",
"Parameters": {
"SubnetAZ": {
"Description": "CIDR for AZ",
"Type": "AWS::EC2::AvailabilityZone::Name",
"Default": "us-east-1d"
}
},
exports.handler = function(event, context) { //Respond with a SUCCESS Signal regardless of create/update/delete
if (event.RequestType == "Delete") {
sendResponse(event, context, "SUCCESS");
return;
}
setTimeout(function() {
console.log('Slept');
Data = {"val1":"val1"}; // Some Dummy Value to be returned back to the CloudFormation Stack
return sendResponse(event, context, "SUCCESS",Data);
}, 294000); //slightly less than 5 mins - currently hardcoded but be possible accept dynamically
"DelayWaitHandle" : {
"Type" : "AWS::CloudFormation::WaitConditionHandle",
"Properties" : {
}
},
"DelayWaitCondition" : {
"Type" : "AWS::CloudFormation::WaitCondition",
"DependsOn" : "RemoteDesktopServer",
"Properties" : {
"Handle" : { "Ref" : "DelayWaitHandle" },
@naveen-vijay
naveen-vijay / sg-route53-health-check-all.json
Created August 13, 2015 11:34
CloudFormation Template to create Security Group for the AWS Specified IP Range - HTTP, HTTPS, TCP PORT Range
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "TCP - Security Group for Route53 Health - HTTP,HTTPS,TCP checks",
"Parameters" :
{
"VPC" :
{
"Type" : "AWS::EC2::VPC::Id",
"Description" : "VPC where the Security Group will belong"
},
@naveen-vijay
naveen-vijay / sg-route53-health-check-https.json
Created August 13, 2015 11:17
CloudFormation Template to create Security Group for the AWS Specified IP Range - HTTPS Only
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "HTTPS - Security Group for Route53 Health - https checks",
"Parameters" :
{
"VPC" :
{
"Type" : "AWS::EC2::VPC::Id",
"Description" : "VPC where the Security Group will belong"
},
@naveen-vijay
naveen-vijay / sg-route53-health-check-http.json
Created August 13, 2015 11:15
CloudFormation Template to create Security Group for the AWS Specified IP Range - HTTP Only
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "HTTP - Security Group for Route53 Health - http checks",
"Parameters" :
{
"VPC" :
{
"Type" : "AWS::EC2::VPC::Id",
"Description" : "VPC where the Security Group will belong"
},
@naveen-vijay
naveen-vijay / sg-route53-health-check-tcp.json
Last active August 29, 2015 14:27
CloudFormation Template Create Security Group for the AWS Specified IP Range - TCP Only
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "TCP - Security Group for Route53 Health - TCP checks",
"Parameters" :
{
"VPC" :
{
"Type" : "AWS::EC2::VPC::Id",
"Description" : "VPC where the Security Group will belong"
},
@naveen-vijay
naveen-vijay / aws-lambda-CloudTrail2CloudSearch
Last active July 16, 2020 13:53
AWS Lambda - CloudTrail to CloudSearch Pusher
var AWS = require('aws-sdk');
var zlib = require('zlib');
//Lambda Configurations
var awsParam = {region:"us-east-1"};
AWS.config.sslEnabled = false;
//Declarations
var s3 = new AWS.S3(awsParam);
var bucketName = "bucket-cloud-trail";