Skip to content

Instantly share code, notes, and snippets.

View marknca's full-sized avatar

Mark marknca

View GitHub Profile
@marknca
marknca / remove-opsworks-security-groups.sh
Last active March 27, 2023 15:29
Remove OpsWorks security groups from a given region
#! /usr/bin/env bash
# Remove OpsWorks security groups from the given region
# Available regions:
# ====================
# ap-northeast-1 => Asia Pacific (Tokyo) Region
# ap-southeast-1 => Asia Pacific (Singapore) Region
# ap-southeast-2 => Asia Pacific (Sydney) Region
# eu-west-1 => EU (Ireland) Region
@marknca
marknca / santa.py
Last active December 11, 2020 22:07
A quick Secret Santa generator. You can specify restrictions (e.g., don't let Larry draw Jen's name). Set the three TODO sections (line 14, line 17, and line 74) before running the script.
#! /usr/bin/env python
# Usage
# ===============================
# test run
# ./santa.py --test
#
# game time
# ./santa.py --password EMAIL
#
@marknca
marknca / .bash_profile
Last active July 7, 2018 12:05
Mac bash personal configuration
# Config var
USERNAME=__CHANGE_THIS__
# Path
export PATH=$PATH:/Users/$USERNAME/bin:/usr/local/go/bin:/usr/local/bin:$PATH
# Env
export EDITOR=subl
# Prompt
@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
@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 / 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 / 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 / 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 / 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 / yahoo-sites.md
Last active September 24, 2016 12:12
List of Sites Run by Yahoo!