Skip to content

Instantly share code, notes, and snippets.

View thamizarasu's full-sized avatar

Sankara Shunmugasundaram thamizarasu

View GitHub Profile
@thamizarasu
thamizarasu / delete_iam_user.sh
Created July 24, 2018 09:03 — forked from kgmoore431/delete_iam_user.sh
Delete an IAM user with AWS CLI
#!/bin/bash
user_name="$1"
echo "Removing user: ${user_name}"
echo "Deleting Access Keys:"
keys=("$(aws iam list-access-keys --user-name "${user_name}" | jq -r '.AccessKeyMetadata[] | .AccessKeyId')")
if [[ "${#keys}" -gt "0" ]]; then
# shellcheck disable=SC2068
@thamizarasu
thamizarasu / iprange2cidr.java
Created April 9, 2018 06:06
From an IP range to CIDR conversion (ipaddr1-ipaddr2) -> ipaddr/??
/*
This sourcecode was from https://www.ip2location.com/tutorials/how-to-convert-ip-address-range-into-cidr
Just added main method and parse the arguements.
*/
import java.util.*;
import java.io.*;
import java.util.StringTokenizer;
@thamizarasu
thamizarasu / getAllSecurityGroups.sh
Created November 19, 2016 23:14
Get all Security Groups from your AWS Account from all regions. Make sure you setup AWS Cli
#!/bin/bash
NOW=$(date +"%m-%d-%Y")
for region in $(aws ec2 describe-regions | jq '.[] | .[] | .RegionName' | cut -d\" -f2)
do
aws ec2 describe-security-groups --region=$region >> aws-all-security-groups-$NOW.txt
done
@thamizarasu
thamizarasu / getAllNetworkACLS.sh
Created November 19, 2016 23:12
This gist is to get all Network ACLs for your AWS account from all regions to review. Make sure you have aws cli setup
#!/bin/bash
NOW=$(date +"%m-%d-%Y")
for region in $(aws ec2 describe-regions | jq '.[] | .[] | .RegionName' | cut -d\" -f2)
do
aws ec2 describe-network-acls --region=$region >> aws-all-network-acls-$NOW.txt
done
@thamizarasu
thamizarasu / ListMembersInOrg.groovy
Last active September 15, 2016 17:48
List all the members of the organizations
#!/usr/bin/env groovy
/**
* groovy script to show all members belongs to the organization
* If you do not have groovy yet, run 'brew install groovy'
* run with groovy ListReposInOrg -t <personal access token> <org name>
*
* This program is just modified version of
* https://github.com/github/platform-samples/blob/master/api/groovy/ListReposInOrg.groovy
*

Keybase proof

I hereby claim:

  • I am thamizarasu on github.
  • I am sankar (https://keybase.io/sankar) on keybase.
  • I have a public key whose fingerprint is 683F CE16 0854 3D4C 208E 29A0 1763 F37A 27CC A9AF

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am thamizarasu on github.
* I am sankar (https://keybase.io/sankar) on keybase.
* I have a public key whose fingerprint is 31A3 57D5 BAF1 AFCB 0FFE 3E38 6221 D8B0 C53E B541
To claim this, I am signing this object:
@thamizarasu
thamizarasu / csv2ldif.py
Created March 14, 2014 23:19
CSV2LDIF Tool
__author__ = 'sankara'
import csv, time, sys, string, cStringIO, argparse
class CSV:
def __init__(self, file=None):
self.file = file
def read_file(self):
with open(self.file, 'r') as f:
@thamizarasu
thamizarasu / BFCryptoUtil
Created November 15, 2013 23:30
Crypto Util using Blowfish Algorithm..
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.spec.SecretKeySpec;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.List;
/**
* BFCryptoUtil - Utility to encrypt/decrypt strings using the Blowfish built-in key.