June 2009

dstat to rule them all (iostat, vmstat, blah, blah)

dstat to rule them all (iostat, vmstat, blah, blah)

I could never remember what stat to use when trying to figure out disk usage and network usage, but now there is a dstat that handles all that. Great!

dstat

Find JPG Files in Directory and CP (copy) to another directory

Find JPG Files in Directory and CP (copy) to another directory

Today I was faced with the challenge of finding all the JPG files in a a directory (and subdirecties of that) and copying them to another directory (striping out the subdirectory folder name).

find /path/to/directory/ -iname "*.jpg" -exec cp '{}' /path/to/dest/dir/ \;

That did it perfectly.

Keywords
Find Folder Strip Path Copy cp directory

Reference:
http://www.linuxquestions.org/questions/linux-newbie-8/shell-script-to-s...

After a Magento upgrade, refreshing the Magento cache gives a blank white error screen.

After a Magento upgrade, refreshing the Magento cache gives a blank white error screen.

So you've successfully upgraded Magento and now you're rolling live on the new code and db.... You did remember to save a copy DB incase you have to back track?

You go to the Cache Management page and try to refresh the cache (just because you want to cover all your bases). After clicking the button with confidence you get a white screen, no alerts, no friendly exception report, just white.

Checklist.
1. Is your var/ directory writable by the web server?
2. Is your app/etc/use_cache.ser file writable by the web server?

yum update dies in error 'TypeError: unsubscriptable object'... yum clean all

yum update dies in error 'TypeError: unsubscriptable object'... yum clean all

While updating one of my servers today I entered this command yum update file and received the following error message.

Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 229, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 145, in main
    (result, resultmsgs) = base.buildTransaction() 
  File "/usr/lib/python2.4/site-packages/yum/<strong>init</strong>.py", line 647, in buildTransaction

Speeding up my web server

Speeding up my web server

Google has created a campaign to make the web faster, and a corresponding website to help web admins to make it so. Speed is a big factor in customer perception of your site. Google has conditioned the masses to expect instant page loads and sites that take even 2-3 seconds to load will only be tollerated for so long. Couple this with pages become more dynamic and resource hungry everyday.

Here are some changes I've made to my web server to speed things up.