Skip to content

Instantly share code, notes, and snippets.

View vigikaran's full-sized avatar
🎯
All the tools are out there and the only thing that limits us is our imagination

Vigikaran vigikaran

🎯
All the tools are out there and the only thing that limits us is our imagination
View GitHub Profile
@vigikaran
vigikaran / openresty-ubuntu-install.sh
Created January 3, 2017 11:59 — forked from alex-roman/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.9.15.1.tar.gz
tar zxvf openresty-1.9.15.1.tar.gz
cd openresty-1.9.15.1
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@vigikaran
vigikaran / db-connect-test.php
Created December 23, 2016 12:38 — forked from chales/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
$dbhost = 'host';
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
#https://www.vultr.com/docs/setup-nginx-rtmp-on-ubuntu-14-04
apt-get install build-essential libpcre3 libpcre3-dev libssl-dev unzip software-properties-common
mkdir /usr/build
#Download the Nginx and Nginx-RTMP source.
wget http://nginx.org/download/nginx-1.7.8.tar.gz
wget https://github.com/arut/nginx-rtmp-module/archive/master.zip
#Extract the Nginx and Nginx-RTMP source.
tar -zxvf nginx-1.7.8.tar.gz
unzip master.zip
#Switch to the Nginx directory.
@vigikaran
vigikaran / 2) Config
Last active July 16, 2016 22:50 — forked from nghuuphuoc/1) Install
Install Redis on Centos 6
$ sudo nano /etc/sysctl.conf
vm.overcommit_memory=1
$ sysctl vm.overcommit_memory=1
$ sysctl -w fs.file-max=100000
@vigikaran
vigikaran / gist:d138cdcef3881cbc82c1cb71cac8b8d6
Created June 24, 2016 13:08 — forked from wolthers/gist:9227398
Handlebars helper for converting unix timestamp in seconds to pretty date - "25 seconds ago" / "3 minutes ago" / "2 hours ago" / "2 days ago" / "December 25"
/**
@param {UNIX timestamp} timestamp - an unix timestamp in seconds
*/
Handlebars.registerHelper("prettyDate", function (timestamp) {
var date,
monthNames,
secs = ((new Date()).getTime() / 1000) - timestamp,
minutes = secs / 60,
hours = minutes / 60,