Friday, May 30, 2014

Vagrant, setting multiple IPs on a box

The official doc gives example only for 1 IP: http://docs.vagrantup.com/v2/networking/private_network.html

Vagrant.configure("2") do |config|
  config.vm.network "private_network", ip: "192.168.50.4"
end


Googling around I could find only 1 example of Multiple IPs:

https://groups.google.com/forum/#!topic/vagrant-up/hqtdOEjjlsw
Vagrant::Config.run do |config|
  config.vm.define :web001 do |config|
    config.vm.box = "base"
    config.vm.forward_port("http", 5000, 8881)
    config.vm.forward_port("ssh", 22, 2222)
    config.vm.host_name = "web001.example.com"
    config.vm.network("33.33.33.10")
    config.vm.network("33.33.33.20", {:adapter=>2})
  end
end 


but it doesn't work for me...

Any help would be greatly appreciated....

PS the question was answered here just do a:
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "precise64"

  config.vm.network "private_network", ip: "192.168.50.4"
  config.vm.network "private_network", ip: "192.168.50.5"
  config.vm.network "private_network", ip: "192.168.50.6"
  config.vm.network "private_network", ip: "192.168.50.7"

end


I thought I had tried it before and didn't work... but it DOES work! Great!



Saturday, May 24, 2014

Book: git version control for everyone



The book has the PLUS of being very simply explained (although quite verbosely) and it focuses on some fundamental aspects of GIT which are very useful.

The MINUS is that it's for Windows users (they should have mentioned that in the title) and wastes a lot of real estate in UI snapshots - as always when you talk about Windows.

Also, I didn't appreciate the use of the video-games paradigm...especially when it comes to neo-nazist games like Contra (freely inspired by the murderous death-squadrons who tortured an killed scores of civilians in Nicaragua) or Counter-Strike - which seems more or less the same violence-inspiring, brain-washing shit.

Buy it if you are a REAL beginner and you don't mind wading through some idle talk.



git bare repository

mkdir  repo1
cd repo1
git init
Initialized empty Git repository in C:/pierre/gittests/repo1/.git/

this repo1 will contain the .git folder with hooks, info, objects, refs

mkdir  barerepo2.git
cd barerepo2.git
git init --bare
Initialized empty Git repository in C:/pierre/gittests/barerepo2.git/

this barerepo2.git will contain the same files/folders that were in the previous non-bare .git folder,
but they will be directly in C:/pierre/gittests/barerepo2.git/, rather than in C:/pierre/gittests/barerepo2.git/.git

The idea behind a "bare" repository is to use it only for "shared" storage of a project,
and not as a working project. So, "bare" repo is used only on a git server, not on a workstation.
To quote SO:
A bare repository is a git repository without a working copy, therefore the content of .git is top-level for that directory.

By convention, folder containing a bare repo should carry the .git extension.

In the config file there will be a "bare = true" setting.