Skip to content

Instantly share code, notes, and snippets.

@jackvial
jackvial / gist:44b28a263e8c46406b94
Last active August 29, 2015 14:04
Apache Server Notes

Turn on mod rewrite

sudo a2enmod rewrite && sudo service apache2 restart

When using TimThumb make sure GD library is installed

sudo apt-get install php5-gd 
@jackvial
jackvial / gist:f3f050638a0caa33702a
Created July 24, 2014 11:46
Testing Jquery Plugins with jasmine

To spy a Jquery method:

var spy = spyOn($.fn, 'methodName');
@jackvial
jackvial / gist:2bbddd6d8c3d1b2a09c2
Created July 20, 2014 19:01
Install ODBC for PHP, Apache on Ubuntu 14.04
$ sudo apt-get install freetds-bin freetds-common tdsodbc odbcinst php5-odbc unixodbc
$ sudo mv /etc/odbcinst.ini /etc/odbcinst.ini.bak
$ sudo find / -name odbcinst.ini
$ sudo cp /usr/share/tdsodbc/odbcinst.ini /etc/
$ sudo service apache2 restart

Generate key pair for www-data

sudo -u www-data:www-data ssh-keygen -t rsa

Keys will be created in /var/www/.ssh/

Add id_rsa.pub to github deploy keys

All project files and directories to be triggered from github webhook should be owned by www-data user

/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';