Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
lol no

Cameron Tod cam8001

💭
lol no
  • Wellington, New Zealand
View GitHub Profile
@glnds
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
Parameters:
HostedZoneIdParam:
Type: String
Description: Hosted Zone ID
SFTPHostnameParam:
Type: String
@bgulla
bgulla / imessage_dump.py
Created Jun 25, 2019
Dumps all images from iMessages.
View imessage_dump.py
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)
View TREMA-UNH-CAR-N.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cam8001
cam8001 / awscli.bash
Created May 6, 2019
awscli quick reference
View awscli.bash
# From here:
# https://blog.ashiny.cloud/page/awscli-query-quickref/
#!/bin/bash -ex
export AWS_REGION=your-region-here
export AWS_PROFILE=your-cli-access-profile-here
export AWS_DEFAULT_OUTPUT=text
# Get your user ARN
aws iam get-user --query 'User.Arn'
@odessky
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
#!/bin/bash
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
View IPV6-all-zeroes.md

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
olejorgenb / places-exploration.sql
Created Feb 17, 2019
Firefox places.sqlite exploration
View places-exploration.sql
--- Firefox places.sqlite exploration
-- https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Places/Database
-- https://wiki.mozilla.org/images/d/d5/Places.sqlite.schema3.pdf
-- http://forensicswiki.org/wiki/Mozilla_Firefox_3_History_File_Format (probably somewhat outdated)
-- [select text -> right click -> search] does not set from_visit :(
--- Magic numbers
View FOUC-fix.md

Fix for FOUC :

At the top of your HTML:

<!doctype html>
<html>
<head>
    <style>html{visibility: hidden;opacity:0;}</style>
@ConnerAiken
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}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
@jflasher
jflasher / details.md
Created Feb 23, 2018
Accessing data older than 90 days from OpenAQ
View details.md

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