Tips of the Day

Vote on HN
  • dumping and restoring databases from RDS
  • connecting to Twitter via oauth using python
  • python debugger in Django

Backup and Restore to RDS


mysqldump -h -u root -psecret database_name table_name  | gzip > backup.sql.gz

table_name is optional, and you can pass a -9 to gzip to maximize compression


gunzip < backup.sql.gz | mysql -h -u root -psecret database_name

Python Twitter OAuth

Download sample code

Grab oauth library, and drop it on your python path. Don't use the egg because there are problems with it.

If you're using cookie based sessions and developing locally, make sure your callback url is consistent with your local dev url. I had the callback url set to, but I was accessing the application via http://localhost:8000/, so the cookies weren't being set properly. The fix was to access the app from instead.

Python Debugger in Django

import pdb; pdb.set_trace()

Equivalent of 'import ruby-debug; debugger' in ruby.

comments powered by Disqus