Skip to content

Instantly share code, notes, and snippets.

View braynm's full-sized avatar

Bry braynm

View GitHub Profile
@braynm
braynm / gist:3786efe361f9532d8f4d
Last active August 29, 2015 14:03
nginx conf for multiple projects (e.g. php laravel) access via localhost/app1/public
server {
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
root /usr/share/nginx/www;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
@braynm
braynm / fact.go
Last active April 6, 2016 05:27
Factorials w/ big numbers in go
package main
import (
"fmt"
"math/big"
"time"
)
func fact(n *big.Int) (result *big.Int) {
b := big.NewInt(0)
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# Host Only Network
auto enp0s3
iface enp0s3 inet static
dns-nameservers 8.8.8.8 8.8.4.4
@braynm
braynm / Laravel PHP7 LEMP AWS.md
Created June 13, 2016 10:45 — 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
colorscheme badwolf " awesome colorscheme
syntax enable " enable syntax processing
set number "Line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
set showmode "Show current mode down the bottom
set gcr=a:blinkon0 "Disable cursor blink
set visualbell "No sounds
@braynm
braynm / Elixir.ex
Last active June 16, 2017 08:08
Elixir fns
defmodule Fns do
def length([x|xs], acc) do
length(xs, acc + 1)
end
def length([], acc), do: acc
end
# delete all branch except master
`git for-each-ref --format '%(refname:short)' refs/heads | grep -v master | xargs git branch -D`
# delete all stash
`git stash clear`
# Installing ODOO community on runcloud/VPS
## Setup
* add port `8069` in security access
* `deploy` and `restart` the server
* create sudoer user on `ubuntu`
* adduser `<user>`
* `usermod -aG sudo <user>` - make the user as sudoer
Download a single file from a remote ftp server to your machine:
sftp username@hostname:remoteFileName localFileName
Upload a single file from your machine to a remote ftp server:
sftp {user}@{host}:{remote_dir} <<< $'put {local_file_path}'
@braynm
braynm / .vimrc
Last active March 18, 2019 08:19
vim .vimrc configuration
syntax enable
set tabstop=2
set number
set expandtab
set softtabstop=2
set shiftwidth=2
set cursorline
set showmatch
set autoindent
set smartindent