node.js
npm
安裝 Gitbook 本地端服務
安裝 gitbook 到全域套件中
$ npm install gitbook -g到你自己的 Gitbook 書籍中,打入下列指令,你就可以在 http://localhost:5566 看到這本書籍在 Gitbook 上面的樣子了
$ gitbook serve -p 5566
node.js
npm
$ npm install gitbook -g到你自己的 Gitbook 書籍中,打入下列指令,你就可以在 http://localhost:5566 看到這本書籍在 Gitbook 上面的樣子了
$ gitbook serve -p 5566
「不知道你們是不是跟我一樣,覺得爸爸總是好嚴肅,好難跟他說心事
小時候,每個週末,爸爸都會騎著車,帶我到一個從沒去過的公園玩
但是不知道為什麼,長大後,我們幾乎不講話了
爸爸從來沒有稱讚過我,我也從來沒有說過我愛他
但是幸好我們都在爸爸走之前,說出心裡話
我永遠忘不了,某一天,當我要從醫院病房離開前
爸爸突然叫住我,沉默了幾秒,對我說:『你...要加油喔...』
我點點頭,轉身後眼淚再也停不了」
文章來源:Decoupling your code in Laravel using Repositiories and Services
require:專案必須要使用的套件
require-dev:開發專案時使用的套件(像是測試的套件),在正式環境不需要的套件
$ composer update
$ composer update --dev
$ composer update --no-dev
Ubuntu 14.04 64 bit
Homestead 2.0
Laravel 4.2
Vagrant 1.7.1
Virtualbox 4.3
$ wget http://download.virtualbox.org/virtualbox/4.3.20/virtualbox-4.3_4.3.20-96996~Ubuntu~raring_amd64.deb64位元請下載amd64版本,32位元請下載i386版本
$ sudo dpkg -i virtualbox-4.3_4.3.20-96996~Ubuntu~raring_amd64.deb
$ vagrant up關閉虛擬機器
$ vagrant halt重新讀取yaml設定檔並重新啟動
$ vagrant provision使用ssh連線到虛擬主機
$ vagrant ssh
$ wget http://webupd8.googlecode.com/files/install-google-fonts
$ chmod +x install-google-fonts
$ mkdir .fonts
$ ~/install-google-fonts
try sudo service lightdm restart
sudo apt-get install --reinstall ubuntu-desktop安裝完重新開機即可
sudo apt-get install unity
sudo apt-get install compizconfig-settings-manager
export DISPLAY=:0使用按鍵 Ctrl+Alt+F7 (或Ctrl+Alt+F8) 切換到視窗畫面,會看到Compiz設定視窗,找尋 Unity plugin並啟動它,設定完後重新開機即可
ccsm
$ composer create-project laravel/laravel custom_laravel_folder --prefer-dist
composer create-project [PACKAGE] [DESTINATION PATH] [--FLAGS]
$ cd custom_laravel_folder
$ git init
$ git add .
$ git commit -m "Initial commit"
$ mkdir /home/kejyun/laravel.git
$ cd /home/kejyun/laravel.git
~/laravel.git$ git init --bare
apt-get update && apt-get upgrade安裝nginx、php5-fpm(解析php)、php5-mcrypt(Laravel 4需求套件)、php5-cli & git(composer需求套件)
apt-get install nginx php5-fpm php5-cli php5-mcrypt git設定 nginx的VirtualHost
/etc/nginx/sites-available/default
server {修改fpm設定檔
listen 80 default_server;
root /home/kejyun/laravel/public/;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
# pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
sudo vim /etc/php5/fpm/pool.d/www.conf將
listen = /var/run/php5-fpm.sock修改為
listen = 127.0.0.1:9000重新啟動php-fpm及nginx
service php5-fpm restart修正Laravel 4資料夾群組及寫入權限問題
service nginx restart
sudo chgrp -R www-data /home/kejyun/laravel
sudo chmod -R 775 /home/kejyun/laravel/app/storage
ps aux | grep php若沒有正常的執行 php-fpm,移除並重新安裝
sudo apt-get remove php5 php5-cgi php5-fpm修改fpm設定檔
sudo apt-get install php5 php5-cgi php5-fpm
sudo vim /etc/php5/fpm/pool.d/www.conf將
listen = /var/run/php5-fpm.sock修改為
listen = 127.0.0.1:9000之後重新啟動 php-fpm的服務即可
sudo service php5-fpm restart
$ composer create-project laravel/laravel custom_laravel_folder --prefer-dist
composer create-project [PACKAGE] [DESTINATION PATH] [--FLAGS]若出現以下訊息表示你沒有安裝 Mcrypt PHP extension
Mcrypt PHP extension required.
Script php artisan clear-compiled handling the post-install-cmd event returith an error
sudo apt-get install curl要使用composer必須要安裝php套件
sudo apt-get install php5使用curl下載composer,並把 composer.phar 檔名重新命名為 composer
curl -sS https://getcomposer.org/installer | php -- --filename=composer
安裝時會需要輸入管理者的密碼,安裝好重新開機就可以
ssh-keygen -t rsa指令產生ssh key,Enter passphrase的時候不要輸入任何東西$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/kejyun/.ssh/id_rsa): id_rsa_kejyun
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa_kejyun.
Your public key has been saved in id_rsa_kejyun.pub.
The key fingerprint is:
49:6c:bf:01:a0:74:c7:e4:fd:14:85:75:f6:18:f1:63 kejyun@kejyun-VirtualBox
Client產生的public key資訊(id_rsa_kejyun.pub)加入到Server的~/.ssh/authorized_keys中,因為我在產生key時指定的檔名為id_rsa_kejyun,所以public key則為id_rsa_kejyun.pubcat ~/id_rsa_kejyun.pub >> ~/.ssh/authorized_keys指令將public key存入$vim ~/.ssh/config
Host 192.168.11.10
HostName 192.168.11.10
User kejyun
IdentityFile /home/kejyun/.ssh/id_rsa_kejyun
git clone ssh://kejyun@192.168.11.10/home/kejyun/test.git
git push origin master
git pull origin master
npm install mysql@2.0.0-rc1
npm install felixge/node-mysql
sudo apt-get install nodejs若要使用apt-get安裝最新版的node.js,則需要更新套件庫在進行安裝,若原本已經使用apt-get安裝了舊版的node.js,也可以透過此步驟對node.js進行更新
sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
git clone git://github.com/creationix/nvm.git ~/.nvm
echo ". ~/.nvm/nvm.sh" >> ~/.bashrc
source ~/.bashrc
nvm install 0.10.22
nvm use 0.10.22
nvm alias default 0.10.22
nvm ls
nvm ls-remote