Tuesday, April 28, 2015

Commenting a block of code in vi

Many times, when modifying code or debugging, I comment out blocks of code. This is tedious to do manually.

I searched around for a way to do it fast and came across this tip:

For commenting a block of text is almost the same: First, go to the first line you want to comment, press CtrlV, and select until the last line. Second, press ShiftI#Esc (then give it a second), and it will insert a # character on all selected lines. For the stripped-down version of vim shipped with debian/ubuntu by default, type : s/^/# in the second step instead.

Thursday, April 16, 2015

Use a specific repo for installing a package

I was facing an issue at work today where I needed to install a package from a repo. The repo for that package had been created in yum. However, one of the other repos had an issue where the url for that repo was not reachable and this caused "yum install" to fail for me constantly. 

 So I wanted to a way to install my package from a particular repo and not involve any other repo. The only way I found to do this is to disable all other repos and enable only the repo I want and install the package from it. 

To do that:

yum --disablerepo="*" --enablerepo="reponame" install pkgName

You can substitute reponame and pkgName with the names of the actual repo you want to use and package you want to install.

Wednesday, April 15, 2015

Syncing a fork of github

I use github for my work and have a fork of some repositories. When I send a pull request, often I have issues with my fork being out of sync with the main repository.

Today, I synced up my fork without any issues. Here's how I did it.

Go to folder which contains the clone of of your fork.

git remote add upstream https://github.com/upstreamreponame/repo.git
git fetch upstream
git checkout master (to make sure you're on master)

If you want to make sure these changes don't show up as a checkin on ur fork:

git merge upstream/master

This worked great for me!


References:
Syncing a fork
How to update GitHub forked respository
Updating a fork directly from github

Tuesday, April 14, 2015

Welcome to my blog!

Hi!

I'm a QA Engineer and a tech nerd. I love testing and automation. I love my Mac and my iPhone. I love checking out new websites and apps.

I like learning new things everyday and would love to share what I learn every day.

Hope to see you all around!