How to see list of all cron jobs from every user

So I knew I had a cron job running but couldn’t find it.  You can run this command and it will list all the users, whether or not they have any crontab, and if they do, will list it.

 for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
Posted in Uncategorized | Leave a comment

How to set Server, Mysql, PHP times on your server …

I can never seen to get my apps all running on the correct time.  This usually messes up my stats, charts, and things of that nature.  Here is how I got mine straightened out.

At the command line type the following to see the server time:

# date

Then to change that time to the correct time you want for the server type:

# date +%T -s "11:18:18"

Where

  • 11: Hour (hh)
  • 18: Minute (mm)
  • 18: Second (ss)

Next check your my.cnf file which is usually located in /etc

Mine currently says this:

default-time-zone = ‘-07:00′

To be honest, it didn’t seem to work right away, but eventually after trying some numbers, it seems that -7 hours does the trick.

Last, I went into my php.ini file, also usually located in /etc  and I checked the timezone there.  I set mine to Los Angeles time.

date.timezone = America/Los_Angeles

Now the apps I use all show synced, correct time.

Server Time
PHP Time:
7/18/2011 11:15:15 AM
MySQL Time:
7/18/2011 11:15:15 AM

 

Posted in Uncategorized | Leave a comment

Really Google? You think you can tell when someone buys backlinks?

So it seems Google thinks it can tell when someone buys backlinks … and in turn, will penalize said website. Well, that should be interesting since the obvious reason Google hasn’t yet done this is that it would make it extremely easy to sabotage a competitors website by simply giving him some [as deemed by Google] unkind links. These might result in a letter from Google such as this:

Dear site owner or webmaster of http://www.domain.com/,We’ve detected that some of your site’s pages may be using techniques that are outside Google’s Webmaster Guidelines.

Specifically, look for possibly artificial or unnatural links pointing to your site that could be intended to manipulate PageRank. Examples of unnatural linking could include buying links to pass PageRank or participating in link schemes.

We encourage you to make changes to your site so that it meets our quality guidelines. Once you’ve made these changes, please submit your site for reconsideration in Google’s search results.

If you find unnatural links to your site that you are unable to control or remove, please provide the details in your reconsideration request.

If you have any questions about how to resolve this issue, please see our Webmaster Help Forum for support.

Sincerely, Google Search Quality Team

Seroundtable.com

Which then begs the question – how does one fix links to a website that you did not cause to be there and have no control over?  Well?  Google?

Posted in Uncategorized | Leave a comment

How to check for server being full – command line guide

Check the free space:

df -k

Also check your MYSQL log:

tail -n 50 /var/log/mysqld.log

Is my drive full?

# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2            236312448 224140016         0 100% /
/dev/sda1               101086     11157     84710  12% /boot
tmpfs                  2074788         0   2074788   0% /dev/shm

Yes this is why you are having issues with MYSQL.
You need to remove files to free space.
I recommend for a quick fix to get rid of big log files:
1. First stop MYSQL. This may take a while but it should eventually stop:

service mysqld stop

2. Go into your log directory

cd /var/log

3. List the files in human readable format

ls -alrth

4. You will want to remove the files in the hundreds of megs. Likely candidates are (messages.2, secure.1 etc)

rm -f filetoremove

5. You will also want to clear out your httpd files:

cd /var/log/httpd

Then repeat step 3 + 4 for httpd.

6. Restart MYSQL

service mysqld start

7. Check the MYSQL log for any corruption

Posted in mysql, server | Leave a comment