Skip to content

Instantly share code, notes, and snippets.

View mmansoor's full-sized avatar

Muhammad Mansoor mmansoor

View GitHub Profile
@mmansoor
mmansoor / lambda_function.py
Created June 9, 2022 13:46
Read Email from S3
import json
import boto3
from email.parser import BytesParser
from email import policy
import os
def lambda_handler(event, context):
message = event['Records'][0]['Sns']['Message']
print(type(message))
#!/bin/bash
sudo yum update -y
amazon-linux-extras install -y nginx1.12
sudo systemctl start nginx
sudo systemctl enable nginx
usermod -a -G nginx-user ec2-user
chown -R ec2-user:nginx-user /var/www
chmod 2775 /var/www
find /var/www -type d -exec chmod 2775 {} \;
find /var/www -type f -exec chmod 0664 {} \;
@mmansoor
mmansoor / readme.md
Last active February 22, 2024 15:16
Export Metrics from CloudWatch to CSV

Export CloudWatch Metrics

This document outlines how to export CloudWatch Metrics to CSV.

Pre Reqs

  1. AWS CLI (Command Line Interface) from here
  2. jq is a lightweight and flexible command-line JSON processor from here

How to export

@mmansoor
mmansoor / gist:9f731bec0623357d99a2392e4f0504be
Last active December 4, 2018 16:43
Install zsh and oh-my-zsh on Amazon Linux ARM ARM64
# Update yum
sudo yum update
# Install latest version of zsh
sudo yum install zsh
# Validate the installation of zsh
zsh --version
# Amazon Linux on ARM ARM64 does not have chsh installed, we will fallback
@mmansoor
mmansoor / gist:ea8cb38e98971a4e1cd3
Last active August 29, 2015 14:27
The story behind David Baggett’s $700,000,000 sale to Google
Andrew: Hey there, freedom fighters. My name is Andrew Warner. I’m the founder of Mixergy.com, home
of the ambitious upstart. The place where over a thousand of entrepreneurs have come to tell the
stories of how they built their businesses, had challenges along the way, overcame them, or not,
and mostly told you what they learned from it. And thousands and thousands and thousands of other
entrepreneurs have listened and learned, and used what they’ve learned from these interviews.
Today’s guest is David Baggett. He co-founded ITA software, a company that Google bought for a
reported $700 million. ITA makes software that’s the search engine behind sites like Kayak. It
actually figures out prices, time and other data like flights.