Skip to content

Instantly share code, notes, and snippets.

from aws_cdk import (
aws_route53 as route53,
aws_route53_targets as targets,
aws_cloudfront as cloudfront,
aws_cloudfront_origins as origins,
aws_certificatemanager as certificatemanager,
Stack
)
from constructs import Construct
@mrowe
mrowe / folder-sizer.gs
Created July 27, 2022 09:54
Get the total size of a folder in Google Drive
// adapted from https://webapps.stackexchange.com/a/123681
function doCount() {
var FOLDER_ID = "<folder_id>";
Logger.log("Getting folder sizes...");
var totalSize = countFolder(DriveApp.getFolderById(FOLDER_ID), "/");
Logger.log("Folder Sizes Report completed");
Logger.log(Utilities.formatString("TOTAL SIZE: %12.2f MB", (totalSize / (1024 * 1024))));
@mrowe
mrowe / better-annotated.s
Last active October 16, 2021 00:20
clang compiled to ARM assembler
.section __TEXT,__text,regular,pure_instructions
.build_version macos, 11, 0 sdk_version 11, 3
.globl _main ; -- Begin function main
.p2align 2
_main: ; @main
Lfunc_begin0:
.file 1 "/Users/mrowe/src" "better.c"
.loc 1 4 0 ; better.c:4:0
.cfi_startproc
; %bb.0:
@mrowe
mrowe / harvard-deakin-university-2020.csl
Last active October 2, 2021 07:18
Zotero style definition for the 2020 version Deakin Australian Harvard (incomplete)
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB">
<info>
<title>Deakin University - Harvard 2020</title>
<id>http://www.zotero.org/styles/harvard-deakin-university-2020</id>
<link href="http://www.zotero.org/styles/harvard-deakin-university" rel="self"/>
<link href="http://www.zotero.org/styles/harvard-the-university-of-melbourne" rel="template"/>
<link href="http://www.deakin.edu.au/students/studying/study-support/referencing/harvard" rel="documentation"/>
<author>
<name>simtyrell</name>
@mrowe
mrowe / debug.md
Created May 17, 2020 01:07
Debugging weird prod problem

We were in the final push towards a major release of a large public-facing J2EE application when I was assigned The Defect. The application, which had been working quite well in functional test environments (all things considered), suddenly stopped when deployed to SIT. Well, it started up ok, but if you tried to log in, you were faced with a long wait. Very long.

It was exactly the same code that had been working in other environments, but the difference in SIT, of course, was that debug logging was turned off.

After a day of changing logging levels, bouncing WebSphere servers and tracing debug logging code, I stumbled across this gem:

    Iterator i = formBean.getKeys();
    while (i.hasNext()) {
 if (LOG.isDebugEnabled()) {
Title Notes Username Password URL Type
AirBNB p4ssw0rd Password
Airbnb user p4ssw0rd https://login.airbnb.com Login
PayPal user p4ssw0rd https://www.paypal.com Login
Bendigo Bank user p4ssw0rd Login
Quantium PSeeker Replica (read only) quantium p4ssw0rd Database
irc mrowe p4ssw0rd Server
Disney user p4ssw0rd Login
Zoho user p4ssw0rd https://accounts.zoho.com Login
Bookbaby user p4ssw0rd https://www.bookbaby.com/myaccount/login.aspx Login
@mrowe
mrowe / .xmobarrc
Created June 10, 2017 00:52
Xmonad/Xmobar config
Config { font = "-misc-fixed-*-*-*-*-12-*-*-*-*-*-*-*"
, borderColor = "black"
, border = TopB
, bgColor = "black"
, fgColor = "grey"
, alpha = 255
, position = TopW L 100
, allDesktops = True
, overrideRedirect = True
, commands = [
@mrowe
mrowe / garmin-restore.sh
Last active May 7, 2017 22:13
Restore my Garmin Edge 510 from a local backup
#!/bin/bash
set -e
DISK="disk2"
VOLUME="GARMIN"
BACKUP="${HOME}/Desktop/Garmin"
FILELIST="Sports/*.fit Settings/Settings.fit Device.fit"
@mrowe
mrowe / unused-security-groups.rb
Last active August 29, 2015 14:14
Find unused security groups
#!/usr/bin/env ruby
require 'aws-sdk'
ec2 = AWS::EC2.new
elb = AWS::ELB.new
rds = AWS::RDS.new.client # shrug
security_groups = ec2.security_groups.map { |sg| sg.id }.sort
instance_sgs = ec2.instances.map { |i| i.security_groups.map { |sg| sg.id } }.flatten.sort
@mrowe
mrowe / robots.java
Last active August 29, 2015 14:13
Toy Robot in Java 7
package com.mikerowecode.robot;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Robots {
public static void main(String[] args) {
Robot robot = new Robot(-1, -1, Direction.WEST);