IMPORTANT: Backup your nginx site configs (usually under /etc/nginx/sites-available
)!
Remove old nginx incl. nginx-common:
apt-get autoremove --purge nginx nginx-common
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 |
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.
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" |
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
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' |
<?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/> |
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 -%} |
!!! | |
%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%; |