Skip to content

Instantly share code, notes, and snippets.

View marknca's full-sized avatar

Mark marknca

View GitHub Profile
@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 / Links.md
Last active December 7, 2017 16:13
AWS re:Invent re:View, 2017 Edition
@marknca
marknca / test-dsm.py
Created September 13, 2018 16:57
Why can't I log into the Deep Security Manager via the API?
import deepsecurity # from https://github.com/deep-security/deep-security-py
import logging
# if testing a tenant login
mgr = deepsecurity.dsm.Manager(username=YOUR_USERNAME, password=YOUR_PASSWORD, tenant=YOUR_TENANT_NAME) # will call the API authenticateTenant
# or
# if testing the primary tenant
mgr = deepsecurity.dsm.Manager(username=YOUR_USERNAME, password=YOUR_PASSWORD) # if "tenant" argument ISN'T sent, it calls a different API call "authenticate"
mgr.log_at_level = logging.DEBUG
mgr.sign_in()
@marknca
marknca / get-certificate-expiry-dates.sh
Created June 18, 2019 13:41
Security focused AWS CLI commands
aws acm list-certificates | jq '.CertificateSummaryList' | jq -r '.[].CertificateArn' | while read -r l; do echo "CERT: $l" && aws acm describe-certificate --certificate-arn $l | jq '.Certificate | .NotAfter' | xargs -I {} date -r {} && echo ""; done;
@marknca
marknca / s02-e01-links.md
Last active March 24, 2020 16:43
#LetsTalkCloud Links
@marknca
marknca / requirements.sh
Created March 25, 2020 18:53
Setup Google Cloud Platform for python on macOS
pip3 install --upgrade google-cloud-bigquery
pip3 install --upgrade google-cloud-bigtable
pip3 install --upgrade google-cloud-datastore
pip3 install --upgrade google-cloud-dns
pip3 install --upgrade google-cloud-error-reporting
pip3 install --upgrade google-cloud-firestore
pip3 install --upgrade google-cloud-language
pip3 install --upgrade google-cloud-logging
pip3 install --upgrade google-cloud-monitoring
pip3 install --upgrade google-cloud-pubsub
@marknca
marknca / user-data.sh
Created June 20, 2020 21:34
cloud-init for Super Feed updates
#! /usr/bin/env bash
sudo yum -y install git
sudo yum -y install python3
sudo pip3 install boto3
sudo pip3 install dateparser
sudo pip3 install feedparser
cat > /home/ec2-user/get_secret.py <<- PY_FILE
# Standard libraries
import base64
@marknca
marknca / README.md
Last active August 26, 2022 18:21
Read multiple RSS feeds and write their entries as Hugo posts

Usage

List your feeds in a tab seperated value text file with the format;

Name of feed\tFEED_URL
Name of feed\tFEED_URL
Name of feed\tFEED_URL