- 入力ファイル
"="区切りのini形式のファイルがあったとして...(":"区切りでも同様)
> cat .\test.txt user = hoge hostname = foo
- ConvertFrom-StringDataコマンドによるファイル読み込み
key名を指定して読み込み可能
> $data = cat .\test.txt | ConvertFrom-StringData > $data.user hoge > $data.hostname foo
〜Linux/Solaris関連の作業メモ〜
"="区切りのini形式のファイルがあったとして...(":"区切りでも同様)
> cat .\test.txt user = hoge hostname = foo
key名を指定して読み込み可能
> $data = cat .\test.txt | ConvertFrom-StringData > $data.user hoge > $data.hostname foo
":mac_hosts"で調整
task :cmd_test, :roles => :servers, :max_hosts => 10 do run "uname -n" end
$ git remote -v
$ git remote set-url origin <新しいリポジトリURL>
$ git diff --cached
$ git diff tst:config/etc/hosts prd:config/etc/hosts
同名ファイルの場合は以下でもOK
$ git diff tst prd -- config/etc/hosts
$ git diff v0.1 v0.2
$ git diff --stat v0.1 v0.2 config/etc/hosts | 7 ++++--- config/etc/resolv | 1 -
$ git reset --hard HEAD
$ git checkout HEAD ファイル名
$ git commit --amend
修正ファイルとブランチを表示
$ git status -s -b ## dev M etc/hosts
$ git branch * master $ git branch test test * master $ git checkout test Switched to branch 'test' $ git branch * test master
$ git config --global core.pager ''
または
$ vi ~/.gitconfig [core] pager =
$ git tag $(uname -n)_$(date "+%Y%m%d-%H%M%S")
$ git tag
$ git tag -n
git tag -l "v*" # "v"から始まるtagを検索
$ git tag -n -l v*
参考:http://d.hatena.ne.jp/kanonji/20110304/1299211488
$ git clone ssh://github.com/foo/bar $ cd bar $ git tag v0.1 v1.0 $ git checkout refs/tags/v1.0 # ブランチを作る場合は、 $ git checkout -b <ブランチ名> refs/tags/v1.0
#!/usr/bin/env ruby # coding: utf-8 # require 'csv' require 'erb' def _tmpl return ERB.new(<<-EOS, nil, '-') describe file '<%= name %>' do it_behaves_like 'a <%= type %> <%= owner %>:<%= group %> <%= perm %>' end EOS end def parse(fname) CSV.foreach( fname, { :col_sep => ',', :headers => true }) do | row | prm = -> { type = row["type" ] name = row["name" ] owner = row["owner"] group = row["group"] perm = row["perm" ] binding } erb = _tmpl puts erb.result(prm.call()) end end parse('./flst.csv')
$ cat flst.csv type,name,owner,group,perm file,/etc/hosts,root,wheel,644 file,/etc/group,root,wheel,644 directory,/opt,root,wheel,755
describe file '/etc/hosts' do it_behaves_like 'a file root:wheel 644' end describe file '/etc/group' do it_behaves_like 'a file root:wheel 644' end describe file '/opt' do it_behaves_like 'a directory root:wheel 755' end
後で書く
>|
$ vi
$ vi Rakefile
require 'ci/reporter/rake/rspec' ※追記
$ rake ci:setup:rspec spec
|<
export WORKSPACE cd ${WORKSPACE}/script/serverspec/ rake ci:setup:rspec spec
script/serverspec/spec/reports/*.xml
RubyMetrics plugin
CURDIR=$(pwd)
svnadmin create svnrepo
svn import svnrepo file://${CURDIR}/svnrepo -m "initial import"
mkdir ${CURDIR}/svnrepo/scripts
svn checkout --config-option "config:tunnels:ssh=ssh -p 12345 -i /Users/hoge/.ssh/id_rsa-l hoge -q" svn+ssh://example.com/hoge/repo/svnrepo/
$ svn commit --config-option "config:tunnels:ssh=ssh -p 12345 -i /Users/hoge/.ssh/id_rsa-l hoge -q" -m 'add script'
http://masutaka.net/chalow/2014-04-20-2.html
http://qiita.com/moqada/items/c62b5852c7654bb972c8
http://magazine.rubyist.net/?0035-RSpecInPractice
http://d.hatena.ne.jp/yohfee/20110222/1298384637
http://j-caw.co.jp/blog/?p=1361
http://qiita.com/doima_/items/e5ad8baa83642d07005a
http://hogehuga.inokara.com/2014/04/30/try-specinfra.html
http://qiita.com/oppara/items/0750bc3ec4de71b25dfd
http://www.sonomirai.com/2014/04/04/
http://d.hatena.ne.jp/hogem/20130619/1371650559
http://apserver.hatenablog.com/entry/2014/04/06/143429
http://mikeda.hatenablog.com/entry/20130608/1370661384
http://mikeda.hatenablog.com/entry/20101011/1286781367
http://inokara.hateblo.jp/entry/2013/07/29/011850
http://thinkit.co.jp/story/2014/09/04/5212
http://qiita.com/ando-masaki/items/e02960789c7a4e0c4d20
http://tech-sketch.jp/2014/05/serverspec-1.html
http://ex-cloud.jp/techblog/?p=699
http://blog.mogmet.com/rake-color-in-serverspec/
$ vi ~/.rspec --color --format documentation
edworld