PHP 7 Type Safe Arrays

Here is an example of how to create type safe lists in PHP 7. Influenced by Java Generics, this approach lets your code guarantee the type of data you can store and retrieve from arrays. To change the type of objects stored in the list, update the second line of code. To change it to […]

How to install PHP Ncurses on Debian

Short note on how to install PHP Ncurses on Debian. This post assumes root level access. Install pear and the and ncurses development packages: apt-get update apt-get install -y php-pear apt-get install -y php5-dev apt-get install -y ncurses-dev apt-get install -y libncursesw5-dev Install PHP ncurses (hit return on any prompts): sudo pecl install ncurses Edit […]

Numato Lab 32 Channel USB Gpio NodeJS Module

Having played with the Raspberry PI GPIO interface for over a year, I thought I should explore options for a faster CPU/RAM and a different architecture to enable quicker device control and more complex software. The fastest option for controlling is using a standard PC and a standard CPU architecture. After some research, I found […]

Micro Servo SG 90 – 0 to 180 Degrees Loop

Tiny C program to loop a Micro Servo SG 90 from 0 to 180 degrees and back. Requires servoblaster. #include #include #include #define SERVOBLASTER_DEVICE_PATH “/dev/servoblaster” #define SERVOBLASTER_PIN 2 #define MIN 60 #define MAX 250 #define STEP_INTERVAL_MILLISECONDS 960

Node.JS Low Latency Rapsberry PI Camera Streaming via HTTP and VLC

Here is a short code snippet for relatively low latency video streaming using a Raspberry PI camera via the HTTP protocol, and viewing it in VLC. This post is inspired by a ‘netcat‘ approach found here. Code for creating an HTTP Video Server: var spawn = require(‘child_process’).spawn, child = spawn(‘/opt/vc/bin/raspivid’, [‘-t’, ‘0’, ‘-w’, ‘300’, ‘-h’, […]

Installing Capistrano 3 on a Linux machine, using RVM

Previously, an entry was written on how to Install Capistrano 3, on Debian. Here is an alternate, quicker way, of installing Capistrano using RVM, on any flavour of Linux – authored by Omar Tamer. This tutorial requires curl, and root level privileges. First stage is to install the ruby version manager, RVM: Step 1: Download […]

Free Open Source Alternative to PaperTrail App

Webtail is an Open Source tool I wrote, for tailing files on multiple servers and displaying content in a browser in real time. Using an agent on each server, it can be used for tailing logs and pushing new lines to a server and distributing content to browsers. Source code and install instructions can be […]

How to install RabbitMQ Server and Client on Debian

This is a quick step by step guide on how to install RabbitMQ and the PHP-amqplib client on a Debian server. Install server: sudo apt-get install rabbitmq-server Check the server status: sudo rabbitmqctl status Restart the server: sudo service rabbitmq-server start Install PHP5 client (amqp): Follow instructions from here: https://github.com/videlalvaro/php-amqplib Enable the web administration tool: sudo rabbitmq-plugins enable rabbitmq_management […]

Write your own Pinterest like Image Gallery using jQuery Wookmark and Symfony2

This article provides a quick tutorial on how to write your own Pinterest like Image Gallery using the jQuery Wookmark Plugin and Symfony2. Assuming you already created a Symfony2 Bundle and image files are stored on disk, below are the steps to follow for writing a new Controller and Twig template. WookmarkController (/Controller/WookmarkController.php) NOTE: Requires the Finder […]