This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ write_target=`df -h | | |
| grep 'NO NAME$' | | |
| awk -F' ' '{print $1}' | | |
| sed -e 's/[a-z][0-9]$//g' -e 's/disk/rdisk/g'` | |
| $ diskutil unmount `df -h | | |
| grep 'NO NAME$' | | |
| awk -F' ' '{print $1}'` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # # | |
| # http://dotinstall.com/lessons/basic_mongodb # | |
| # # | |
| use dtbs | |
| db.dropDatabase() | |
| db.createCollection("posts") | |
| db.createCollection("users") | |
| db.users.renameCollection("entries") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ver="1.8.4" | |
| mongodUID="27017" | |
| mongodGID="27017" | |
| wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${ver}.tgz | |
| tar zxvf mongodb-linux-x86_64-${ver}.tgz | |
| mv mongodb-linux-x86_64-${ver} /usr/local/ | |
| cd /usr/local | |
| ln -s mongodb-linux-x86_64-${ver} mongodb | |
| mkdir /usr/local/mongodb/db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| yum -y install gcc-c++.x86_64 pcre-devel.x86_64 boost-devel.x86_64 make.x86_64 git.x86_64 | |
| spmky_ver="1.7.0" | |
| cd /usr/local/src/ | |
| wget http://ftp.mozilla.org/pub/mozilla.org/js/js-${spmky_ver}.tar.gz | |
| tar xzvf js-${spmky_ver}.tar.gz | |
| cd js/src | |
| export CFLAGS="-DJS_C_STRINGS_ARE_UTF8" | |
| make -f Makefile.ref | |
| JS_DIST=/usr make -f Makefile.ref export |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 10gen RPM | |
| mongo-10gen-server-2.2.2-mongodb_1.x86_64 : 2013/01/14現在 | |
| #yum-repo 追加 | |
| #https://gist.github.com/raw/4528010/4453b9dff8605494185292786aab9ce1920d810b/mongo_10gen_settings.txt | |
| cat >> /etc/yum.repos.d/10gen.repo <<'10GEN_REPO.EOF' | |
| [10gen] | |
| name=10gen Repository | |
| baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cat >> /etc/yum.repos.d/10gen.repo <<'10GEN_REPO.EOF' | |
| [10gen] | |
| name=10gen Repository | |
| baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 | |
| gpgcheck=0 | |
| enable=0 | |
| 10GEN_REPO.EOF | |
| yum -y install --enablerepo=10gen mongo-10gen-server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/env ruby | |
| #-*- coding: utf-8 -*- | |
| fizzbuzz = Enumerator.new do |y| | |
| number = 1 | |
| loop do | |
| fzbz = number % 15 == 0 ? "FizzBuzz" : | |
| number % 5 == 0 ? "Buzz" : | |
| number % 3 == 0 ? "Fizz" : number | |
| number += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## http://d.hatena.ne.jp/mikeda/20120826/1345972294 | |
| ## http://d.hatena.ne.jp/wyukawa/20120207/1328625443 | |
| ## http://www.mongodb.org/pages/viewpage.action?pageId=18907495 | |
| ## http://taka512.hatenablog.com/entry/20110220/1298195574 | |
| cat >> /etc/yum.repos.d/td.repo <<'EOF' | |
| [tdrepo] | |
| name=treasuredata | |
| baseurl=http://packages.treasure-data.com/redhat/$basearch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/env ruby | |
| #-*- coding: utf-8 -*- | |
| def fizzbuzz(max) | |
| step = 1 | |
| while step <= max | |
| fizbuz = step % 15 == 0 ? "FizzBuzz" : \ | |
| step % 5 == 0 ? "Buzz" : \ | |
| step % 3 == 0 ? "Fizz" : step | |
| yield fizbuz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd /usr/local/src | |
| wget http://archive.apache.org/dist/httpd/httpd-2.2.10.tar.gz | |
| tar zxvf httpd-2.2.10.tar.gz | |
| cd httpd-2.2.10 | |
| ./configure --prefix=/usr/local/apache-2.2.10 \ | |
| --enable-module=so \ | |
| --enable-so \ | |
| --enable-ssl=static \ | |
| --with-ssl=/usr/local/openssl-1.0.0c/ssl | |
| make > /dev/null #エラーメッセージだけを出力確認したいので便宜上 "> /dev/null" を付与した |