Skip to content

Instantly share code, notes, and snippets.

View travis-g's full-sized avatar
🎲
rolling dice

Travis Grammer travis-g

🎲
rolling dice
View GitHub Profile
@travis-g
travis-g / randomizer.coffee
Created December 30, 2021 01:36
Fallout 4 Challenge Run Generator
@this = "Fallout 4 Challenge Run Generator"
@me = "/u/travis-g"
@license = "WTFPL2, but I'd love a mention"
@about = """
#{@this}
Made by #{@me}
Started as just the trash() function, but it got bigger when I thought of a
use for it. I've put hundreds of hours into Skyrim and Fallout games just by
running character/challenge builds. I've never finished the main questlines.
from PIL import Image
import json
import requests
h = 1000
w = 1000
# PIL accesses images in Cartesian co-ordinates, so it is Image[columns, rows]
img = Image.new( 'RGB', (h,w), "black") # create a new black image
pixels = img.load() # create the pixel map
@travis-g
travis-g / main.tf
Created February 15, 2020 02:46
Boilerplate Terraform S3 backend code
terraform {
backend "s3" {
bucket = ""
region = "us-east-1"
encrypt = true
acl = "private"
key = ""
}
}
digraph G {
rankdir=LR;
subgraph cluster_vault {
label = "Vault (Meta Storage Backend)";
style=filled
color=lightgrey
node [style=filled,color=white]
"ipfs/ipfs-docs" [style=dashed color=normal]
@travis-g
travis-g / data2hist.py
Last active November 9, 2019 21:21
Converts data from stdin to histogram bins
#!/usr/bin/env python3
import sys
import argparse
import datetime
import numpy as np
import pandas as pd
parser = argparse.ArgumentParser()
parser.add_argument("--log", help="logarithmically scale results", action="store_true")
parser.add_argument("-s", "--size", help="number of bins", action="count", default=40)
@travis-g
travis-g / ffmpeg.md
Last active January 26, 2019 05:28
ffmpeg Conversions
#!/bin/bash
TYPE=${1:-no type provided}

for FILE in $(ls *.${TYPE} | tr -d "'")
do
    # Get 0-based index of English subtitle stream
    INDEX=$(($(ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 $FILE | sed -n '/eng/=')-1))
    # Convert
    ffmpeg -y \
@travis-g
travis-g / ncmpcpp.md
Created January 6, 2019 04:06
Cheat Sheet for ncmpcpp

ncmpcpp Cheat Sheet

Movement

  • Up k - Move cursor up
  • Down j - Move cursor down
  • [ - Move cursor up one album
  • ] - Move cursor down one album
  • { - Move cursor up one artist
  • } - Move cursor down one artist
@travis-g
travis-g / spider.sh
Created October 30, 2018 15:12
recursive wget to check sites for broken links/dependencies
#!/bin/bash
if [A "$2" -eq "-v" ]; then
wget --recurive --delete-after "$1"
else
wget \
--spider \
--recursive \
--delete-after \
--level inf \
--no-directories \
@travis-g
travis-g / docker-clean.sh
Created October 8, 2018 16:40
Docker cleanup script
#!/usr/bin/env sh
# Removes stopped containers and dangling/untagged images.
# 0 0 * * * docker-clean.sh
docker rm $(docker ps -a -q)
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
@travis-g
travis-g / coffee.txt
Created October 7, 2018 04:09
/tmp/coffee
(
)
_.-~(~-.
(@\`---'/.
(' `.-.' `)
`-..___..-'