Programming

Export a mysql database on the command line

$ mysqldump -u DBUSER -p DBNAME > DBNAME.sql

Finding your python site-packages directory

python -c “from distutils.sysconfig import get_python_lib; print get_python_lib()”

Installing Django on Ubuntu 10.04 LTS

check your hostname is set properly: >hostname >hostname -f update the server: apt-get update >apt-get upgrade install apache and mod_wsgi: >sudo apt-get install apache2 libapache2-mod-wsgi and install setup tools for python, and pip: > sudo apt-get install python-setuptools > sudo apt-get install python-pip Pick a database: >apt-get install mysql-server python-mysqldb >apt-get install postgresql python-psycopg2 >apt-get [...]

Typical github steps moving in a new repository

Global setup: Set up git git config –global user.name “Dave Parizek” git config –global user.email dude@wherever.com Next steps: mkdir UAC cd UAC git init touch README git add README git commit -m ‘first commit’ git remote add origin git@github.com:BioComputing/UAC.git git push -u origin master Existing Git Repo? cd existing_git_repo git remote add origin git@github.com:BioComputing/UAC.git git [...]

Import a sql dump into mysql on command line

# mysql -u USER -p DBNAME < dump.sql

Restarting Apache, different ways

Just reference for restarting apache, different strokes for different servers: # /etc/init.d/httpd restart # /etc/init.d/httpd start # /etc/init.d/httpd stop # service httpd restart # apachectl -k graceful sometimes you need sudo because it might only see the path from root  

Oops, deleted super user Drupal 6, what to do? maybe you emptied user table?

I left my thinking cap off and emptied the user table of a dev Drupal 6 site I was working on. If that happens to you, just access your database with phpMyAdmin or similar, and: INSERT INTO users (uid, name, pass) VALUES (’1′, ‘yourname’, md5(‘yourpassword’)); then edit the users table further to add your email [...]