Skip to content

Instantly share code, notes, and snippets.

@poc7667
poc7667 / Install-nginx-with-http2-support.md
Created September 26, 2016 23:12 — forked from hollodotme/Install-nginx-with-http2-support.md
Install nginx with http2 support on ubuntu 14.04 LTS (Trusty)

How to install nginx (>= 1.9.5) with http2 support on Ubuntu 14.04 LTS (Trusty)

IMPORTANT: Backup your nginx site configs (usually under /etc/nginx/sites-available)!

Remove old nginx

Remove old nginx incl. nginx-common:

apt-get autoremove --purge nginx nginx-common
@poc7667
poc7667 / Mysql_cheatsheet
Last active June 24, 2016 20:30 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
MySQL
===============
Getting started:
- http://www.sqlteaching.com/
- https://www.codecademy.com/courses/learn-sql
Related tutorials:
- MySQL-CLI: https://www.youtube.com/playlist?list=PLfdtiltiRHWEw4-kRrh1ZZy_3OcQxTn7P
- Analyzing Business Metrics: https://www.codecademy.com/learn/sql-analyzing-business-metrics
@poc7667
poc7667 / README.md
Created November 30, 2015 08:23
routes_spec.rb

How to add a rspec test for API test with http basic auth

Let's say if you put api controller under app/controllers/api/v1/xxx_controller.rb

In most case, you should create spec/controllers/api/v1/xxx_controller_spec.rb

here's a sample script for spec test.

@poc7667
poc7667 / .zshrc
Last active November 28, 2015 13:51
apache spark environment
export JAVA_HOME=$(/usr/libexec/java_home)
export SPARK_HOME=$HOME/workspace/apache-spark-playground/spark-1.5.0-bin-hadoop2.6
export PYTHONPATH=$SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.8.2.1-src.zip:$SPARK_HOME/python/build:$PYTHONPATH
export PATH="$HOME/.pyenv/shims:$SPARK_HOME/bin:$HOME/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH"
@poc7667
poc7667 / README.md
Last active November 25, 2015 02:43
database setting

mount your external disk to /workspace,

and create an folde for storing DB's data, and set the owner to mongodb

   sudo mkdir /workspace/mongo_store

sudo chown -R mongodb:mongodb mongo_store

@poc7667
poc7667 / Gemfile
Last active November 24, 2015 09:28
deployment recipe
gem "capistrano", "~> 3.1", require: false
gem "capistrano-rails", "~> 1.1", require: false
gem "capistrano-rbenv", "~> 2.0.3", require: false # production server use rbenv
gem 'capistrano-puma', require: false
gem 'capistrano-file-permissions'
gem 'dotenv-rails'
@poc7667
poc7667 / config.plist
Last active November 21, 2015 01:34
GIGABYTE GA-Z97-D3H/ Core i5-4460 / no external graphic card
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ACPI</key>
<dict>
<key>DSDT</key>
<dict>
<key>Debug</key>
<false/>
@poc7667
poc7667 / not_working_jinjia.py
Created October 20, 2015 09:35
not_working_jinjia
from jinja2 import Template
fields = ["operating revenue", "gross operating profit", "EBITDA", "operating profit after depreciation", "EBIT", "date"]
# template_file = open('./fields_template.jinja2').read()
template_file = '''
{%- for field in fields -%}
-
name: {{field}}
type: string
{%- endfor -%}
@poc7667
poc7667 / INSTALL.md
Created October 19, 2015 02:38
Install 10.11 with clover
@poc7667
poc7667 / sample.text.haml
Created August 22, 2015 01:50
error mail preview
!!!
%html{:xmlns => "http://www.w3.org/1999/xhtml"}
%head
%meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"}/
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}/
%meta{:content => "width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1", :name => "viewport"}/
%title *|MC:SUBJECT|*
:css
.ReadMsgBody{
width:100%;