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 / 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,
@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
#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 / 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'");
@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 / HLS_dvr.sh
Created January 4, 2017 20:56 — forked from John07/HLS_dvr.sh
A small script to make recording http live streams (HLS, those streams that work on iOS devices) nicer on a Mac. Script records the stream for a defined period of time and sends the user notifications if anything goes wrong and once it's done.
# required: ffmpeg (e.g. from homebrew), terminal-notifier from https://github.com/alloy/terminal-notifier
# you can schedule this with launchd to run e.g. weekly
# Specify in seconds how long the script should record (default here is 1 hour).
seconds=3600
# Date format for the recording file name
DATE=`date "+%d-%m-%y_%H-%M"`
# start ffmpeg recording
@vigikaran
vigikaran / Laravel PHP7 LEMP AWS.md
Created January 27, 2017 21:27 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 14.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 14.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@vigikaran
vigikaran / README.md
Created January 28, 2017 11:57 — forked from magnetikonline/README.md
Nginx FastCGI cache configuration example.

Nginx FastCGI cache

Example /etc/nginx/nginx.conf using FastCGI (e.g. to PHP-FPM) with FastCGI cache enabled. This will capture returned data and persist it to a disk based cache store for a configurable amount of time, great for robust full page caching.

Will need to create a directory to hold cache files, for the example given here that would be:

$ sudo mkdir -p /var/cache/nginxfastcgi
$ chown www-data: /var/cache/nginxfastcgi
@vigikaran
vigikaran / donate.md
Created February 6, 2017 17:55
My Paypal donate button in markdown format

Donation Button

Donate

@vigikaran
vigikaran / frontendDevlopmentBookmarks.md
Created February 6, 2017 17:56 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.