Skip to content

Instantly share code, notes, and snippets.

View terraboops's full-sized avatar
sparkle boops

Terra Tauri terraboops

sparkle boops
View GitHub Profile
@terraboops
terraboops / phish.js
Created November 1, 2022 05:59
knowbe4 google script
// Update the email address below
// Schedule to run every 30 minutes at https://script.google.com/
function phish() {
const threads = GmailApp.search("newer_than:30m");
const totalSpammed = 0;
threads.forEach((thread) => {
thread.getMessages().forEach((message) => {
if(message.getHeader("X-PHISHTEST") !== "") {
thread.moveToSpam();
totalSpammed++;
@terraboops
terraboops / main.tf
Created July 10, 2019 16:27
Terraform module for iam policy docco to block non-VPC access
data "aws_iam_policy_document" "s3_bucket_policy" {
statement {
condition {
test = "StringNotEquals"
variable = "aws:sourceVpc"
values = [
"${var.vpc_id}",
]
}
@terraboops
terraboops / README.md
Created May 1, 2019 00:36
Using code-forensics to get insights on a codebase

Intro

This is a brief description of how to get insights on a codebase using code-forensics.

For more information - please see the repo here: https://github.com/smontanari/code-forensics

Dependencies

  • Node.js v11.x or greater installed
  • gulp installed (npm install -g gulp)
@terraboops
terraboops / random.py
Created January 30, 2017 05:30
Randomly find a number which satisfies Luhn's algorithm
#!/usr/bin/env python
import random
def digits_of(number):
return [int(i) for i in str(number)]
def luhn_checksum(card_number):
digits = digits_of(card_number)
odd_digits = digits[-1::-2]
even_digits = digits[-2::-2]
@terraboops
terraboops / random.sh
Created January 30, 2017 05:01
Generates music from entropy
cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,2,4,5,7,9,11,12",a,","); for (i = 0; i < 1; i+= 0.0001) printf("%08X\n", 100*sin(42*exp((a[$1 % 8]/6)*log(2))*i)) }' | xxd -r -p | sox -traw -r 44100 -e unsigned -b 32 -c 2 - -d
@terraboops
terraboops / build.sh
Last active June 14, 2016 14:22
Generate Static HTML from a WP site
#!/bin/bash
echo "START"
OUTPUT_DIR="$1"
# Validate Output Dir
if [ -z "${OUTPUT_DIR}" ]; then
echo "OUTPUT_DIR is unset: [${OUTPUT_DIR}]"
exit 1
fi
@terraboops
terraboops / README.md
Last active April 27, 2022 10:35
Fullscreen Widget for the Dashing dashboard from Shopify

Include in your dashboard like this:

<div data-id="fullscreen" data-view="Fullscreen"></div>

It doesn't even need to be part of the grid, Dashing will happily initialise it anywhere on your page. It is invisible.

Once added to your page, Hit 'f' to enter fullscreen.

@terraboops
terraboops / Gemfile
Last active May 27, 2020 21:02
Simple Mechanize Scraper
source 'https://rubygems.org'
gem 'mechanize'
@terraboops
terraboops / last-git-branch-update.sh
Last active December 18, 2015 22:09
List all branches and date of latest commit for a repo. Great for coordinating restoration of distributed backups after git remote data loss.
git for-each-ref --shell --format='echo ${PWD##*/} - %(refname); git show --format="%ci %cr" %(refname) | head -n 1' refs/heads/ | bash
@terraboops
terraboops / .bash_profile
Created February 27, 2013 18:28
Bash Alias - Ignore SSL for Git command
alias nossl="env GIT_SSL_NO_VERIFY=true"