Archive for 'May, 2010'

Home » Archives for May 2010

Fixing error “Unable to create directory” or “The uploaded file could not be moved to” in WordPress

Posted in: SysAdmin
  |  by: Wesley David
Tags: facepalm, web, wordpress

Someone I know was having issued with their WordPress installation. Since I’ve been using WordPress for ages (about ten days), I figured I’d have a look. Plus, I was the only one that he knew with technical experience. And his blog URL was printed in a periodical that was due to be shipped in two weeks, so expectations were running a little high. Sweet.

Every time an image was uploaded the following error was encountered:

Unable to create directory
/var/www/vhosts/domain.com/httpdocs/blog/wp-content/uploads.
Is its parent directory writable by the server?

I manually created the directory, and received a new error:

“The uploaded file could not be moved to /var/www/vhosts/domain.com/httpdocs/blog/wp-content/uploads”

After some sleuthing, it seemed to be an issue with PHP Safe Mode being enabled for the entire domain. There is a lot of differing opinions on how to address turning safe_mode off or even if you can turn it off for individual directories or not.

I’ll spare you the details, but let’s just say I got an unexpected self-taught crash course in PHP. After spending all morning on the issue, I ended up having the web host turn it off for the entire domain (something only they could do on the backend). The problem still persisted.

I came upon the answer after I changed the keywords I was using in Google. It’s so simple, I almost didn’t post it here. However, I am the Nubby Admin so it’s not like anyone has high expectations for me.

Solution:

First create the wp-uploads folder in the wp-content folder. Then change the permissions on wp-uploads to 777. I’m sure there are other possibilities, but that seemed to be the most straight-forward way.

Facepalm

Hopefully the search engines will smile on this post and save someone a morning of phpinfo() and ini_set().

12MAY
2
Tweet

Display a file’s size in kilobytes using Windows PowerShell

Posted in: SysAdmin
  |  by: Wesley David
Tags: PowerShell, Windows

You’d think this wouldn’t be that hard of a task. However, I spent about an hour wading through misinformation and poor code snippets to figure this out.

To determine a file’s size from within PowerShell, use the following snippet:

$var = Get-Item [filename]
$var.length

In my specific case, I used:

$file = Get-Item .g2mdlhlpx.exe
$file.length/1KB
70.390625

So why all the confusion? After a right thorough search of Google, I came back with what I eventually figured out was some pretty crazy things. One was even from a Microsoft MVP who said to load a variable with files thusly:

$var = "file.txt"

The problem with that was that executing ‘$var.length’ always returned “8”. See why? I eventually figured out that it was because I was feeding the variable a string. I know, this is scripting 101. No, this is scripting 001. I’m a Windows admin. Cut me some slack.

The secret is in the use of the cmdlet Get-Item. Huzzah! It was the good folks at #PowerShell on FreeNode (Thanks BartekB!!) that dispelled my confusion in seconds flat.

I can only hope that my blog post will make it’s way up the search engine rankings to dispel some of the confusion.

12MAY
4
Tweet

The Wisdom of Versioning your Backups. One Isn’t Enough

Posted in: SysAdmin
  |  by: Wesley David
Tags: Backups

Is anyone else as paranoid about versioning their backups as I am? For me, it’s not enough to simply backup a file or system. It’s not enough to know the backup was “successful” (whatever that means… which is a whole ‘nuther post). Imagine this simple scenario:

You backup a folder. You get an email alert saying whether the backup was successful or not. Every day you receive an email saying things went peachy. A user calls and asks for a file to be restored from that folder. You check the backup and can’t find the file. They deleted it three days ago. You backup once every 24 hours. The user’s deletion has been set in stone. “Game over, man!”

glory-to-the-bandlaufwerk

Of course, this probably wouldn’t happen to anyone because of a thing that most backup programs create called “backup sets”. But what about the things you don’t backup with a big, shiny, overpriced software package? What about the things you script out with rsync, robocopy or just good ol’ cp?

