Skip to content

Instantly share code, notes, and snippets.

View MrHassanMurtaza's full-sized avatar
🎯
Focusing

Hassan Murtaza MrHassanMurtaza

🎯
Focusing
View GitHub Profile
@MrHassanMurtaza
MrHassanMurtaza / config.yml
Created July 24, 2019 11:41 — forked from posva/config.yml
Simple Circle CI 2 config for node/js projects
# Javascript Node 8 simple CircleCI 2.0 configuration file
# Eduardo San Martin Morote
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
# Put this file in a .circleci/ folder
version: 2
jobs:
build:
docker:
@MrHassanMurtaza
MrHassanMurtaza / lambda_rds_mysql.js
Last active July 9, 2019 21:50
Connect Lambda to RDS MySql
const mysql = require('mysql');
var config = require('./config.json');
exports.handler = function(event, context, callback) {
var pool = mysql.createPool({
host : config.dbhost,
user : config.dbuser,
password : config.dbpassword,
@MrHassanMurtaza
MrHassanMurtaza / lambda_function.py
Last active December 15, 2020 09:32
Automate Analyzing your IAM Permissions using IAM Access Advisor
import boto3
from botocore.exceptions import ClientError
from datetime import datetime, timezone
import traceback
from time import sleep
RECIPIENTS = ["[email protected]"]
SENDER = "John Doe <[email protected]>"
LAST_ACCESS_THRESHOLD = 90
@MrHassanMurtaza
MrHassanMurtaza / get_iam_client.py
Last active May 27, 2019 20:38
Lambda IAM Policy for Access Advisor and SES
def get_iam_client():
"""
Get identity and access management client
"""
return boto3.client('iam')
@MrHassanMurtaza
MrHassanMurtaza / user-data.sh
Created February 6, 2019 11:25 — forked from codeinthehole/user-data.sh
Get the value of an EC2 instance's tag
#!/usr/bin/env bash
#
# Get the value of a tag for a running EC2 instance.
#
# This can be useful within bootstrapping scripts ("user-data").
#
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy
# JSON for this looks like:
#
# {
@MrHassanMurtaza
MrHassanMurtaza / config.xml
Created August 28, 2018 07:29 — forked from g0t4/config.xml
Module 2 - What am I? Get this job loaded into Jenkins and running, there are two problems you'll encounter. Raw
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.plugins.git.GitSCM" plugin="[email protected]">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>