Skip to content

Instantly share code, notes, and snippets.

View chairco's full-sized avatar
🏠
Working from home

Jason chairco

🏠
Working from home
View GitHub Profile
@chairco
chairco / nodejs-ubuntu-bind-port-80.md
Created March 21, 2018 02:52 — forked from guifromrio/nodejs-ubuntu-bind-port-80.md
Allow Node.js to bind to privileged ports without root access on Ubuntu

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command:

@chairco
chairco / ubuntu_agnoster_install.md
Created March 29, 2018 01:49 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

# Open CV 3
sudo apt-get -y install libtiff5-dev
sudo apt-get -y install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev
sudo apt-get -y install libxine2-dev libv4l-dev
sudo apt-get -y install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
sudo apt-get -y install qt5-default libgtk2.0-dev libtbb-dev
sudo apt-get -y install libatlas-base-dev

How to install OpenCV 3.1 on Ubuntu 14.04 64bits

Update latest packages and installed

$ sudo apt-get update
$ sudo apt-get upgrade

apt-get update - 更新最新的套件資訊 apt-get upgrade - 更新套件

@chairco
chairco / asyncio-producer-consumer-task_done.py
Created August 14, 2018 08:13 — forked from tomschr/asyncio-producer-consumer-task_done.py
Producer/Consumer pattern for asyncio (Python >=3.4)
# Original source from http://asyncio.readthedocs.io/en/latest/producer_consumer.html
# Rewritten for Python >=3.4
import asyncio
import random
@asyncio.coroutine
def produce(queue, n):
for x in range(n):