Here’s my latest real world example. I use a private Zoho wiki to document everything IT related for one of the places I do work for. Don’t worry, passwords are the only exception to that rule. I wanted to back that wiki up lest a datacenter error or a Zoho hiccup caused that very valuable information to disappear.

There are two ways to backup the wiki. First is by manually clicking a download link in the Wiki’s settings page. The second way is with a unique URL that a direct connection can be made to for scripting purposes. The wiki is bundled into a zip file and coughed up to the script that accesses that URL.

Since automation is the way for a SysAdmin to go, I started making a simple PowerShell script using the BitsTransfer module. No problems! Now I can schedule this to backup once a day! Oh but wait…

What if I end up needing some information that I deleted from a few days back (Hint: Delete nothing! Put the page or text in a junk bin somewhere on the wiki)? What if there was a Zoho-side error that nuked some info and I didn’t notice it until later (that happened once)? My 24 hour window doesn’t seem big enough to let me sleep well.

Okay, so let’s put some logic in the script. I’ll check to see what day it is and make a new backup file for each day of the week. That should give me enough time to notice almost any error and recover it. And if not, I can always expand it to check for the month’s day thereby going up to 31 days in the past. Or even 365 if I wanted to make a giant If / Else statement pagoda.

Done! Now I have 7 days of unique, full backups for my documentation wiki! Oh but wait…

What if the backup works but pulls down an empty zip file (happened once)? What happens when I leave this job site and move on to other jobs (which will happen soon) and I’m not looking at the wiki every day to notice changes? How do I know that what I’m downloading is meaningful?

Let’s add some more logic to the script. Let’s check the file size after it’s downloaded and send an email if it’s under a certain size. The current size is 1.2MB so let’s check to see if it falls below 1MB.

Super! We’re one degree removed from clinical OCD. Of course, there’s no guarantee that the 1MB of data in the zip file is actually useful. Maybe I just downloaded 1MB of random hex characters. However, I’ll accept this as reasonable enough to be comfortable with. Oh but wait…

That wiki will grow over time. From 1.2 MB to 2.4MB to… who knows how big? I like to include screenshots in m documentation so one PNG or JPG will bump it up a hundred kilobytes or so. That hard-coded 1MB threshold will be outdated soon. I’d like to base my warning be based on a statistical deviation of sorts.

Let’s add some more logic to the script. Let’s check the last backup’s size, compare it to the latest backup’s size and then send a warning if the newer backup is more than 100KB smaller than it’s predecessor. Sweet! I think I’ll go straighten the tassels on my throw rug now.

Now I have a week’s worth of backup versions as well as logic and alerting to warn me of unexpected decreases in the backup’s size. If anyone is interested in seeing the PowerShell script, let me know and I’ll post it. It’s the forecasted winner of the Ugliest Script in the World 2010 pageant.

What say ye? Do you get paranoid about versioning your backups? Do small windows of restoration keep you up at night? Do you know that replication is not a backup? What’s your story about slim restoration windows (both happy and unhappy endings are welcomed)? Guest post slots are available.

P.S. While writing this, Matt Simmon’s post at simple-talk.com called  “Unteachable Disaster Recovery Techniques” came to my mind. In short, it helped solidify my understanding that “Replication is not a backup”.

Also applicable is the painful story of how Ma.gnolia went down because the only backup that was being done was a database replication. Ouch. Learn from others’ pain.

10MAY
0
Tweet

Speed Reading; Week 4 Finished!

Posted in: Productivity
  |  by: Wesley David
Tags: Speed Reading

The first full month of my attempt at staying faithful to my chosen speed reading curriculum is now finished. This was the most consistent week so far. I only missed one lesson. That might be overstating my success a little since some lessons were done hurried or were interrupted, but at least the habit of performing the lessons is more ingrained in me.

  • Monday:
    • Morning: Lesson 6
    • Evening: Lesson 6
  • Tuesday:
    • Morning: Lesson Lesson 7
    • Evening: Lesson Lesson 7
  • Wednesday:
    • Morning: Lesson 7
    • Evening: Lesson 7
  • Thursday:
    • Morning: Lesson 8
    • Evening: Missed
  • Friday:
    • Morning: Lesson 8
    • Evening: Lesson 8
  • Saturday:
    • Morning: Lesson 8
    • Evening: Lesson 8

