Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Hassan Murtaza MrHassanMurtaza

🎯
Focusing
Block or report user

Report or block MrHassanMurtaza

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MrHassanMurtaza
MrHassanMurtaza / csv-to-json.js
Last active Aug 17, 2019
Convert CSV to JSON based on Delimeter
View csv-to-json.js
const removeSpaces = (str) => {
return str.replace(/^\s+|\s+$/g, "");
}
const DELIMITER = '|';
const csvJSON = (csv) => {
let lines = csv.split("\n");
@MrHassanMurtaza
MrHassanMurtaza / circleci.yml
Created Jul 24, 2019 — forked from statico/circleci.yml
Node.js 10 + PostgreSQL CircleCI config
View circleci.yml
version: 2
workflows:
version: 2
build:
jobs:
- test
jobs:
test:
@MrHassanMurtaza
MrHassanMurtaza / config.yml
Created Jul 24, 2019 — forked from posva/config.yml
Simple Circle CI 2 config for node/js projects
View config.yml
# 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 Jul 9, 2019
Connect Lambda to RDS MySql
View lambda_rds_mysql.js
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 May 27, 2019
Automate Analyzing your IAM Permissions using IAM Access Advisor
View lambda_function.py
import boto3
from botocore.exceptions import ClientError
from datetime import datetime, timezone
import traceback
from time import sleep
RECIPIENTS = ["recipient_user@abc.com"]
SENDER = "John Doe <johndoe@abc.com>"
LAST_ACCESS_THRESHOLD = 90
@MrHassanMurtaza
MrHassanMurtaza / get_iam_client.py
Last active May 27, 2019
Lambda IAM Policy for Access Advisor and SES
View get_iam_client.py
def get_iam_client():
"""
Get identity and access management client
"""
return boto3.client('iam')
@MrHassanMurtaza
MrHassanMurtaza / user-data.sh
Created Feb 6, 2019 — forked from codeinthehole/user-data.sh
Get the value of an EC2 instance's tag
View user-data.sh
#!/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 Aug 28, 2018 — 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
View config.xml
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.plugins.git.GitSCM" plugin="git@2.5.2">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
You can’t perform that action at this time.