Skip to content

Instantly share code, notes, and snippets.

View kylejohnson's full-sized avatar

Kyle Johnson kylejohnson

View GitHub Profile
<Hashie::Mash data=[#<Hashie::Mash apparentTemperatureMax=38.19 apparentTemperatureMaxTime=1391194800 apparentTemperatureMin=19.51 apparentTemperatureMinTime=1391144400 cloudCover=0.71 dewPoint=20.89 humidity=0.68 icon="partly-cloudy-day" moonPhase=0.04 ozone=269.72 precipIntensity=0 precipIntensityMax=0 precipProbability=0 pressure=1022.02 summary="Mostly cloudy throughout the day." sunriseTime=1391170534 sunsetTime=1391207208 temperatureMax=40.43 temperatureMaxTime=1391194800 temperatureMin=19.51 temperatureMinTime=1391144400 time=1391144400 visibility=9.95 windBearing=212 windSpeed=1.68>, #<Hashie::Mash apparentTemperatureMax=36.43 apparentTemperatureMaxTime=1391284800 apparentTemperatureMin=28.03 apparentTemperatureMinTime=1391310000 cloudCover=0.82 dewPoint=31.11 humidity=0.86 icon="partly-cloudy-day" moonPhase=0.07 ozone=273.71 precipIntensity=0.0001 precipIntensityMax=0.0008 precipIntensityMaxTime=1391313600 precipProbability=0.02 precipType="rain" pressure=1022.74 summary="Mostly cloudy throughout the
@kylejohnson
kylejohnson / gist:9665992
Created March 20, 2014 15:12
fpm example
fpm \
--vendor ZoneMinder \
--maintainer iconnor@you.com \
--url https://github.com/ZoneMinder/ZoneMinder \
--depends package1 package2 \
--description 'ZoneMinder Description' \
-n ZoneMinder \
-s dir \
-t deb \
--before-remove /root/ZoneMinder/devops/prerm \
[root@freenas] ~# zpool list bak
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
bak 2.72T 728G 2.01T 26% 1.00x ONLINE -
@kylejohnson
kylejohnson / .Xdefaults
Created April 8, 2014 22:38
To fix arch linux copy / paste
xterm*selectToClipboard: true
@kylejohnson
kylejohnson / spec.md
Last active August 29, 2015 13:59
ZoneMinder API spec

Overview

Requirements

  1. Dump data in json or xml
  2. CRUD for Monitors and Events
  3. Set the Function of monitors
  4. Get the Status of monitors
root@ip-10-230-44-163:/opt/voltdb/bin# ./voltdb
ERROR: Failed to find the VoltDB jar file.
ERROR: You may need to perform a build.
ERROR: Searched the following:
ERROR: /opt/voltdb/bin/voltdb/voltdb-*.jar
ERROR: /opt/voltdb/bin/lib/voltdb/voltdb-*.jar
ERROR: /opt/voltdb/voltdb/voltdb-*.jar
ERROR: /opt/voltdb/lib/voltdb/voltdb-*.jar
ERROR: /opt/voltdb/voltdb-*.jar
ERROR: /opt/lib/voltdb/voltdb-*.jar
public function categories($category = null) {
if ($category != null) {
if (!$this->Config->find('first', array( 'conditions' => array('Config.Category' => $category)))) {
throw new NotFoundException(__('Invalid Config Category'));
}
$config = $this->Config->find('all', array(
'conditions' => array('Config.Category' => $category),
'recursive' => 0
));
@kylejohnson
kylejohnson / pf.conf
Created October 14, 2014 01:02
My pf.conf on OpenBSD 5.4 to allow a NAT Type that is not strict. Open is ideal but I'll take Moderate.
int_if="fxp0"
ext_if="vr0"
camera_fd="192.168.11.20"
xbox_live_tcp_ports = "{ 53, 80, 3074 }"
xbox_live_udp_ports = "{ 53, 88, 500, 3074, 3544, 4500, 8083, 1780, 49164 }"
xbox = "192.168.11.5"
# options
set block-policy return
set loginterface egress
git clone git@github.com:ZoneMinder/ZoneMinder.git
cd ZoneMinder
git checkout -b api-updates
git fetch git@github.com:kylejohnson/ZoneMinder.git hipster-web-frontend
git checkout master
git cherry-pick 123
git cherry-pick 456
...
git push origin master
curl -XPOST http://zmdevapi/monitors.js -d "Monitor[Name]=Cliff-Burton \&Monitor[Function]=Modect \ &Monitor[Protocol]=http \ &Monitor[Method]=simple \&Monitor[Host]=ussr:pass@192.168.11.20 \ &Monitor[Port]=80 \ &Monitor[Path]=/mjpg/video.mjpg\ &Monitor[Width]=704 \ &Monitor[Height]=480 \ &Monitor[Colours]=4”