- paravirtual の arch linux AMI からインスタンスを作る
- chef solo で準備
- knife solo prepare でリモートサーバーにchef をインストールする
- Arch linux だとうまくいかない
- リモートサーバー上で直接Chefをインストールすることにした
curl -L https://www.opscode.com/chef/install.sh | bash
してもコケる- gem からインストールする
- まずは ruby をインストール
pacman -S extra/ruby
This file contains 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
#!/usr/bin/env bash | |
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
tmux bind-key T run-shell "$CURRENT_DIR/scripts/tmux_list_plugins.sh" |
This file contains 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
require 'net/ftp' | |
# connectionはいい感じに設定する | |
ftp = Net::FTP.new | |
ftp.connect | |
# ファイル名のみを取得する | |
ftp.ls.map {|name| name.split("\s").last } |
This file contains 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
require 'net/ftp' | |
ftp = Net::FTP.new | |
ftp.connect('hostname', 21) # port番号はdefaultで21(省略可能) | |
ftp.login('username', 'password') | |
ftp.passive | |
#=> true or false | |
ftp.passive = true | |
ftp.list | |
#=> ["-rw-r--r-- 1 0 0 1234 Feb 27 13:36 aaa.txt", |
This file contains 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
# 実行前にgrepコマンドまで実行して確認しておく!! | |
git branch --merged | grep -v 'master' | xargs git branch -d |
This file contains 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
$ gunzip -c foo.tar.gz | tar xvf - foo/bar.txt foo/baz.txt | |
x foo/bar.txt | |
x foo/baz.txt | |
$ ls foo | |
bar.txt baz.txt |
This file contains 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
$ mkdir new_project & cd new_project | |
$ bundle init | |
#=> Gemfileのひな形が生成される | |
$ vim Gemfile | |
#=> gem "rspec" を追加する | |
$ bundle install --path vendor/bundle | |
$ bundle exec rspec --init |
This file contains 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
# Logging auto loading | |
require 'active_support/dependencies.rb' | |
require 'logger' | |
ActiveSupport::Dependencies.logger = Logger.new("#{Rails.root}/log/develpment.log") | |
ActiveSupport::Dependencies.log_activity = true |
This file contains 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
db.getMongo().setSlaveOk() |
This file contains 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
# 特定のコレクションのみリストアする | |
mongorestore --db database_name --collection users ~/dump/users.bson |
NewerOlder