admin's blog

Mysql - dropping all tables without dropping the database

This snippet is real handy if you don't have CREATE TABLE and GRANT permissions. mysql --user=YOUR_USERNAME --password=YOUR_PASSWORD -BNe "show tables" YOUR_DBSCHEMA_NAME | tr '\n' ',' | sed -e 's/,$//' | awk '{print "SET FOREIGN_KEY_CHECKS = 0;DROP TABLE IF EXISTS " $1 ";SET FOREIGN_KEY_CHECKS = 1;"}' | mysql --user=YOUR_USERNAME --password=YOUR_PASSWORD YOUR_DBSCHEMA_NAME via http://knaddison.com/technology/mysql-drop-all-tables-database-using-single-command-line-command (in the comments)

Drupal Training in Minneapolis March 16th!

What do the Obama Administration, Duke University, Rutgers University, The Economist Magazine, the United Nations, Sony and Warner Brothers have in common? They are all using the Drupal Content Management System

Setting time on Ubuntu server

I had a lot of trouble setting my Ubuntu server's system clock. date, ntpdate, and the ntp severver daemon will are failing to set the date/time. Apparently if you are running linux with 2.6.18 kernel you need to detach from the host's clocksource

Displaying CCK Fields in a Region

Sometimes you want to move a cck field out of the main content area and put it in a region like a left or right sidebar.

There are some options for this that include a number of modules and perhaps panels, but I wanted a lighter weight solution and the solution is: CCK and Views!

My goal here was to have a related content block for a given node of type page. So:

Step 1: create a cck node reference field that references other page nodes (or any other content type you'd like to use).

Step 2: create a view called related_pages.

Bring Sanity to Your Web Site (& Your Life)

Only 5 seats left. Sign up at http://www.strategicit.org/sanity

Sanily

Photo by http://www.flickr.com/photos/darkpatator/ / CC BY 2.0

NO CHARGE :: Class Limited to First 15 Applicants