How to debug Apache RewriteRule or mod_rewrite

apache

It’s hard to debug Apache RewriteRule (mod_rewrite) problems, especially when you have multiple rules. With applications like WPMU, it can be especially tough because WPMU may likely be doing it’s own RewriteRules. One trick is to turn on the rewrite log. To turn it on,try these lines in your .htaccess or virtual host file: If [...]

Read the full article →

WPMU is not generating robots.txt file

wpmu

I was setting up a new WPMU blog and checking my robots.txt file.  But all I got was a 404 Page Not Found.  It seems that WPMU was dynamically generating the robots.txt file. Why?  The answer was that I had no posts.  As soon as I added the first post, robots.txt was being generated just [...]

Read the full article →

7 Handy Firefox Shortcuts that I Use Most Often

firefox shortcuts, tweaks, and tips

Here are some handy  Firefox shortcuts that I use all the time: 1) crtl-k — puts the cursor in the google search box. 2) crtl-l (that’s an L) — puts the cursor in the URL box. 3) ctrl-tab –  switch tabs (forward) 4) ctrl-shift-tab  — switch tabs (backwards) 5) ctrl-t  — opens a new tab [...]

Read the full article →

How to install PHP GD2 library on Ubuntu

php

I needed to install the PHP GD2 library to support the WordPress captcha plugin SI CAPTCHA Anti-Spam.  I found the right library and installed it with this apt-get command: But SI CAPTCHA Anti-Spam test page still said GD Support: No.  The fix?  I had to restart apache: I tried the SI CAPTCHA Anti-Spam test again, [...]

Read the full article →

How to easily view the end of a log file

newbie

Ubuntu/Linux log files can be quite long with many entries, but usually you only care about the end. So, how can you quickly view the last few entries in a log file? Use the tail command: To watch the latest output as it happens, use the -f flag When you are done viewing, use CTRL-c [...]

Read the full article →

How to view the current time from the command line

command line

To see the current time from the Ubuntu or Linux command line: date which will give you: Fri May 30 15:53:21 EDT 2008 To see how to include and format dates and times in your shell scripts, see this post: http://www.lifeonubuntu.com/2008/05/how-to-format-dates-in-shell-scripts.html

Read the full article →

How to format dates in shell scripts

date time

When using dates in a shell script, you can format them like this: $(date +[format]) Here are some examples: $(date +”%Y%m%d)20080508 ——————– $(date +”%Y-%m-%d)2008-05-08 ——————– $(date +%D) which is shorthand equivalent for $(date +”%m/%d/%Y) 05/08/2008 To include time: $(date +%r) 10:15:36 PM ——————– $(date +%T) 22:15:36 A typical date format for a log entry: $(date [...]

Read the full article →

How do I know which kernel I am using?

newbie

How do you know which linux kernel you are using? uname -kFind out other system info withuname -a

Read the full article →

How to prevent server (daemons) from starting during apt-get install

newbie

Some times you may not want a server or daemon to start as part of the postinstall scrip when installing with apt-get or dpkg. To prevent servers from starting, do the following: # Prevent launch of servers during apt-get install mkdir -p /usr/sbin/ cat < /usr/sbin/policy-rc.d #!/bin/sh exit 101 EOF chmod 755 /usr/sbin/policy-rc.d When you [...]

Read the full article →

Newbie: how to edit a file from the command line

file commands

Could there be any more basic question? We all know there are no stupid questions, but I sure felt dumb having to look up this one. I found the built in editor nano. Likely more searching will yield a better editor. But for now nano will work. For other newbies, note that you need to [...]

Read the full article →