Skip to content

Instantly share code, notes, and snippets.

lol no

Cameron Tod cam8001

lol no
  • Wellington, New Zealand
View GitHub Profile
glnds / aws-transfer-sftp.yaml
Last active May 10, 2021
CloudFormation template for AWS Transfer for SFTP
View aws-transfer-sftp.yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: some-sftp-server
Type: String
Description: Hosted Zone ID
Type: String
bgulla /
Created Jun 25, 2019
Dumps all images from iMessages.
import os
import shutil
mkdir ~/Desktop/imessage
rootDir = "/Users/${USER}/Library/Messages/Attachments"
destDir = "/Users/${USER}/Desktop/imessage"
IGNORE_STRING = "pluginPayloadAttachment"
for dirName, subdirList, fileList in os.walk(rootDir):
#print("Found directory: %s" % dirName)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
cam8001 / awscli.bash
Created May 6, 2019
awscli quick reference
View awscli.bash
# From here:
#!/bin/bash -ex
export AWS_REGION=your-region-here
export AWS_PROFILE=your-cli-access-profile-here
# Get your user ARN
aws iam get-user --query 'User.Arn'
odessky / ec2-get-security-credentials
Last active Mar 18, 2020 — forked from fgassert/ec2-get-security-credentials
Gets IAM Role Security Credentials from instance metadata and export they in bash session envirovment. Secured edition.
View ec2-get-security-credentials
export-aws () {
# gets iam security credentials from instance metadata and export in envirovment for runtime script
# after script finished credentials is gone away
# system must have awscli&jq preinstalled
# converted to function
# Usage: export-aws ROLENAME

How many ways can we express "::"

Both IPv4 and IPv6 allow for some flexibility in how IP addresses are expressed as strings, but IPv6 really takes it to the max. How many ways can we express the all-zeroes IPv6 address, a.k.a. "::". Let's see.

The obvious


Running count: 1.

olejorgenb / places-exploration.sql
Created Feb 17, 2019
Firefox places.sqlite exploration
View places-exploration.sql
--- Firefox places.sqlite exploration
-- (probably somewhat outdated)
-- [select text -> right click -> search] does not set from_visit :(
--- Magic numbers

Fix for FOUC :

At the top of your HTML:

<!doctype html>
    <style>html{visibility: hidden;opacity:0;}</style>
ConnerAiken / robbyrussell.zsh-theme
Created Mar 20, 2018
ZShell - Robby Russell Theme /w User@Host in prompt
View robbyrussell.zsh-theme
GNU nano 2.5.3 File: /home/connera/.oh-my-zsh/themes/robbyrussell.zsh-theme Modified
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
# Customize and add user/host perfix
PROMPT="%{$fg[white]%}%n@%{$fg[green]%}%m%{$reset_color%} ${PROMPT}"
jflasher /
Created Feb 23, 2018
Accessing data older than 90 days from OpenAQ

Currently, only data within the last 90 days is available via the OpenAQ API. However, there is much more data available on OpenAQ and a variety of different access mechanisms. Note also that there is work under way to bring back to the API a mechanism to access the data older than 90 days, details here.

If you're looking to query across all the data or even easily export the data (or a subset of it), the easiest way to do that currently is using a service like Amazon Athena. I'll provide some directions on how to do that below, but at a high level, this will let you make any query of the entire dataset that you'd like (written in SQL). I'll also provide some sample queries so you can see what's possible.

On to the directions!

  1. You will need to create an AWS account if you don't currently have one, you can start this process at htt