matt.goodwin's blog

Untar on Windows or Linux

Files that are compressed make downloading them easier. But what do I do once I've downloaded my compressed .tar.gz file?

You have some choices when it comes to decompressing these files.
If you're on a Linux machine and you want to decompress a file in the current working directory, you can execute this command

$ tar -xvz drupal-6.x-dev.tar.gz

Key Apache commands to know

To start, Apache you might try one of these commands:

$ apachectl start
$ service httpd start

To stop Apache, try using:

$ apachectl stop
$ service httpd stop

If you'd like to restart Apache, try these commands:

$ apachectl graceful
$ service httpd restart

To test your config file before starting Apache. I highly recommend you run this every time you edit your config file.

$ apachectl configtest

Find records in one table but missing from another

Finding records in one table not present in another table you could use either of these two methods.
For example, you want to see all of the registered users who have yet to place an order.

SELECT users.*
FROM users
LEFT JOIN uc_orders ON users.uid = uc_orders.uid
WHERE uc_orders.uid IS NULL

Or if joins are not supported you could use the slower method


SELECT users.*
FROM users
WHERE users.uid NOT IN (SELECT uid FROM uc_orders)

Options to run your Drupal cron job

Sometimes there's more than one way to get the job done.
Here are the two options I've learned to run my drupal cron jobs.

Option 1

/usr/bin/wget -q -O /dev/null http://www.ttamniwdoog.com/cron.php

Option 2

/usr/bin/lynx -dump http://www.ttamniwdoog.com/cron.php > /dev/null