Skip to content

Instantly share code, notes, and snippets.

View chris-erickson's full-sized avatar

Chris Erickson chris-erickson

View GitHub Profile
@chris-erickson
chris-erickson / network_status.sh
Created July 31, 2016 18:21
This just prints the ethernet link status to the console every 1 second
#! /bin/bash
while :
do
# Update the interface as needed
ifconfig en9 | grep media | tr -d '\t'
# Update the delay as needed (seconds)
sleep 1
done
@chris-erickson
chris-erickson / load_users_in_django.py
Created November 23, 2016 15:01
A really hacky way to load a bunch of users through the shell instead of writing something more complicated.
# This is just a really hacky way to load a bunch of users through the shell instead of writing something more complicated.
# Intructions: Paste it in line by line!
names = [
["FirstName", "LastName", "something@email.com", "username", "a-password-here"],
["FirstName", "LastName", "something@email.com", "username", "a-password-here"],
]
FNAME = 0
LNAME = 1
EMAIL = 2
@chris-erickson
chris-erickson / check_ssl_cert_validity.sh
Created November 28, 2016 04:49
Checks a domain for SSL cert validity
#!/bin/sh
# Original source: http://superuser.com/a/620188/561192
# A few modifications to send an email and potentially account for running on linux
DEBUG=false
warning_days=29 # Number of days to warn about soon-to-expire certs
certs_to_check='google.com:443
www.apple.com:443'
@chris-erickson
chris-erickson / concatenate.sh
Created January 3, 2017 02:48
Merge (concatenate) multiple media files that share the same codecs
# Update the extensions to match whatever you are starting with
# It isn't critical, but makes things work properly
for f in *.mp4; do echo "file '$f'" >> mylist.txt; done
ffmpeg -f concat -i mylist.txt -c copy output.mp4
@chris-erickson
chris-erickson / filter.re
Created January 13, 2017 19:07
Block CSP warnings in Chrome, helpful for working with a site that is reporting, but not enforcing errors
^((?!Report).)*$
@chris-erickson
chris-erickson / ripitgood.sh
Last active January 16, 2017 03:29
Use youtube-dl to rip the highest quality video and audio
youtube-dl https://www.youtube.com/watch?v=udrKnXueTW0 -F
#[youtube] udrKnXueTW0: Downloading webpage
#[youtube] udrKnXueTW0: Downloading video info webpage
#[youtube] udrKnXueTW0: Extracting video information
#[youtube] udrKnXueTW0: Downloading MPD manifest
#[info] Available formats for udrKnXueTW0:
#format code extension resolution note
#249 webm audio only DASH audio 55k , opus @ 50k (48000Hz), 19.80MiB
#250 webm audio only DASH audio 76k , opus @ 70k (48000Hz), 24.55MiB
#171 webm audio only DASH audio 84k , vorbis@128k (44100Hz), 30.21MiB
@chris-erickson
chris-erickson / transcode_br_rip.sh
Created March 12, 2017 20:03
Start from a Blu-ray rip (mkv format, out of MakeMKV) and properly convert to a nice mkv
# Start by importing with MakeMKV
# Make sure to at least pick the "forced" subtitles - these are usually helpful ones for us dummies who don't speak more than one language
# Subtitles are weird and need to be burned in, so you have to later select them, and only picking the one you need makes this easier.
# Update the tools
gem update video_transcoding
brew upgrade
# Get the command by checking for cropping first
detect-crop <filename>