Skip to content

Instantly share code, notes, and snippets.

View kylejohnson's full-sized avatar

Kyle Johnson kylejohnson

View GitHub Profile
<?php
class EventsController extends AppController {
public $helpers = array('Paginator');
public $components = array('Paginator', 'RequestHandler');
public function index() {
$this->loadModel('Monitor');
$this->loadModel('Config');
@kylejohnson
kylejohnson / jduggan.pl
Last active December 20, 2015 02:09
Show days and hour since now
#!/usr/bin/perl
use strict;
use warnings;
use Time::Local;
my $var = 'autosnap-hourly-2013-03-27_0900';
my @split = split('-', $var);
my $year = $split[2];
root@zmnextime:/usr/local/src# ls main|sort > out1
root@zmnextime:/usr/local/src# ls ZoneMinder|sort > out2
root@zmnextime:/usr/local/src# diff out1 out2
2d1
< aclocal.m4
6,7d4
< config.h.in
< configure
11,13c8,10
< depcomp
@kylejohnson
kylejohnson / gist:6193732
Last active December 20, 2015 20:58
commands to update zoneminder's make files and such
libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf
# ./configure && make && make install...
@kylejohnson
kylejohnson / gist:6224116
Last active December 21, 2015 00:59
debian zoneminder bugs
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=669781
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694131
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=707411
http://bugs.debian.org/cgi-bin/pkgreport.cgi?repeatmerged=no&src=zoneminder
14:34 < vagrantc> fixxxermet: include "Control: tags -1 fixed-upstream" in the body of an email send to the bug report
14:35 < vagrantc> fixxxermet: basically email [email protected] (where NNN is the bugnumber)
14:35 < fixxxermet> Specific version of debian to test on?
14:36 < vagrantc> ideally, testing with both unstable/sid and testing/jessie ... if only one, unstable/sid
diff -u -E -b ZoneMinder-1.24.2.orig/db/zm_create.sql.in ZoneMinder-1.24.2/db/zm_create.sql.in
--- ZoneMinder-1.24.2.orig/db/zm_create.sql.in 2009-05-25 22:08:50.000000000 +0400
+++ ZoneMinder-1.24.2/db/zm_create.sql.in 2010-09-27 16:22:55.000000000 +0400
@@ -190,7 +190,7 @@
`EndTime` datetime default NULL,
`Width` smallint(5) unsigned NOT NULL default '0',
`Height` smallint(5) unsigned NOT NULL default '0',
- `Length` decimal(10,2) NOT NULL default '0.00',
+ `Length` decimal(11,3) NOT NULL default '0.000',
`Frames` int(10) unsigned default NULL,
<VirtualHost *:80>
# the clone
DocumentRoot /home/kjohnson/ZoneMinder/web
ServerName cakeblog
ServerAlias cakeblog.gnulnx.net
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
@kylejohnson
kylejohnson / MonitorsController.php
Last active December 23, 2015 19:49
Need a way to dynamically determine the number of rows and columns for the main Monitors page. As the number of monitors and each monitors width is not static, we can't hard code these values anywhere - they have to be determined at display-time.
<?php
$monitors[0] = array(
'id' => 1,
'name' => 'front',
'width' => 640
);
$monitors[1] = array(
'id' => 2,
'name' => 'back',
'width' => 1280
<?
App::uses('AppHelper', 'Viwe/Helper');
class BootstrapHelper extends AppHelper {
public $helpers = array('Form');
public function makeInputWithHelp($fieldName, $options = array(), $helpText) {
$input = $this->Form->input($fieldName, $options);
return $input . '<span class="help-block">' . $helpText . '</span>';
git diff actions.php
diff --git a/web/includes/actions.php b/web/includes/actions.php
index 1892464..a55ffb1 100644
--- a/web/includes/actions.php
+++ b/web/includes/actions.php
@@ -767,8 +767,15 @@ if ( !empty($action) )
if ( isset($newValue) && ($newValue != $value['Value']) )
{
- dbQuery( "update Config set Value = '".$newValue."' where Name = '".$name."'" );