Skip to content

Instantly share code, notes, and snippets.

View aetherical's full-sized avatar

Matt Kelly Williams aetherical

View GitHub Profile
@MikeFal
MikeFal / Set-Ubuntu-SolarizedDark.ps1
Created June 19, 2019 17:11
Setting Ubuntu Terminal to solarized light/dark
## Original Script Credit: Drew Furgiuele @pittfurg
## https://port1433.com/2019/06/17/using-the-windows-subsystem-for-linux/
## Color mapping found here: https://github.com/neilpa/cmd-colors-solarized
## Get the current installed console values
$consoleName = (get-childitem -path Registry::HKEY_CURRENT_USER\Console | Where-Object {$_.Name -like "*ubuntu*"}).pschildname
##Next, go out and get the current console item from the current user registry
Push-Location HKCU:\Console
$console = Get-ItemProperty -PATH ("Registry::HKEY_CURRENT_USER\Console\" + $consolename)
@kicktraq
kicktraq / paidAmount.js
Last active April 14, 2019 02:22
Ever wonder how much you've spent on KS? Yeah, don't do this on purpose if you are a KS addict.
// login, and visit this page: https://www.kickstarter.com/profile/backings
// keep clicking "show more pledges" in the "successfully pledged" section until the button disappears
// paste the following in your console
// build a quick and dirty currency echange index
var exchangeArray = {
"$": 1,
"£": 1.31,
"€": 1.17,
@marksharrison
marksharrison / Simple YAML Editor
Created August 18, 2016 13:57
Simple in browser YAML editor that extends "data:text/html,<html contenteditable>".
data:text/html,<style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.5/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/twilight");e.getSession().setMode("ace/mode/yaml");e.setFontSize("20");e.focus();</script>
@gbaman
gbaman / HowToOTGFast.md
Last active September 22, 2024 10:51
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@gene1wood
gene1wood / mozilla_cloudtrail_investigation_method.txt
Created March 30, 2016 18:11
Notes on how to investigate incidents in CloudTrail logs
# First launch a centos7 ec2 instance in infosec-prod with an IAM role granting lots of stuff
yum install epel-release
yum install python-pip
pip install awscli
# create aws_assume_role https://gist.github.com/gene1wood/34b02fa3091e184e1997
. aws_assume_role arn:aws:iam::088944123687:role/CloudTrail-Global-Log-Consumers
account_id=123456789012
aaws s3 cp s3://mozilla-cloudtrail-logs/AWSLogs/$account_id/CloudTrail/us-east-1/ ./ --recursive
aaws s3 cp s3://mozilla-cloudtrail-logs/AWSLogs/$account_id/CloudTrail/us-west-2/ ./ --recursive
@gene1wood
gene1wood / cloudtrail_search.py
Created March 30, 2016 18:08
Example search script to look through CloudTrail files to either compress each record into a single line, search for calls from certain networks, or search for specific api actions
#!/usr/bin/env python
import sys
import json
import gzip
# sudo pip install py2-ipaddress
from ipaddress import IPv4Address, IPv4Network
ips = []
@gene1wood
gene1wood / aws_assume_role
Last active May 17, 2022 16:40
Workaround AWS CLI lack of support for IAM assume-role
#!/bin/bash
usage () {
cat <<DOCUMENTATIONXX
Usage : . $0 ROLE_ARN [PARENT_PROFILE_NAME]
^--- Note that this script must be sourced not executed
This tool will generate temporary credentials for an assumed role, save
those ephemeral credentials in the awscli config and set the alias of
"aaws" to use this new ephemeral awscli profile
@gbaman
gbaman / HowToOTG.md
Last active September 16, 2024 09:47
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@gene1wood
gene1wood / all_aws_lambda_modules_python.md
Last active September 19, 2024 23:44
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7
@juliandunn
juliandunn / evolving-from-founder-to-great-ceo.md
Last active August 21, 2024 20:57
Talk at SXSWi by Joel Trammell.

Evolving from founder to great CEO

Joel Trammell, ex-CEO of NetQOS

theamericanceo.com

CEO: command, management, leadership

  • management is power granted by your position
  • leadership is power granted freely because of a follower’s perception of your credibility, competence and caring.