Skip to content

Instantly share code, notes, and snippets.

View tfolbrecht's full-sized avatar
🤠
New boot goofin

tfolbrecht

🤠
New boot goofin
View GitHub Profile
#cloud-config
manage-resolv-conf: true
resolv_conf:
nameservers:
- '8.8.8.8'
- '8.8.4.4'
groups:
- ubuntu: [root,sys]
- docker
tom@desktop:/dev$ sudo v4l2-ctl --device=/dev/video0 --all
Driver Info:
Driver name : uvcvideo
Card type : Rift S Sensor: Rift S Sensor
Bus info : usb-0000:00:14.0-2.1
Driver version : 5.11.22
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
@tfolbrecht
tfolbrecht / pygmentize and server from bash
Created January 29, 2020 21:45
make code pretty, display in html
pygmentize -O full,style=emacs -o index.html hello.py
python3 -m http.server 8080
@tfolbrecht
tfolbrecht / ec2seppuku
Last active January 27, 2020 22:39
Self Terminate EC2
#!/bin/bash
# *WARNING* This is a fragile solution, if the bash script fails, hangs, etc, the shutdown won't execute.
# Set am asynchronous kill job above the execution of this script with a sensible timeout
# example bash ec2seppuku.sh & sleep 60 && shutdown -h now
# Also set up aws logging, and clean up your aws env periodically just in case
# ¯\_(ツ)_/¯
# launch with --instance-initiated-shutdown-behavior terminate so it cleans up
if command; then
@tfolbrecht
tfolbrecht / git-understanding-qs.md
Last active January 24, 2020 21:06 — forked from githubteacher/git-understanding-qs.md
Questions to check your understanding of some Git and GitHub concepts.

Beginner: Check for understanding

  1. (multiple answer) Git is:

    • a. A version control system
    • b. Centralized
    • c. Distributed
    • d. The same as GitHub
  2. (T/F) Git and GitHub are the same thing.

  • False
@tfolbrecht
tfolbrecht / awsprompt.sh
Created December 1, 2019 23:23
AWS Bash Prompt with username and response encoding
#!/bin/bash
user=$(cat $AWS_SHARED_CREDENTIALS_FILE | grep -o 'aws_access_key_id[^,]*' | cut -d " " -f 3)
encoding=$(cat $AWS_CONFIG_FILE | grep -o 'output[^,]*' | cut -d " " -f 3)
function EXT_COLOR () { echo -ne "\[\033[38;5;$1m\]"; }
# Color, AWS User key ID, Response format, file path
PS1="\[\e[1;33m\][$user:$encoding \w]$ \e[m\]"
@tfolbrecht
tfolbrecht / blur_faces.py
Created June 10, 2019 04:28 — forked from mcdickenson/blur_faces.py
Blur faces in imagery with Google Cloud Vision
import cv2
import io
import json
import numpy as np
import os
from google.cloud import vision
from PIL import Image, ImageDraw
from StringIO import StringIO
@tfolbrecht
tfolbrecht / journal3.md
Created May 10, 2019 19:32
Week 3 Journal Entry

Day 1:

Day 2:

Day 3:

Day 4:

Day 5:

@tfolbrecht
tfolbrecht / gist:38409136e7ec839c996113e848ac47f3
Last active May 3, 2019 03:42
Omega Karmas first bash script!
#!/bin/bash
##bin/bash specifies what shell you’re using to carry out the script
echo "Welcome To Kruzi's Calculator"
echo "Operations:"
echo "| To Add Press 1 | To Subtract Press 2 | To Multiply Press 3 | To Divide Press 4 |"
##these echo commands are used to display information from the script to the user via the Terminal Line
read oper
##the read command waits for input from the user
#!/bin/bash
# Note, you have to have github over ssh configured
# has to be a git@github link
# you have to generate an api key token with the right to fork & add collaborators
# token gen link: https://github.com/settings/tokens
######
# Variables!
user=""