Skip to content

Instantly share code, notes, and snippets.

View kylejohnson's full-sized avatar

Kyle Johnson kylejohnson

View GitHub Profile
@kylejohnson
kylejohnson / README.md
Last active December 6, 2018 21:22
pianobar widget for Dashing.

Preview

Pianobar Widget Preview

Description

Displays the currently playing song from pianobar, a CLI client for pandora.com

Dependencies

Your system ruby must have the following gems installed: net/http, json and uri.

@kylejohnson
kylejohnson / gist:9665992
Created March 20, 2014 15:12
fpm example
fpm \
--vendor ZoneMinder \
--maintainer [email protected] \
--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 [email protected]:ZoneMinder/ZoneMinder.git
cd ZoneMinder
git checkout -b api-updates
git fetch [email protected]:kylejohnson/ZoneMinder.git hipster-web-frontend
git checkout master
git cherry-pick 123
git cherry-pick 456
...
git push origin master
@kylejohnson
kylejohnson / gist:b869eef9d540aa21fe16
Last active February 2, 2016 15:26
ZoneMinder Ubuntu 14.10 Build Commands
sudo apt-get install apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm subversion automake autoconf libjpeg-turbo8-dev libjpeg-turbo8 apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev libmp4v2-dev wget git-core mysql-client cmake build-essential libpolkit-backend-1-dev libcurl3 libavfilter-dev libavformat-dev libavutil-dev libswscale-dev libavformat-dev libavutil-dev libavdevice-dev libcurl4-gnutls-dev libgnutls-dev
cmake -DZM_WEBDIR=/var/www/zm -DZM_CGIDIR=/usr/lib/cgi-bin -DZM_WEB_USER=www-data -DZM_WEB_GROUP=www-data -DZM_DB_USER=zm01 -DZM_DB_PASS=zm01 -DZM_DB_HOST=sql01.gnulnx.home -DZM_DB_NAME=zm01
make
sudo make install
mysql -u zm01 -p -h sql01.gnulnx.home zm01 < zm_create.sql