Author: Lin Dong
Date: Sun Mar 8 13:36:08 PDT 2015
Lets talk about Mongo, src code
Intro
| # Automatically instal the latest nginx | |
| wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
| #Make a backup copy of your current sources.list file | |
| sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak | |
| #Now copy the following repositories to the end of ` /etc/apt/sources.list` | |
| echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list | |
| echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list |
| # Redis configuration file example | |
| # Note on units: when memory size is needed, it is possible to specifiy | |
| # it in the usual form of 1k 5GB 4M and so forth: | |
| # | |
| # 1k => 1000 bytes | |
| # 1kb => 1024 bytes | |
| # 1m => 1000000 bytes | |
| # 1mb => 1024*1024 bytes | |
| # 1g => 1000000000 bytes |
| // config/passport.js | |
| // load all the things we need | |
| var LocalStrategy = require('passport-local').Strategy; | |
| var mysql = require('mysql'); | |
| var connection = mysql.createConnection({ | |
| host : 'localhost', | |
| user : 'root', |
| # Legitimately-useful utilities missing from OS X. | |
| brew install wget watch gnu-sed coreutils | |
| # Up-to-date versions of included tools. | |
| brew install git emacs | |
| # Just for fun. | |
| brew install fortune cowsay | |
| #git extras: https://github.com/tj/git-extras |
| check process redis-server | |
| with pidfile "/var/run/redis.pid" | |
| start program = "/etc/init.d/redis-server start" | |
| stop program = "/etc/init.d/redis-server stop" | |
| if 2 restarts within 3 cycles then timeout | |
| if totalmem > 100 Mb then alert | |
| if children > 255 for 5 cycles then stop | |
| if cpu usage > 95% for 3 cycles then restart | |
| if failed host 127.0.0.1 port 6379 then restart | |
| if 5 restarts within 5 cycles then timeout |
Author: Lin Dong
Date: Sun Mar 8 13:36:08 PDT 2015
Lets talk about Mongo, src code
Intro
| #!/bin/bash -e | |
| clear | |
| echo "============================================" | |
| echo "WordPress Install Script" | |
| echo "============================================" | |
| echo "Do you need to setup new MySQL database? (y/n)" | |
| read -e setupmysql | |
| if [ "$setupmysql" == y ] ; then | |
| echo "MySQL Admin User: " | |
| read -e mysqluser |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /** | |
| * Page layout, reused across multiple Page components | |
| * @jsx React.DOM | |
| */ | |
| var React = require('react'); | |
| var ExecutionEnvironment = require('react/lib/ExecutionEnvironment'); | |
| var Navigation = require('../components/Navigation.jsx'); | |
| var DefaultLayout = React.createClass({ |