Wednesday, February 28, 2018

Tuesday, February 27, 2018

automount nfs share on boot




You just mounted nfs share in a directory.

Now you wish to make this permanent by updating etc/fstab.


You can do this:

 cat /proc/mounts   | tail -1 >> /etc/fstab

Here, we update last entry into fstab.

check /etc/fstab and adjust according to your needs.


Sunday, February 11, 2018

Solution for Box not found error in Vagrant



I was facing this error:

The box 'centos/7' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:

URL: ["https://atlas.hashicorp.com/centos/7"]
Error: The requested URL returned error: 404 Not Found



Adding this line in Vagrantfile helped:

++Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com')
Vagrant.configure("2") do |config|


source: https://github.com/hashicorp/vagrant/issues/9442#issuecomment-363080565

Wednesday, February 7, 2018

multiple commits in a PR




I ended up with multiple commits in my PR after a rebase (and followup push) in my "working" branch.


Solution:

I first copied those few files which I have modified/ added into a temp directory (along with entire path).

then reset my branch with origin/master.

git reset --hard origin/master

So, now the "working" branch is in sync with master branch.



Now, copy back all those files from temp directory into the "working" branch.

Carried out a fresh commit with all changes and verified all changes looks fine.


Then, just did a force push as :

git push --force

Now, you can check in github whether only one commit with required changes present.

Lesson:
Always verify git status before a push especially after a rebase.

PS: not an optimal solution, but manual way.

Monday, February 5, 2018

store vagrant boxes in custom directory



By default vagrant stores  boxes here at ~/.vagrant.d/boxes

Sometimes, we want to make use of custom location instead of above.
you can make use of VAGRANT_HOME directory.



export VAGRANT_HOME=/path/to/yourown/location

You can make it permanent by adding the above in your bashrc file.

link: http://docs.vagrantup.com/v2/other/environmental-variables.html