Skip to content

Instantly share code, notes, and snippets.

Avatar

Francisco Hames jrhames

View GitHub Profile
@jrhames
jrhames / failover.sh
Created May 11, 2016 — forked from Apsu/failover.sh
An example failover script for dual WAN, using a ping healthcheck and managing default routes appropriately
View failover.sh
#!/bin/bash
# Set defaults if not provided by environment
CHECK_DELAY=${CHECK_DELAY:-5}
CHECK_IP=${CHECK_IP:-8.8.8.8}
PRIMARY_IF=${PRIMARY_IF:-eth0}
PRIMARY_GW=${PRIMARY_GW:-1.2.3.4}
BACKUP_IF=${BACKUP_IF:-eth1}
BACKUP_GW=${BACKUP_GW:-2.3.4.5}
View patch-edid.rb
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
View patch-edid.rb
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@jrhames
jrhames / moment-holidays.js
Last active Oct 2, 2019
Holidays plugin for Moment.JS
View moment-holidays.js
//## Moment.JS Holiday Plugin
//
//Usage:
// Call .holiday() from any moment object. If date is a US Federal Holiday, name of the holiday will be returned.
// Otherwise, return nothing.
//
// Example:
// `moment('12/25/2013').holiday()` will return "Christmas Day"
//
//Holidays:
@jrhames
jrhames / moovr.py
Created Aug 10, 2010
Moovr reads the movingpictures (a Media Portal Plugin - http://code.google.com/p/moving-pictures/) database and generates a movie list in HTML that you can share with your friends.
View moovr.py
'''
Moovr 0.1
by Jr. Hames
http://github.com/jrhames
DESCRIPTION:
Moovr reads the movingpictures (a Media Portal Plugin - http://code.google.com/p/moving-pictures/) database and generates a movie list in HTML that you can share with your friends.
LICENSE:
This software is distribute under Creative Commons Attribution-Noncommercial-Share Alike 3.0. You can read the entire license on: http://creativecommons.org/licenses/by-nc-sa/3.0/