Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Moretti werebus

  • UMass Transit Services (@umts)
  • Amherst, MA
View GitHub Profile
View kml-check.rb
#!/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 Feb 28, 2018
Masstraveler.com decom splash
@werebus
werebus / config_defaults.rb
Last active Aug 29, 2015
Getting knife configuration into chef-dk generator
View config_defaults.rb
#<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 Aug 29, 2015
Script for making our Novatel 551L connect to Verizon
View 00README.md

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 Aug 29, 2015
Pathfinder spells -> postgres
View spells.sql
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),
View brew-services.rb
#!/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 Jul 11, 2013
Business letter - basically letter.cls, but with everything left-aligned
View letter.tex
\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 Dec 19, 2015
Basic Memo LaTeX layout
View memo.tex
\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 Jun 27, 2013
gtfs 'stops.txt' file to geojson file
View stops_to_json.rb
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 Nov 25, 2012
An example SSH-key-adding class for Github
View add-key.rb
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}