Skip to content

Instantly share code, notes, and snippets.

View fwenzel's full-sized avatar
😈

Fred Wenzel fwenzel

😈
View GitHub Profile
@fwenzel
fwenzel / plex_restart.sh
Created April 26, 2012 03:17
Simple watchdog script to restart plex media server if it becomes unresponsive.
#!/bin/bash
# If plex is not running, don't do anything.
plex_running=`ps ax | grep "\./Plex Media Server" | awk '{ print $1 }' | wc -l`
if [ "$plex_running" -eq 1 ]; then
exit 0
fi
# Test Plex web interface. If it's dead, this'll time out in a few seconds.
curl -I -m 8 "http://localhost:32400/library/sections" > /dev/null 2>&1

Hi!

I'm not currently looking for a job as I'm pretty happy at my current job.

However Mozilla is looking for a recruiting manager in Mountain View. Mozilla also has deep ties in the open source communities and it sounds like it might be an interesting fit for you. <OPTIONAL-ADDITIONAL-TEXT>

If you're interested in applying, check out our careers link:

@fwenzel
fwenzel / install_makemkv.sh
Last active January 21, 2021 14:10
A convenient little script to install MakeMKV on Linux
#!/bin/bash
if [ "$1" == "" ]; then
echo "Usage: $0 1.8.0"
echo "to download and install MakeMKV 1.8.0"
exit 1
fi
# Collect sudo credentials
sudo -v
@fwenzel
fwenzel / cloc.py
Last active December 10, 2015 00:18
A simple script to determine what portions of a web app are HTML/CSS/JS. Uses the tool ``cloc``.
#!/usr/bin/env python
"""This requires Python 2.7. Deal with it."""
import shlex
import sys
import xml.etree.ElementTree as ET
from subprocess import check_output
# Language -> [extension, ...] mapping
@fwenzel
fwenzel / ocr.py
Created January 15, 2014 04:57
A mildly inaccurate OCR function
import itertools; import random
ocr = lambda i: ' '.join(itertools.repeat('POOP', random.randint(0, 100)))
@fwenzel
fwenzel / cordova.js
Created February 19, 2014 17:57
An example cordova.js file, line 1112 might (but won't) violate CSP
// Platform: firefoxos
// 3.3.0
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@fwenzel
fwenzel / cordovasample.sh
Created March 11, 2014 19:19
Script to clone and build Cordova Sample app
#!/bin/sh
## Script to build Cordova Sample app, as described in this blog post:
# https://hacks.mozilla.org/2014/02/building-cordova-apps-for-firefox-os/
# Note, this assumes you have Cordova installed.
# More info: http://cordova.apache.org/
cordova create cordovasample
cd cordovasample
@fwenzel
fwenzel / cordovasample-demo.sh
Created March 11, 2014 19:33
Demo script for cordovasample
#!/bin/sh
## Script to build Cordova Sample app, as described in this blog post:
# https://hacks.mozilla.org/2014/02/building-cordova-apps-for-firefox-os/
# Note, this assumes you have Cordova installed.
# More info: http://cordova.apache.org/
rm -rf cordovasample
@fwenzel
fwenzel / gist:36b655c8f87cf9a7715f
Last active August 29, 2015 14:01
Linode speedtest
130 fred@athena ~ % curl http://speedtest.newark.linode.com/100MB-newark.bin > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
85 100M 85 85.4M 0 0 2433k 0 0:00:42 0:00:35 0:00:07 2380k^C
130 fred@athena ~ % curl http://speedtest.atlanta.linode.com/100MB-atlanta.bin > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
61 100M 61 61.6M 0 0 2396k 0 0:00:42 0:00:26 0:00:16 2258k^C
130 fred@athena ~ % ping speedtest.newark.linode.com
PING speedtest.newark.linode.com (50.116.57.237): 56 data bytes
https://twitter.com/kathleenbot/status/483625820645519361/photo/1
"Easily the best NYT News Alert I've ever gotten"
Picture says: "Supreme Court Ruling in Contraception Case", then underneath:
"The Supreme Court has ruled on whether for-profit corporations may advance claims based on religious freedom."
Then highlighted: "Our reporters are reading the decision and will update this article as soon as they feel confident about its basic meaning."