Skip to content

Instantly share code, notes, and snippets.

View jackvial's full-sized avatar

Jack Vial jackvial

View GitHub Profile
/*
* 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';

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

@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
@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: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:15b43c0fd831b5bc474d
Last active August 29, 2015 14:04
Add New Virtual Host XAMPP or LAMPP on Linux

On Windows: http://austin.passy.co/2012/setting-up-virtual-hosts-wordpress-multisite-with-xampp-on-windows-7/

In this article, I would like to give a tutorial to Add New Virtual Host XAMPP or LAMPP on Linux.

In this case, I assume you already install xampp on your linux. Then lets start to Add New Virtual Host XAMPP or LAMPP on Linux immediately.

Open your terminal and log as SU Type in your terminal “gedit /opt/lampp/etc/httpd.conf” to open httpd.conf in your text editor delete “#” in front of “Include etc/extra/httpd-vhosts.conf” line

@jackvial
jackvial / gist:d8a523693d29b0be3a41
Last active August 29, 2015 14:10
Backbone: Stackoverflow Answers
@jackvial
jackvial / gist:a0e594f93bd6f9701ed8
Created January 8, 2015 17:58
Github Pages Godaddy Custom Domain