Saturday, November 19, 2016

convert a project directory into new github repo

go to project directory and do following -

git init
git add .

create a repo in github

generate and add public ssh key to git user account under Settings -> SSH and GPG keys

if you get the error "Key already used", you might have used the key in some other github repo
Either you can remove it or create a new pair using following command (NOTE: Press ENTER if it asks for any input to choose default options)
ssh-keygen -t rsa -f ~/.ssh/id_rsa.home

copy contents of id_rsa.home.pub to github

Add the private key to ssh-agent
ssh-add ~/.ssh/id_rsa
If you have generated a new pair, you may need to add the private key (Source: Generate and Add new key)
git remote add origin git@github.com:gituser/myrepo.git
to see impact of above command
git remote -v

You must be ready by now to push to remote repo
git push origin master

Friday, November 18, 2016

Django vs PYTHONPATH and the not found error

a must read post for those who still struggle with the path gymnastics

http://musings.tinbrain.net/blog/2012/mar/15/django-vs-pythonpath/

remember - adding both project and app paths in PYTHONPATH is NOT the RIGHT solution

Must read post for newbies to postgresql setup

It is really frustrating that a well established database like postgresql doesn't work out of the box.
It can be a big turn off for a newbie.

Following post wrote exactly what a newbie will typically go through
http://theprogrammersdiary.blogspot.in/2013/02/nightmares-of-postgresql-with-django.html

start postgreql vs postgres start

To have launchd start postgresql now and restart at login:
  brew services start postgresql

Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgres start

Saturday, November 12, 2016

MongoDB installation on Mac OS via brew

After installing MongoDB with Homebrew:

  • The databases are stored in the /usr/local/var/mongodb/ directory
  • The mongod.conf file is here: /usr/local/etc/mongod.conf
  • The mongo logs can be found at /usr/local/var/log/mongodb/
  • The mongo binaries are here: /usr/local/Cellar/mongodb/[version]/bin
Source: http://stackoverflow.com/questions/13827915/location-of-the-mongodb-database-on-mac

update database index for locate command on mac OS X

update database index for locate command on mac OS X

sudo /usr/libexec/locate.updatedb