1年くらい前とすっかり様変わりしてました。分離してbuild scriptが標準で入っていません。build scriptもantとnodeが利用できるようになりました。
元々、jpgを軽くするにしか使っていませんでしたが。 今回は、nodeを使います。

インストール

npmを使ってインストールします。

npm install -g h5bp

# PATHの設定
# npmは、brewでインストールしている。
export PATH=$PATH:/usr/local/share/npm/bin

# たぶん、grunt-cliも必要だったかも

初期設定

h5bp init

# 次の4stepに答えます。
- project:    Basic project configuration (name, description, version, ...)
- layout:     [D]efault, [C]ustom, [S]illy
- files:      Depends on layout value, series of prompts for specific
              file / directory renames
- gruntfile:  Gruntfile creation

# 基本的にすべてdefault

lease answer the following:
[?] Project name (foo)
[?] Description (The best project ever.)
[?] Version (0.1.0)
[?] Project git repository (git://github.com/toenobu/h5bp.git)
[?] Project homepage (none)
[?] Licenses (MIT)
[?] Author name (toenobu)
[?] Author email (me@toenobu.name)
[?] Author url (none)
[?] Do you need to force an update on master repo? (y)
[?] Do you need to make any changes to the above before continuing? (y/N) N

Please answer the following:
help:   » [D]efault:  Standard html5-boilerplate layout
help:
help:   » [C]ustom:   Specific build of html5-boilerplate. A series of prompt allows
help:                 explicit file rewrites for common files and directories.
help:
help:   » [S]illy:    A "silly" build will prompt for every file in the h5bp repository.
help:
[?] Which layout ? ([D]efault, [C]ustom, [S]illy) D
[?] Do you need to make any changes to the above before continuing? (y/N) N

Please answer the following:
[?] Is the DOM involved in ANY way? (Y/n) Y
[?] Will files be concatenated or minified? (Select no if using require.js to organize and minify your javascript) (Y/n) Y
[?] Will you have a package.json file? (Y/n) Y
[?] What is the intermediate/ directory for the build script? (intermediate/)
[?] What it is the final build output directory? (publish/)
[?] What is the CSS directory? (css/)
[?] What is the JS directory? (js/)
[?] What is the IMG directory? (img/)
[?] Will this project use require.js to organize it's javascript? (Y/n)
[?] Do you need to make any changes to the above before continuing? (y/N) N

Writing .gitattributes...OK
Writing .gitignore...OK
...
Writing LICENSE-MIT...OK
Writing grunt.js...OK

Initialized from template "h5bp".

ビルド

h5bp build:default

# publish ディレクトリ生成され、処理されたファイルがある。
Read and Post Comments

nginxでspdyを試す01の続きです。 SSL証明書をインストールするところから始めます。

SSL証明書をインストール

SSL証明書は、Rapid-ssl.jpで購入しました。2600円でした。

# csrを作ります。
openssl req -new -newkey rsa:2048 -nodes -keyout YOUR_DOMAIN.key -out YOUR_DOMAIN.csr

# crtを受け取って、中間証明書と連結する
# メールできてるはず。
cat YOUR_DOMAIN.crt bundle.crt > YOUR_DOMAIN-join.crt

# nginx配下におきます。
cp YOUR_DOMAIN.key /usr/local/nginx/ssl/
cp YOUR_DOMAIN-join.crt /usr/local/nginx/ssl/

nginx.confの設定

/etc/init.d/nginxspdy の設定

名前は、nginxspdyで統一します。

serviceの登録

chkconfig --add nginxspdy

参考サイト

Read and Post Comments

nginxでspdyを試したい!だけど、現状動作しているものは、いじりたくない。。。
ec2で動作検証すればいいんでしょうが。。。

  • 今、動いているのは、rpmからインストールしたもの
  • tar.gzからインストールすれば、別々のところにインストール可能

というわけで、tar.gzからインストールしていきます。 今回は、OpenSSLのインストールからmake installするところまでです。

OpenSSLの1.0.1以上をインストールする

今の状態

~/package  ᐅ rpm -qa | grep release
remi-release-6-1.el6.remi.noarch
epel-release-6-5.noarch                      
centos-release-6-2.el6.centos.7.x86_64       
nginx-release-centos-6-0.el6.ngx.noarch 

IUS reposからインストールすることができるので、登録する。

~/package  ᐅ wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-10.ius.el6.noarch.rpm   
~/package  ᐅ wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/yum-plugin-replace-0.2.5-1.ius.el6.noarch.rpm

~/package  ᐅ sudo rpm -Uvh ius-release-1.0-10.ius.el6.noarch.rpm
~/package  ᐅ sudo rpm -Uvh yum-plugin-replace-0.2.5-1.ius.el6.noarch.rpm

今のopenssl

~/package  ᐅ rpm -qi openssl
Name        : openssl                      Relocations: (not relocatable) 
Version     : 1.0.0                             Vendor: CentOS 
Release     : 25.el6_3.1                    Build Date: 2012年08月23日 14時01分06秒 
Install Date: 2012年09月30日 23時54分08秒      Build Host: c6b7.bsys.dev.centos.org 
Group       : System Environment/Libraries   Source RPM: openssl-1.0.0-25.el6_3.1.src.rpm 
Size        : 3768415                          License: OpenSSL                           
Signature   : RSA/SHA1, 2012年08月23日 21時31分38秒, Key ID 0946fca2c105b9de              
Packager    : CentOS BuildSystem <http://bugs.centos.org>                                 
URL         : http://www.openssl.org/                                                     
Summary     : A general purpose cryptography library with TLS implementation

~/package  ᐅ rpm -qi openssl-devel 
Name        : openssl-devel                Relocations: (not relocatable) 
Version     : 1.0.0                             Vendor: CentOS 
Release     : 25.el6_3.1                    Build Date: 2012年08月23日 14時01分06秒 
Install Date: 2012年09月30日 23時54分10秒      Build Host: c6b7.bsys.dev.centos.org 
Group       : Development/Libraries         Source RPM: openssl-1.0.0-25.el6_3.1.src.rpm 
Size        : 2161501                          License: OpenSSL 
Signature   : RSA/SHA1, 2012年08月23日 21時31分38秒, Key ID 0946fca2c105b9de 
Packager    : CentOS BuildSystem <http://bugs.centos.org> 
URL         : http://www.openssl.org/ 
Summary     : Files for development of applications which will use OpenSSL

インストール

~/package  ᐅ sudo yum replace openssl --replace-with=openssl10 --enablerepo=ius-testing

Loaded plugins: fastestmirror, replace, security 
Loading mirror speeds from cached hostfile 
 * epel: ftp.iij.ad.jp 
 * ius: ftp.neowiz.com 
 * ius-testing: ftp.neowiz.com 
Replacing packages takes time, please be patient... 

WARNING: Unable to resolve all providers: ['config(openssl)', 'openssl(x86-64)', 'openssl-devel(x86-64)'] 

This may be normal depending on the package.  Continue? [y/N] y 
Resolving Dependencies 
--> Running transaction check 
---> Package openssl.x86_64 0:1.0.0-25.el6_3.1 will be erased 
---> Package openssl-devel.x86_64 0:1.0.0-25.el6_3.1 will be erased 
---> Package openssl10.x86_64 0:1.0.1c-10.ius.el6 will be installed 
---> Package openssl10-devel.x86_64 0:1.0.1c-10.ius.el6 will be installed 
---> Package openssl10-libs.x86_64 0:1.0.1c-10.ius.el6 will be installed 
--> Finished Dependency Resolution 

Dependencies Resolved 

=================================================================================================== Package                  Arch            Version                       Repository            Size 
===================================================================================================Installing: 
 openssl10                x86_64          1.0.1c-10.ius.el6             ius-testing          663 k 
 openssl10-devel          x86_64          1.0.1c-10.ius.el6             ius-testing          1.1 M 
 openssl10-libs           x86_64          1.0.1c-10.ius.el6             ius-testing          806 k 
Removing: 
 openssl                  x86_64          1.0.0-25.el6_3.1              @updates             3.6 M 
 openssl-devel            x86_64          1.0.0-25.el6_3.1              @updates             2.1 M 

Transaction Summary 
===================================================================================================
Install       3 Package(s) 
Remove        2 Package(s) 

Total download size: 2.6 M 

---------------------------------------------

確認

~/package  ᐅ rpm -qi openssl10 
Name        : openssl10                    Relocations: (not relocatable)
Version     : 1.0.1c                            Vendor: (none)
Release     : 10.ius.el6                    Build Date: 2013年01月09日 04時58分55秒
Install Date: 2013年02月03日 02時57分28秒      Build Host: 339189-build03.rpmdev.rackspace.com
Group       : System Environment/Libraries   Source RPM: openssl10-1.0.1c-10.ius.el6.src.rpm
Size        : 1588038                          License: OpenSSL
Signature   : DSA/SHA1, 2013年01月09日 14時07分52秒, Key ID da221cdf9cd4953f
URL         : http://www.openssl.org/
Summary     : Utilities from the general purpose cryptography library with TLS implementation

~/package  ᐅ rpm -qi openssl10-devel
Name        : openssl10-devel              Relocations: (not relocatable)
Version     : 1.0.1c                            Vendor: (none)
Release     : 10.ius.el6                    Build Date: 2013年01月09日 04時58分55秒
Install Date: 2013年02月03日 02時57分27秒      Build Host: 339189-build03.rpmdev.rackspace.com
Group       : Development/Libraries         Source RPM: openssl10-1.0.1c-10.ius.el6.src.rpm
Size        : 2226493                          License: OpenSSL
Signature   : DSA/SHA1, 2013年01月09日 14時07分51秒, Key ID da221cdf9cd4953f
URL         : http://www.openssl.org/
Summary     : Files for development of applications which will use OpenSSL

nginxをインストールする

~/package  ᐅ wget http://nginx.org/download/nginx-1.3.11.tar.gz
~/package  ᐅ tar xvfz nginx-1.3.11.tar.gz
~/package  ᐅ cd nginx-1.3.11

# patchをおとしてあてる
~/package/nginx-1.3.11  ᐅ wget http://nginx.org/patches/spdy/patch.spdy.txt
~/package/nginx-1.3.11  ᐅ patch -p1 < patch.spdy.txt

# cofigure make make install
~/package/nginx-1.3.11  ᐅ ./configure --with-http_ssl_module --with-http_spdy_module

hecking for getaddrinfo() ... found
checking for PCRE library ... not found
checking for PCRE library in /usr/local/ ... not found
checking for PCRE library in /usr/include/pcre/ ... not found
checking for PCRE library in /usr/pkg/ ... not found
checking for PCRE library in /opt/local/ ... not found

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

# エラーが出た!
# pcre-develをインストールしてみる。
~/package/nginx-1.3.11  ᐅ sudo yum install pcre-devel
# ログ取ってないけど、成功しました。

~/package/nginx-1.3.11  ᐅ sudo paco -D make install

nginxでspdyを試す02へ続きます。

Read and Post Comments

vimでmolokaiのカラースキーマを設定したい!
しかし、tmux上ではうまく動作してくれませんでした。

.tmux.confに一行加えました。

環境

~  ᐅ echo $TERM
xterm-256color

~  ᐅ view ~/.tmux.conf
set-option -g default-terminal screen-256color

~  ᐅ tmux attach

### tmuxにアタッチ ###

(blogofile)~/blogofile/blog  ᐅ echo $TERM 
screen-256color

stackOverFlowの記事の記事では、ダメでした。
manを読んだら、screenから変えないで!って書いてあるんだよなー。

set -g default-terminal "xterm"

dotfile

私のdotfiles

その他

  • neobundleを使った。
Read and Post Comments

coffeeScriptをインストールしたいために、nvmをインストールします。が2点ほど、エラーになりました。

環境

~  ᐅ cat /etc/redhat-release
CentOS release 6.2 (Final)

~  ᐅ echo $SHELL     
/bin/zsh

nvmの設定

~  ᐅ git clone git://github.com/creationix/nvm.git ~/.nvm
~  ᐅ source ~/.nvm/nvm.sh

nvm_ls:17: no matches found: vdefault*

curlのオプションの違いらしい。bashではおきない。aliasで回避する。

# aliasで回避できる
~  ᐅ nvm alias default v0.8.12 

nvmで最近のv0.8.12をインストール

~  ᐅ nvm install v0.8.12
######################################################################## 100.0%
nvm:71: command not found: shasum
Checksums do not match.
Binary download failed, trying source.
Additional options while compiling: ######################################################################## 100.0%
nvm:101: command not found: shasum
Checksums do not match.
nvm: install v0.8.12 failed!

centosにはshasumのコマンドない。sha1sumと同じらしく、こちらもaliasを貼って回避します。

alias shasum=sha1sum 
Read and Post Comments

« Previous Page -- Next Page »