独自のドメインや証明書を利用する場合は有償みたいですが、私は以下のドメインを利用させていただいているので(Piggyback SSLなので)特に設定等の必要もなくhttpsでの接続が可能です。
- myapp.heroku.com/
- myapp.herokuapp.com/
$ git clone git://github.com/malclocke/fulcrum.git $ cd fulcrum $ bundle install --without development test ~ Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. $ heroku login Enter your Heroku credentials. Email: <-- メールアドレスを入力 Password (typing will be hidden): <-- パスワードを入力 Authentication successful. $ heroku create アプリケーション名 ! Name is already taken $ vi config/initializers/gramil.rb <-- Gmailを使う設定を実施 $ git init $ git add . $ git commit -m 'initial' $ git push heroku master $ heroku rake db:setup $ heroku open
#!/bin/sh while [ 0 -le $# ] do echo $1 shift done実行すると10個以上の引数をshiftコマンドを使って参照をずらし$1で順番に参照できているのが分かります。
$ sh test.sh a b c d e f g h i j k l m a b c d e f g h i j k lなお、「$#」は引数の数が可能される特殊変数の一種です。 では、test.shを以下の通り変更するとどうなるか見てみましょう。
#!/bin/sh while [ 0 -le $# ] do echo $1 shift 2 done実行例は以下の通りです。
$ sh test.sh a b c d e f a c e上記の実行例を見ると分かると思いますが、参照が2個づつスライドしています。このようにshiftコマンドにスライドさせたい数をしていることで指定した数だけ参照をずらすことが可能です。 もう1とつ忘れていけないのが「$0」は何を参照しているかということです。
#!/bin/sh echo $0実行例は以下の通りです。
$ sh test.sh test.sh
$ echo $- himBH
$ set -o allexport off braceexpand on emacs on errexit off errtrace off functrace off hashall on histexpand on history on igncr off ignoreeof off interactive-comments on keyword off monitor on noclobber off noexec off noglob off nolog off notify off nounset off onecmd off physical off pipefail off posix off privileged off verbose off vi off xtrace off
シェルオプション | フラグ | 説明 | |
---|---|---|---|
allexport | a | 変数代入時に自動的にexportを実行する。 | |
braceeexpand | B | プレース展開を有効にする。 | |
emacs | - | emacs入力モードを有効にする。 | |
errexit | e | コマンドが異常終了ステータスで終了するした場合にシェルを終了する。 | |
errtrace | E | ||
functrace | T | ||
hashall | h | コマンドの位置を記憶し、検索時間を短縮する。 | |
histexpand | H | !(exclamation point:エクスクラメーション・ポイント)によるヒストリの置換を有効にする。 | |
igncr | - | ||
ignoreeof | - | ||
interactive-comments | - | ||
keyword | k | ? | |
monitor | m | ジョブコントロールを有効にする。 | |
noclobber | C | すでに存在するファイルへのリダイレクトを禁止する。 | |
noexec | n | ||
noglob | f | ワイルドカード(*、?)の展開を禁止する。 | |
nolog | - | ||
notify | b | バックグラウンドジョブが終了した際の通知を有効にする。 | |
nounset | u | 未設定パラメータへの参照をエラーにする。 | |
onecmd | t | ? | |
physical | P | cd/cwdで-Pオプション(シンボリックによるパスではなく実際のパスを表示)を常に有効にする。 | |
pipefail | - | ||
posix | - | ||
plivileged | p | 特権モードを有効にする。 | |
verbose | v | コマンド入力時にエコー表示する。 | |
vi | - | vi入力モードを有効にする。 | |
xtrace | x | コマンド実行時に、展開後のコマンド行表示を有効にする。 |
[[ "$-" != *i* ]] && return
$ echo {a..z} a b c d e f g h i j k l m n o p q r s t u v w x y z{}(ブレース)で囲まれた短縮表現の「a..z」が展開されて出力されているのが分かると思います。
$ for v in test_{01..09}.log; do > echo ${v}; > done test_01.log test_02.log test_03.log test_04.log test_05.log test_06.log test_07.log test_08.log test_09.log可変部分を短縮表記でなくても動作します。
$ for v in test_{a,b,c}.log; do > echo $v > done test_a.log test_b.log test_c.log空文字的なものも含めることができます。
$ for v in test{,.log}; do > echo ${v} > done test test.log*(アスタリスク)も利用できます。アスタリスクは該当するファイル名に展開されるようです。
$ echo {.vimrc,.*} .vimrc . .. .bash_history .bash_profile .bashrc .gem .gitconfig .inputrc .profile .screenrc .ssh .vim .viminfo .vimrc
パーツ名 | メーカー | 製品名 | (購入)価格 |
ベアボーン | シャトル | XS35GT V2 | 10,500 |
メモリ | ディラック | AVD3S13330904G-1SW(SODIMM DDR3 PC3-10600) | 3,304 |
HDD | WESTERN DIGITAL | WD5000BPVT | 4,935 |
製品名 | XS35GT V2 |
---|---|
対応CPU | Intel Atom D525(1.8GHz) |
チップセット | Intel NM10 |
対応メモリー | DDR3-800 SO-DIMM×1、最大4GB |
グラフィックス機能 | NVIDIA ION、グラフィックスメモリー:DDR3 512MB、DirectX 10.1サポート |
サウンド機能 | 2ch Audio(IDT92HD81 Audio Codec) |
通信機能 | 有線:Gigabit Ethernet(JMicron JMC251) 無線:IEEE 802.11b/g/n |
拡張スロット | 非搭載 |
ドライブベイ | スリムドライブ(薄型5インチ)/内部2.5インチ共用ベイ×1、内部2.5インチ×1 |
外部インターフェース | 前面:USB 2.0×1、メモリーカードリーダー(SDメモリーカード/MMC/メモリースティック/メモリースティック Pro)
背面:HDMI、アナログRGB、USB 2.0×4、LAN×1、オーディオ出力(ステレオ)×1、マイク入力×1、ACアダプター
|
内部インターフェース | Serial ATA 3Gbps×2、PCI Express Mini Card×1(無線LANカードを搭載済み) |
電源 | 40W ACアダプター |
外形寸法(幅、奥行き、高さ) | 38.4×252×162mm |
付属品 | マニュアル、ドライバーDVD、ACアダプター、薄型5インチベイ用Serial ATA変換アダプター、2.5インチドライブ用マウンター |
>sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on 火 7月 1 10:52:33 2008 Copyright (c) 1982, 2005, Oracle. All rights reserved. Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production に接続されました。 SQL> exec dbms_xdb.sethttpport(5050); PL/SQLプロシージャが正常に完了しました。 SQL>
gem "mongrel", ">= 1.2.0.pre2"
> bundle install
>rails s mongrel => Booting Mongrel => Rails 3.2.13 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Connecting to database specified by database.yml
> heroku createこのIDなるものはアプリケーションを公開する際のサブドメインとして利用されます。Heroku側で適当に付けられたIDでちょっとな感じなので、できれば自分で指定したいですね。自分でIDを命名するには以下の通り引数にアプリケーションIDを指定します。
> heroku create アプリケーションID自分で付けられるといってもサブドメインとして利用されることから予想できると思いますがアプリケーションIDはHeroku上で一意でないといけない感じなので、ほかの人が使ってるIDは利用できませんのでご注意を!個人的にはすでに使いたいIDがかなり使えなかったりする状態ですが。。。
> heroku create アプリケーションID Name is already takenまた、IDを変更するにはrenameコマンドを使ってください。
> heroku rename アプリケーションID変更した際ですが、アプリケーションIDはリポジトリ名としても利用されています。不一致のままだと管理しづらいので以下のコマンドを実行してリポジトリ名も変更しておきましょう。
> git remote rm heroku > git remote add heroku git@heroku.com:新しいアプリケーションID.git
> rake --tasks (または -T) rake about # List versions of all Rails frameworks and the env... rake assets:clean # Remove compiled assets rake assets:precompile # Compile all the assets named in config.assets.pre... rake db:create # Create the database from DATABASE_URL or config/d... rake db:drop # Drops the database using DATABASE_URL or the curr... rake db:fixtures:load # Load fixtures into the current environment's data... rake db:migrate # Migrate the database (options: VERSION=x, VERBOSE... rake db:migrate:status # Display status of migrations rake db:rollback # Rolls the schema back to the previous version (sp... rake db:schema:dump # Create a db/schema.rb file that can be portably u... rake db:schema:load # Load a schema.rb file into the database rake db:seed # Load the seed data from db/seeds.rb rake db:setup # Create the database, load the schema, and initial... rake db:structure:dump # Dump the database structure to db/structure.sql. ... rake db:version # Retrieves the current schema version number rake doc:app # Generate docs for the app -- also available doc:r... rake log:clear # Truncates all *.log files in log/ to zero bytes rake middleware # Prints out your Rack middleware stack rake notes # Enumerate all annotations (use notes:optimize, :f... rake notes:custom # Enumerate a custom annotation, specify with ANNOT... rake rails:template # Applies the template supplied by LOCATION=(/path/... rake rails:update # Update configs and some other initially generated... rake routes # Print out all defined routes in match order, with... rake secret # Generate a cryptographically secure secret key (t... rake stats # Report code statistics (KLOCs, etc) from the appl... rake test # Runs test:units, test:functionals, test:integrati... rake test:recent # Run tests for {:recent=>"test:prepare"} / Test re... rake test:single # Run tests for {:single=>"test:prepare"} rake test:uncommitted # Run tests for {:uncommitted=>"test:prepare"} / Te... rake time:zones:all # Displays all time zones, also available: time:zon... rake tmp:clear # Clear session, cache, and socket files from tmp/ ... rake tmp:create # Creates tmp directories for sessions, cache, sock...
> rake db:migrate
> rake db:migrate:status
> rake db:rollback
> rake db:rollback STEP=5
> rake routes