This file covers all the steps needed to install a web server and Yii 2 framework to host a project in an Ubuntu 14.04 server.
First, the packages related to apache and php need to be installed:
| /** | |
| * Indents a flat JSON string to make it more human-readable. | |
| * | |
| * http://www.daveperrett.com/articles/2008/03/11/format-json-with-php/ | |
| */ | |
| function json_indent($json) | |
| { | |
| $result = ''; | |
| $pos = 0; | |
| $strLen = strlen($json); |
| #! /usr/bin/python | |
| from sys import argv | |
| from os.path import exists | |
| from os import makedirs | |
| from os import symlink | |
| from os import system | |
| import getopt | |
| # |
| bucket_name="BUCKET_NAME" | |
| aws s3api list-objects \ | |
| --bucket $bucket_name \ | |
| --region `aws s3api get-bucket-location --bucket $bucket_name --output text` \ | |
| --output json \ | |
| --query "[sum(Contents[].Size), length(Contents[])]" |
| -- From: http://stackoverflow.com/a/9620273 | |
| -- Change 'SCHEMA_NAME_HERE' | |
| SELECT table_name AS "Tables", | |
| round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" | |
| FROM information_schema.TABLES | |
| WHERE table_schema = 'SCHEMA_NAME_HERE' | |
| ORDER BY (data_length + index_length) DESC; |
| function getObjProperty(containerObj, str, defaultValueArg) { | |
| var defaultValue = typeof defaultValueArg !== 'undefined' ? defaultValueArg : null; | |
| try { | |
| return _(str.split('.')).reduce(function(obj, key) { | |
| return obj[key]; | |
| }, containerObj); | |
| } catch (e) { | |
| return defaultValue; | |
| } |
| #!/bin/bash | |
| # File name | |
| readonly PROGNAME=$(basename $0) | |
| # File name, without the extension | |
| readonly PROGBASENAME=${PROGNAME%.*} | |
| # Arguments | |
| readonly ARGS="$@" | |
| # Arguments number | |
| readonly ARGNUM="$#" |
| // autoclick the correct squares at 1/10 of a sec... | |
| var interval = setInterval(function() { $('iframe').contents().find('.thechosenone').click(); }, 100); | |
| // stop whenever you want! | |
| clearInterval(interval); |
If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"
npm adduser