Skip to content

Instantly share code, notes, and snippets.

View marknca's full-sized avatar

Mark marknca

View GitHub Profile
@marknca
marknca / Links.md
Last active December 7, 2017 16:13
AWS re:Invent re:View, 2017 Edition
@marknca
marknca / summary.md
Last active March 9, 2017 17:17
Annual cost of time wasted waiting for City of Ottawa recreation registration

After scraping the 2016/2017 recreation guides for all availablesession codes, the following assumptions were made;

  • sessions average 10 spaces
  • 35% of all sessions are booked in the initial rush period on registration nights (4x per year)
  • 3 spaces are taken for each person waiting to register
  • average wait time is 35 minutes
  • average hourly wage is $26.57 (based on median household income of $102,020 and 2 wage earners in the household)

Therefore we get...

@marknca
marknca / yahoo-sites.md
Last active September 24, 2016 12:12
List of Sites Run by Yahoo!
@marknca
marknca / manage_access_and_secret_keys_in_iam.json
Created September 6, 2016 17:29
Allow an IAM AWS user to manage other AWS IAM user's access/secret keys
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:ListUsers",
"iam:CreateAccessKey",
"iam:DeleteAccessKey",
"iam:GetAccessKeyLastUsed",
@marknca
marknca / create-iam-cloudaccount.sh
Created August 31, 2016 14:28
Automate connecting Deep Security to an AWS account
#!/bin/bash
# create-iam-cloudaccount dsmuser dsmFQDNorIP connectorName newAwsUserToCreate (TenantID if needed)
if [[ $1 == *"help"* ]]
then
echo -e "## usage:\n## create-iam-cloudaccount <managerUsername> <managerUrl:port> Amazon <newAwsUserToCreate>\n"
echo -e "## example to create User and Cloud account on a DeepSecurity Manager:\n"
echo -e "## create-iam-cloudaccount administrator dsm.example.local:443 Amazon DsmSyncUser"
echo -e "## example to create User and Cloud account in DSaaS\n"
echo -e "## create-iam-cloudaccount administrator app.deepsecurity.trendmicro.com:443 DsmSyncUser CustomerTenant\n"
exit 0
@marknca
marknca / get_current_aws_endpoints.py
Created July 26, 2016 23:58
Get a list of AWS API endpoint domains
#! /usr/bin/env python
# standard library
import re
import sys
# 3rd party imports
from bs4 import BeautifulSoup
import requests
@marknca
marknca / send_to_slack.py
Last active October 22, 2019 12:56
Send Deep Security events to Slack via Amazon SNS and AWS Lambda
# Written in Python 3.x
# in AWS Lambda, set:
# - the runtime to Python 3.x
# - the handler to: lambda_function.lambda_handler
# in Deep Security output the events to a valid SNS topic
# - more at https://help.deepsecurity.trendmicro.com/sns.html?Highlight=sns
# connect the AWS Lambda function to the SNS topic via a trigger
# - more at https://help.deepsecurity.trendmicro.com/sns.html?Highlight=sns
# - or do it via the AWS Lambda Management Console on the web (much, much simpler)
#
@marknca
marknca / install-build-env.sh
Last active January 14, 2016 05:43
Python extension build environment for AWS Lambda
#! /usr/bin/env bash
# Install the required libraries for a Python build environment on Amazon Linux
# Note, you only really need lines #6 & 7, the rest of the lines install
# pre-requisities for the SciPy stack
yum -y update
yum -y groupinstall "Development Tools"
yum -y install Cython --enablerepo=epel
@marknca
marknca / setup_opengraphiti_mac.sh
Last active November 28, 2016 17:53
Setup the OpenGraphiti project on a Mac
#! /usr/bin/env bash
# Setup a new Mac
DEVPATH="$HOME/dev/"
# Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
brew update