Skip to content

Instantly share code, notes, and snippets.

View werebus's full-sized avatar

Matt Moretti werebus

  • UMass Transit Services (@umts)
  • Greenfield, MA
View GitHub Profile
#!/usr/bin/env ruby
require 'json'
require 'net/http'
require 'nokogiri'
require 'pry'
module Avail
def self.url(*path_components)
uri_array = ['https://bustracker.pvta.com/InfoPoint'] + path_components
@werebus
werebus / favicon.ico
Last active February 28, 2018 15:08
Masstraveler.com decom splash
@werebus
werebus / config_defaults.rb
Last active August 29, 2015 14:19
Getting knife configuration into chef-dk generator
#<chef_repo>/code_generator/libraries/config_defaults.rb
#Pull in all of the values defined in the `chefdk` context in knife.rb
Chef::Config[:chefdk].configuration.each do |config_key, value|
ChefDK::Generator.context.send("#{config_key}=", value)
end
@werebus
werebus / 00README.md
Last active November 10, 2023 21:38
Script for making our Novatel 551L connect to Verizon

The following are instructions for setting up a Verizon-provided [NovaTel 551L][1] on a Debian-based Linux system. Our target system was an embedded ARM [TS-7800][2], which left us somewhat handicapped when it came to the version of Linux that we were able to use. We were able to install Debian Wheezy (7.7) on this device, but limited to the kernel sources that were provided by the manufacture (2.6.34).

If you have a more modern kernel available to you (>=3.4), look into [libqmi][3] and [ModemManager][4], which use the native QMI protocol to communicate with the modem instead of the AT command hacks featured

@werebus
werebus / spells.sql
Last active August 29, 2015 13:56
Pathfinder spells -> postgres
CREATE TABLE spells (
name varchar(255) unique not null,
school varchar(255),
subschool varchar(255),
descriptor varchar(255),
spell_level varchar(255),
casting_time varchar(255),
components varchar(255),
costly_components boolean,
range varchar(255),
#!/usr/bin/env ruby -w
# brew-services(1) - Easily start and stop formulas via launchctl
# ===============================================================
#
# ## SYNOPSIS
#
# [<sudo>] `brew services` `list`<br>
# [<sudo>] `brew services` `restart` <formula><br>
# [<sudo>] `brew services` `start` <formula> [<plist>]<br>
@werebus
werebus / letter.tex
Created July 11, 2013 00:39
Business letter - basically letter.cls, but with everything left-aligned
\documentclass[12pt]{letter}
\usepackage{fullpage} %1in margins on every page
\longindentation=0pt
\renewcommand*{\opening}[1]{\thispagestyle{empty}%
{\raggedright \fromaddress \\*[2\parskip]%
\today \\*[2\parskip]%
\toname \\ \toaddress \par}%
\vspace{2\parskip}%
@werebus
werebus / memo.tex
Last active December 19, 2015 14:48
Basic Memo LaTeX layout
\documentclass[12pt]{letter}
\usepackage{fullpage} %1in margins on every page
\usepackage{parskip} %no paragraph indents, put a space inbetween instead
\begin{document}
\pagestyle{empty}
\centerline{\Large \bf MEMO}
\bigskip
\begin{description}
\setlength{\itemsep}{0pt}
@werebus
werebus / stops_to_json.rb
Created June 27, 2013 17:24
gtfs 'stops.txt' file to geojson file
require 'json'
require 'csv'
json = { 'type' => 'FeatureCollection',
'crs' => { 'type' => 'name',
'properties' => { 'name' => 'urn:ogc:def:crs:OGC:1.3:CRS84' } },
'features' => []
}
CSV.open('stops.txt', 'r') do |csv|
@werebus
werebus / add-key.rb
Created November 25, 2012 17:59
An example SSH-key-adding class for Github
require 'rubygems'
require 'httparty'
require 'io/console'
class GithubApi
include HTTParty
base_uri 'https://api.github.com'
def initialize(username, password)
@auth = {:username => username, :password => password}