Skip to content

Instantly share code, notes, and snippets.

@onerinas
onerinas / Laravel PHP7 LEMP AWS.md
Last active January 20, 2017 18:31 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x, Let's Encrypt SSL

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.04 version.

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
sudo apt-get install -y php7.0 php7.0-fpm php7.0-mysql php7.0-zip php7.0-gd
@onerinas
onerinas / provision.sh
Created January 20, 2017 12:22
Homestead provision script
#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
# Update Package List
apt-get update
# Update System Packages
apt-get -y upgrade
@onerinas
onerinas / Homestead.yaml
Created January 20, 2017 11:00 — forked from bubba-h57/Homestead.yaml
after.sh for Homestead
variables:
- key: STS_USER
value: "<your name>"
- key: STS_HOME
value: "<your customized home dir>"
- key: AWS_ACCESS_KEY_ID
value: "<your key>"
- key: AWS_SECRET_ACCESS_KEY
value: "<your secret>"
- key: AWS_DEFAULT_REGION
@onerinas
onerinas / overrideLog.js
Created January 9, 2017 16:21 — forked from mksoni88/overridelog.js
Override console.log to print line number ( and filename ) (sometimes helpful in nodejs debugging)
_log = console.log;
global.console.log = function() {
var traceobj = new Error("").stack.split("\n")[2].split(":");
var file = traceobj[0].split(process.env.PWD + '/')[1];
var line = traceobj[1];
var new_args = [file + ":" + line + " >>"];
new_args.push.apply(new_args, arguments);
_log.apply(null, new_args);
};
@onerinas
onerinas / README
Created December 7, 2016 07:05 — forked from adilapapaya/README
Export Table Data to CSV using Javascript
Example code for exporting data in a table to a csv file.
@onerinas
onerinas / webpack.config.js
Created August 1, 2016 20:00 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@onerinas
onerinas / s3cmd_install.md
Created June 25, 2016 07:12 — forked from dominicsayers/s3cmd_install.md
Installing s3cmd on Ubuntu Server
  1. sudo apt-get install python-setuptools
  2. wget http://downloads.sourceforge.net/project/s3tools/s3cmd/1.5.0-alpha1/s3cmd-1.5.0-alpha1.tar.gz
  3. tar xvfz s3cmd-1.5.0-alpha1.tar.gz
  4. cd s3cmd-1.5.0-alpha1
  5. python setup.py install
  6. s3cmd --configure
@onerinas
onerinas / sort.rb
Created June 13, 2016 08:26 — forked from aspyct/sort.rb
Sample implementation of quicksort, mergesort and binary search in ruby
# Sample implementation of quicksort and mergesort in ruby
# Both algorithm sort in O(n * lg(n)) time
# Quicksort works inplace, where mergesort works in a new array
def quicksort(array, from=0, to=nil)
if to == nil
# Sort the whole array, by default
to = array.count - 1
end
require "time"
require "date"
class Date
def to_time
Time.local(year, month, day)
end
end
class Time
@onerinas
onerinas / ahn
Created March 28, 2016 09:13 — forked from ik5/ahn
Adhearsion init script
#!/bin/bash
### BEGIN INIT INFO
# Provides: ahn
# Required-Start: ahn daemon
# Required-Stop: ahn daemon
# chkconfig: 2345 91 60
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Adhearsion daemon