Skip to content

Instantly share code, notes, and snippets.

View benjiao's full-sized avatar

Benjie Jiao benjiao

View GitHub Profile
sudo timedatectl set-timezone Asia/Manila
sudo yum install ntp && \
sudo systemctl start ntpd && \
sudo systemctl enable ntpd && \
sudo service ntpd restart
# Setup Swapfile
sudo dd if=/dev/zero of=/swapfile count=4096 bs=1MiB && \\
sudo chmod 600 /swapfile && sudo mkswap /swapfile && \\
set nocompatible
" Syntax Highlighting
filetype indent plugin on
set syntax=on
" Use case insesitive search
set ignorecase
set smartcase
sudo fallocate -l 4G /swapfile && \
sudo chmod 600 /swapfile && \
sudo mkswap /swapfile && \
sudo swapon /swapfile && \
sudo sh -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab'
# Install GDAL python libraries on Virtualenv. Tested in Ubuntu 14.04
sudo apt-get install gdal-bin
sudo apt-get install libgdal-dev libgdal1h
pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="-I/usr/include/gdal"
#!/bin/bash
set -e
# ----------------------------------------------------------------------------------------
# Installs OpenCV 2.4.11
# Note: Tested on Ubuntu 14.04
#
# Resources:
#
# http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/
@benjiao
benjiao / angular-nginx-sub-uri.conf
Created November 6, 2015 04:42
Nginx config for Angular app under sub-URI
location /testapp/ {
rewrite ^/testapp/(.*) /$1 break;
proxy_redirect off;
proxy_pass http://127.0.0.1:9090;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
@benjiao
benjiao / .vimrc
Last active August 15, 2019 12:26
set nocompatible
" Syntax Highlighting
filetype indent plugin on
set syntax=on
" Use case insesitive search
set ignorecase
set smartcase
sudo apt-get -y update
sudo apt-get -y install git
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get -y update && sudo apt-get install -y nodejs
sudo apt-get -y install mongodb
curl https://install.meteor.com/ | sh
git clone https://github.com/RocketChat/Rocket.Chat.git
cd Rocket.Chat
apt-get -y update
# Download Zulip
cd /root
wget https://www.zulip.com/dist/releases/zulip-server-1.3.6.tar.gz
echo "665a1e6ef840b3a86cc18946429ad1c0033d27a2 zulip-server-1.3.6.tar.gz" | sha1sum -c
tar -xf zulip-server-1.3.6.tar.gz
mv zulip-server-1.3.6 zulip
# Install SSL Certs
@benjiao
benjiao / flask-logging-example.py
Created September 21, 2015 11:20
Flask Logging to File Example
# Setup Logging
formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s')
fh = logging.FileHandler(filename='flask-tutorial.log')
fh.setFormatter(formatter)
fh.setLevel(logging.DEBUG)
app.logger.addHandler(fh)