Thursday, 29 November 2012

Starting a new django project

Prerequisite:
  1. python-2.7
  2. virtualenv
mkdir mysite && cd mystie

virtualenv --distribute --no-site-packages venv

.venv/bin/activate

pip install Django psycopg2 dj-database-url

django-admin.py startproject hellodjango .

python manage.py runserver # to see if it's working

#### The following is platform sepecific

pip freeze > requirements.txt

# touch Procfile and edit

git init
git add
git commit -m "first commit"

# deploy

Wednesday, 28 November 2012

Mac trick for a fast hiding dock

davecap:

If you want to increase the speed that the dock hides and shows, and remove the delay so that you don’t waste those precious milliseconds, copy/paste these commands into your terminal:
    defaults write com.apple.dock autohide-time-modifier -float 0.05
    defaults write com.apple.dock autohide-delay -float 0
    killall Dock
  
You now have a fast hiding dock!

Monday, 19 November 2012

Common Unix Printing System (CUPS)

Use CUPS to add/delete/modify printers!
http://localhost:631/

Common network printing protocal:
socket://
ipp://
lpd://

Friday, 9 November 2012

MAMP - mysqlcheck: Got error: 1045


learned from http://www.nyayapati.com/srao/2011/03/mamp-mysqlcheck-got-error-1045/

MAMP - mysqlcheck: Got error: 1045

I started seeing the following error every time I started MAMP. This began after I changed the root password for my MAMP installation on my MBP.
1
/Applications/MAMP/Library/bin/mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
It turns out that the default password is hard coded in different scripts under ‘/Applications/MAMP/bin’. In my case the script quickCheckMysqlUpgrade.sh. Just edit the script to have the correct password and you wont see the annoying message again.

Restarting launch pad

Restarting launchpad:

  • Launch Terminal
  • Navigate to the Application Support folder in question and open it
        cd ~/Library/Application\ Support/Dock && open .
      
  • Drag all .db files to the trash.
  • Restart Dock (require authentication)
      
        sudo killall Dock