Skip to content

Instantly share code, notes, and snippets.

@Draiken
Draiken / post-receive.json
Created June 28, 2011 13:31
json generated from post-receive
{
:before=>"9e46da9a352aefeeefc4344de5ab2b513fc33716",
:repository=>{:name=>"test"},
:after=>"65cbbc08b054b8e9626b20d81fdaab70a2ad2926",
:ref=>"refs/heads/master",
:commits=>[
{
:commiter=>{:name=>"Luiz Felipe", :email=>"luiz.felipe.gp@gmail.com"},
:message=>"commit NOW 4",
:timestamp=>"2011-06-28 10:22:08",
@Draiken
Draiken / recipe.rb
Created June 30, 2011 17:59
known hosts recipe
cookbook_file "/home/vagrant/.ssh/known_hosts" do
owner "vagrant"
group "vagrant"
mode 0755
source "known_hosts"
end
this is my tree inside custom_cookbooks
.
└── nzn
└── known_hosts
├── files
│   └── default
│   └── known_hosts
└── recipes
└── default.rb
@Draiken
Draiken / vagrantfile
Created June 30, 2011 17:53
my vagrantfile
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "vendor/cookbooks/vagrant_base"
chef.log_level = :debug
chef.add_recipe "apt"
chef.add_recipe "build-essential"
chef.add_recipe "networking_basic"
chef.add_recipe "openssl"
chef.add_recipe "git"
@Draiken
Draiken / checkout_one_file.txt
Created June 30, 2011 20:09
Checkout only one file from a git repo
git clone --no-checkout --depth 1 git@github.com:foo/bar.git && cd bar && git show HEAD:path/to/file.txt
@Draiken
Draiken / retrieve_one_file_from_git.rb
Created July 1, 2011 15:43
Retrieving only one file from git
def fetch
rdm = Random.rand(2000)
file = `git clone --no-checkout --depth 1 --quiet #{repository.clone_url} /tmp/travis-yml-#{rdm} && cd /tmp/travis-yml-#{rdm} && git show HEAD:.travis.yml && rm -rf /tmp/travis-yml-#{rdm}`
file == "" ? {} : parse(file)
end
@Draiken
Draiken / bundler
Created July 7, 2011 11:29
bundler output
Using nzn_denounces (0.4.0) from ssh://git@201.22.7.190:2202/nzn_denounces.git (at master) fatal: Not a git repository (or any of the parent directories): .git
Git error: command `git fetch --force --quiet --tags "/home/vagrant/.rvm/gems/ruby-1.9.2-p180/cache/bundler/git/nzn_denounces-4e2858d3b9052ba97aff50920a9d94c6ef48a38a"` in directory /home/vagrant/.rvm/gems/ruby-1.9.2-p180/bundler/gems/nzn_denounces-7565d484f2df has failed.
If this error persists you could try removing the cache directory '/home/vagrant/.rvm/gems/ruby-1.9.2-p180/cache/bundler/git/nzn_denounces-4e2858d3b9052ba97aff50920a9d94c6ef48a38a'
@Draiken
Draiken / Gemfile.lock
Created July 7, 2011 13:53
Gemfile lock
GIT
remote: git://github.com/Draiken/opinio.git
revision: 80aae235cf9683aa0b2133e5d24e7f59e6ef8a22
specs:
opinio (0.0.2)
GIT
remote: git://github.com/jystewart/has_many_polymorphs.git
revision: 36f15d24ca4200f657a5203d9fc0253b58477705
specs:
@Draiken
Draiken / bundler.out
Created July 7, 2011 13:44
Bundler output
$ bundle install
ssh://git@201.22.7.190:2202/nzn_categories.git
remote: Counting objects: 510 [K
remote: Counting objects: 1609, done.[K
remote: Compressing objects: 100% (1278/1278), done.[K
Receiving objects: 64% (1030/1609)
Receiving objects: 98% (1577/1609)
remote: Total 1609 (delta 663), reused 624 (delta 160)[K
Receiving objects: 100% (1609/1609), 2.80 MiB, done.
Resolving deltas: 100% (663/663), done.
@Draiken
Draiken / error
Created July 7, 2011 19:49
error
Using nzn_categories (1.3.3) from ssh://git@201.22.7.190:2202/nzn_categories.git (at master) fatal: cannot create directory at 'lib/generators/nzn_categories/models/templates': Input/output error
warning: unable to unlink .git/index.lock: Read-only file system
Git error: command `git reset --hard 3a7e9bf2b5b17c19e6fa5c5b149393d51cb4280b` in directory /home/vagrant/.rvm/gems/ruby-1.9.2-p180/bundler/gems/nzn_categories-3a7e9bf2b5b1 has failed.
If this error persists you could try removing the cache directory '/home/vagrant/.rvm/gems/ruby-1.9.2-p180/cache/bundler/git/nzn_categories-fac222319b46267d0dbf10ecfd32fe1939ff0467'