Tab Completion in OSX

Since I started to use mac at work I have missed some of the nice features that you have in Linux like tab completion in bash. It is quite easy to setup in OSX.



You need to install Homebrew if you don't allready have it. It's a package manager for OS X like you can find in Linux.

http://mxcl.github.com/homebrew/

1. Install git and bash-completion:
    brew install git bash-completion

2. Add bash-completion to your .bash_profile
# Set git autocompletion and PS1 integration
if [ -f `brew --prefix`/etc/bash_completion ]; then
    . `brew --prefix`/etc/bash_completion
fi

GIT_PS1_SHOWDIRTYSTATE=true

PS1='\[\033[39m\]\u@\h\[\033[00m\]:\[\033[39m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '


To test it directly you can write:
    source .bash_profile

Now you should be able to use tab completion.

Remove a remote tag in GIT

If you need to remove a tag on the remote repository, this is how you do it:

Remove it locally:
   git tag -d mytag

Then you need to push the change to the remote repository:
   git push origin :refs/tags/mytag

GIT - Rename a remote branch

It seems that the only way to rename a remote branch is remove it and create it again. So before you start you need to be sure that all code has been committed and pushed to the branch and that you have the latest versions.

1. Rename the branch locally:
   git branch -m <old_name> <new_name>

2. Remove the remote branch:
   git push origin :<old_name>

3. Push the newly named branch to remote:
   git push origin <new_name>

Problems with Bold fonts in Netbeans for Ubuntu?

If you get bold fonts in Netbeans on menus and project tab on Ubuntu you can remove the following package.

sudo apt-get remove fonts-unfonts-core
You can also try to add the following when starting your Netbeans
 /bin/sh /path/to/netbeans/bin/netbeans --laf Nimbus

FUDS

When you are depressed your thoughts are quite different from when you are happy, if you feel creative and are happy will have a different outcome generating ideas than you are not. Nothing is more harmful to a positive creative attitude than fear, uncertainties and doubts (FUDS), yet people and companies allows FUDS to control their lives.

If we want to have a positive and creative environment we need to address the fears, uncertainties and doubts. People needs consistency, they need to know that they can trust their ability and have the information needed to make the right decisions and not think about all the problems that can arise on the way because they always know that there will be changes to the worse and decisions will be taken outside their control. It's like the difference walking in a secure or a bad neighbourhood, if we constantly need to look over our shoulders and feel fear - we will only think of what could happen and the risk of it happening, we see villains everywhere, instead of thinking of how we would spend the weekend or surprise our spouse.

GIT - Create/Delete a Remote Branch

It's really easy to create a remote branch on a distributed repository


   git push origin <newfeature>

Where origin is your remote name and newfeature is the name of the branch you want to push up.

Deleting is also quite simple:

   git push origin :<newfeature>

That will delete the newfeature branch on the origin remote, but you’ll still need to delete the branch locally with

   git branch -d newfeature.

The surprising truth about motivation

One of my favourite TED talks is Dan Pink "On the surprising science of motivation". I also read Dan Pink's book Drive - The surprising truth about motivation. Why I found the book and his talk interesting is because it helped me understand something I many times found contradictory - incentive and motivation. How incentive can be a demotivating, specially when you are talking incentives in form of reward or punishment. How we attract the wrong people that is lured by the money, but does not believe in your idea. Why people can put a lot of hours of their spare time working for free on e.g. Open Source projects, but is not motivated at work where they actually get paid for developing software. Money can be a demotivator if you do not pay enough, but is not a motivator for complex tasks. There are a lot of ways to motivate people like autonomy and mastery.

Dan Pink on the surprising science of motivation
http://www.ted.com/talks/lang/eng/dan_pink_on_motivation.html

RSA Animate
http://www.youtube.com/watch?v=u6XAPnuFjJc