I’m continuing to work against the habit of speaking words in my mind. I’m having more and more success at comprehending the text I read. The last three weeks has been focused more in reading technique and less on comprehension. Now I’m getting comprehension much better.

All of these efforts are to help focus my mind on reading, which is something of a challenge. My mind tends to wander and overanalyze what I’m reading while I’m reading it. Speeding up my reading forces me to focus on the text alone. After absorbing the material, I can then go back and mull over its contents better than I could before since I have the whole picture of the text.

Does anyone have any experience with speed reading? Have you found the scams? Found any gems?

Onward to week 5…

9MAY
0
Tweet

IT Departments are now Officially/h*10 “Supposedly” Filled with the Scum of the Earth

Posted in: SysAdmin
  |  by: Wesley David

EDIT: Later in the day after posting this, I edited the title to show more objectivity. This video doesn’t dive deeply into the numbers and methods involved in the study that rendered the conclusions the video’s presenter spoke of. END EDIT

A simple Corporate Executive Board video knocked me back in surprise. In just under 3 minutes, Jaime M. Capellá explodes two of the traditionally held views of IT workers:

  1. That we’re hard workers who put in long hours to get the job done
  2. That we’re honest and moral. Okay, maybe this one wasn’t as strongly held as the first one.

[flashvideo file=http://thenubbyadmin.com/wp-content/uploads/2010/04/MoraleandProductivityUPDATE.flv  /]

I was most shocked at the allegation that IT workers are no longer standing out for being hard workers and putting in long hours. Is this because other departments are now being pushed to and beyond the frenetic pace that we are? Or are we finally getting fed up with the near abusive workloads that we sometimes have to put up with and pushing back?

As for the morallity of IT workers, it’s long been joked that we sysadmins peruse HR documents and read people’s email.

And in fact, it seems to me that it’s not too hard to come across someone in the field who does just that. However, by and large I liked to think that IT people had a sense of duty (even if it was born from an unhealthy “hero complex”) which tended to instill stoic integrity in us. If that was ever true, apparently it’s not now. Why is that? No correlations were suggested in the video.

I do like the way these problems are supposedly being dealt with. Two-way communication, leaders owning up and walking the talk and also investing in employee development. For too long I’ve heard of stone-wall bosses, two-faced managers and zero budgeted dollars for IT training.

What do you think? Have you experienced this shift? Are you working less hours because you’re fed up or are your bosses relenting? Have you experienced dishonest coworkers more frequently than you did a few years ago? Have you done something a little shady? Anonymous comments are available and I won’t give out your IP information… unless the SWAT team kicks my door down.

7MAY
11
Tweet

What Really Happens Inside a Web Server

Posted in: SysAdmin
  |  by: Wesley David
Tags: apache, mysql, web

This comic created by Flickr user Dan King (dannyk6) is a funny but oh-so-true explanation of how an end user gets their web pages delivered to them from a typical CMS based website (much like this very blog). Clicking the image above takes you to Dan King’s blog where you can see the full comic.

This made me stop and think. Have you ever considered the raw complexity that is within each and every personal computer that you touch? What about every enterprise class server or appliance? The things that were luxurious a few years ago are now open sourced, given away and hissy-fit material if our vendor doesn’t supply it yesterday.

Maybe I was primed for this topic since I’ve been working on more web based sysadmin tasks (WordPress, Joomla, Apache… I don’t know if I want to marry mod_rewrite or assault its creators). However, give pause for a few moments and think how far things have come.

Be thankful we don’t have to code in octal or worry about registers. Unless you like that sort of thing, in which case you should probably go organize your magnetized needle collection.

6MAY
0
Tweet

Vanishing IT Departments – Reducing the Technologist Pool or Just a Population Shift?

Posted in: Business, SysAdmin
  |  by: Wesley David
Tags: MSP

An article on ZDNet was both saddening and encouraging at the same time. “The Vanishing IT Department” summarizes a Corporate Executive Board report that predicts that corporate IT departments will have shrunk by 75% by the year 2015.

The article makes perfect sense to me. IT is no longer an advantage in and of itself for a business to have; it’s just par for the course. The emphasis is now on refining IT services to specific business units’ specifications. That means that not only will IT become more decentralized by aligning itself with individual business units, portions of IT  will also be outsourced to external specialist service providers that have refined their specialist offerings.

The overall population of technologists won’t be reduced, the population’s distribution will simply shift.

The standalone, distinct IT department is becoming obsolete and inflexible and its monolithic days are numbered. That makes me a little sad. I’ve had the privilege of working part time in an IT department at a mid-sized organization. I know first-hand the camaraderie and just plain fun that a centralized IT department can have designing and implementing technology for various departments.

I also know the difficulty that is inherent in one team attempting to see, feel and meet the needs of widely disparate departments. I see the need for IT to be less monolithic, but part of me doesn’t like it. Why? Because I’m hideously selfish. However, IT isn’t there for it’s own (or my own) enjoyment.

I’ve also done a lot of “Standalone / Lone Sysadmin-ing” (apologies to Matt Simmons and Bob Plankers) from an outside contractor perspective. It’s not as fun to be an outsider. I have been hoping to find employment with an internal IT department (or becoming a small business’s IT department) and leave my days of an informal consultant/contractor role behind. It feels cold and lonely sometimes and I don’t particularly like it. :’(

Stop Crying Your Crying is Making Dawson CryOkay, I’m better now. So what was the encouraging part to me in all of this? In case you haven’t seen any previous blog posts about my endeavors, I’m starting a business. My intent is to become an LLC so that a friend can contract me for a specific job he needs done. However, I started getting this crazy notion to run further with the business and become a managed and/or hosted services provider.

While IT isn’t for it’s own enjoyment, I believe that you can’t persist at doing something that you don’t like. I don’t like constantly doing help desk work or installing LinkSys routers. I want to work on WAN optimization projects, multi-site software deployment strategies and servers that are so powerful the earth’s magnetic field is warped just from turning it on.

When I think “MSP” I think of a whole lot of printer jockeying and hard drive swapping. Yuck. However, as things stand right now, MSPs can service much larger organizations in the form of specialized services. Examples include designing storage solutions, database clusters, high availability, backup and disaster recovery strategies, and more.

The above ZDNet article encourages me that the outsourced IT industry will only continue to grow and the projects that will be outsourced are larger and more exciting than was previously common.

In fact, I’m thinking less “MSP” and more “IT Solutions Provider”. Add some hosted services to the portfolio and you’ve got more fun than a box full of ADHD puppies on Red Bull. I’m drawing some inspiration on the business offerings of OmniTI. There’s plenty of pie to go around, so Theo has nothing to worry about from me. Plus… I’m nubby so he’s got that advantage going for him. Oh, and he employs 40+ embodied brains that write books and speak at conferences and things.

What have you experienced in your own IT department? Increased outsourcing? Or are you a contractor, MSP, ISV, etc. that is seeing an increase in business? Do you welcome this or rue the day when you’re IT department needs only two pizzas to feed it? Most importantly: Are you ready for the shift? (I.e. Would you work for me? =) )

(Post updated on May 17 for spelling and grammar refinement)

5MAY
0
Tweet

Find what floats your *.boat { with this giant list of CSS Galleries }

Posted in: SysAdmin
  |  by: Wesley David
Tags: css, web

The thoughts of a soon-to-be business owner are deep and muddled. In between Form 8832s and 1099 MISCs are more aesthetic muses. I’d very much like to have a simplistic but personality-chocked website that can grow with me as time goes on and my business offerings (hopefully) grow.

I’ve been perusing CSS and site design galleries like CSSElite.com and Open Source Web Design for inspiration. Just when I was considering compiling my own list of site design galleries I was just made privy to a ginormous list of CSS design galleries: www.thecssgallerylist.com

Think of something the size of The Black Sea, add the square footage of Moldova and then double it. That’s how big The CSS Gallery List’s coat closet is. With my estimation of 200+ CSS galleries listed, if you don’t find something that you like then you need to consider Lasik surgery or check into the Betty Ford Center.

I was disappointed, however, that I didn’t find any open source web design galleries on the list. I’ll fill in that tiny gap with my own list. The designs on these lists are released under various Creative Commons / GPL licenses. Check each template before you use it:

  • Open Source Web Design: http://www.oswd.org/
  • Free CSS: http://www.free-css.com/
  • Open Source Templates: http://opensourcetemplates.org/
  • Open Web Design: http://www.openwebdesign.org/
  • Open Designs: http://www.opendesigns.org/
  • Open Source Web Templates: http://www.oswt.co.uk/
  • Open Source Design: http://www.opensourcedesign.com/
  • OS Templates: http://www.os-templates.com/
  • Free CSS Templates: http://www.freecsstemplates.org/ (Added March 4, 2010)

Did I miss any? Let me know if you have any other CSS/HTML galleries that have templates under a CC, GPL or copyleft license.

3MAY
0
Tweet

Speed Reading Week 3 Finished!

Posted in: Productivity
  |  by: Wesley David
Tags: Speed Reading

My third week of speed reading lessons wasn’t too bad.

  • Monday:
    • Morning: Lesson 4
    • Evening: Lesson 4
  • Tuesday:
    • Morning: Lesson 4
    • Evening: Lesson 4
  • Wednesday:
    • Morning: Lesson 5
    • Evening: Lesson 5
  • Thursday:
    • Morning: Lesson 5
    • Evening: Missed
  • Friday:
    • Morning: Lesson 5
    • Evening: Missed
  • Saturday:
    • Morning: Lesson 6
    • Evening: Missed

I got off to a great, consistent start! Thursday, Friday and Saturday were busy, I accept guilt that the last half of Friday and Saturday was a failure of time management. However, all in all it was a great week.

I made a major vision breakthrough. Instead of focusing my eyes on a single point in the sentence, I am now capable of focusing on the general area and taking in multiple words at a time. This is helping to break the habit of speaking the words in my mind.

My lesson bundle goes up to lesson 10. To go from Lesson 11 to 20 I’d have to purchase the second bundle. If this improvement keeps up, I might have to consider buying the second bundle.

My technique for reading is improving rapidly, but my comprehension is improving more slowly. It’s just plain fatiguing to suck that much info in. However, it is improving so that’s good. I’m still skeptical about 1000+ WPM speeds with 100% comprehension.

Anyone out there have speed reading experience? Any insights to share? Week 4, here I come…

2MAY
2
Tweet
Page 2 of 2 12

Advertisements


Follow This Blog





Want to have these posts emailed to you? Enter your email address here. Google Feedburner takes care of the rest!



Delivered by FeedBurner

Learn More About Me!

Contact Me!

Talentopoly Jobs:


The Nubby Archives

  • [+] 2013 (17)
    • May (3)
    • Apr (5)
    • Mar (5)
    • Jan (4)
  • [+] 2012 (77)
    • Dec (1)
    • Nov (5)
    • Oct (14)
    • Sep (2)
    • Aug (1)
    • Jul (4)
    • Jun (5)
    • May (9)
    • Apr (11)
    • Mar (10)
    • Feb (8)
    • Jan (7)
  • [+] 2011 (73)
    • Dec (4)
    • Nov (7)
    • Oct (6)
    • Sep (11)
    • Aug (9)
    • Jul (6)
    • Jun (3)
    • May (1)
    • Apr (8)
    • Mar (5)
    • Feb (5)
    • Jan (8)
  • [+] 2010 (71)
    • Dec (6)
    • Nov (3)
    • Oct (4)
    • Sep (14)
    • Aug (2)
    • Jul (4)
    • Jun (14)
    • May (19)
    • Apr (5)

Be Social!

Circle me!





profile for WesleyDavid on Stack Exchange, a network of free, community-driven Q&A sites

Copyright © 2011
Top