Will Someone Get This Car Out Of My Way?
Thanks for making sure pedestrians have a way to pass.
Comments to this post
Lunch
Today’s lunch.
Comments to this post
Mass Removal of error_log Files
It’s always a good idea to back something up before you begin working on an improvement to it or upgrading it to a new version. For example, before I upgrade my WordPress installs I always back up their files and databases.
This seems simple enough but every time I back up any of my PHP projects (WordPress or any other) I seem to run into the same problem: error_log files.
error_log files are the product of Apache’s error logging functionality. Whenever you go to a site running an Apache webserver and get a PHP error the error is put in a file called error_log that is stored in the directory in which the file that throws the error resides. For example, if you get a PHP error when trying to access http://www.domain.com/index.php the error will be logged in an error_log file in the root of the site. However if you get an error when trying to visit http://www.domain.com/test/index.php the will be logged to error_log in the /test subdirectory.
The problem is that over time these files can grow very large and be spread through many directories all over your website. So when you try to back up numerous directories you can end up with a larger than necessary backup file filled with many error_log files (some of which can grow quite large themselves). And since these files do not serve any other need but to log errors it seems useless to have them in your backup.
The good news is that error_log files can be removed at any time with no repercussions to the functionality of other files within their directories. But the removal of these files can prove to be a difficult since they can be in any directory. Who wants to manually look in every directory of a WordPress install to find and delete all the instances of error_log files?
Luckily I chanced upon a solution by Lester “GaMerZ” Chan. GaMerZ wrote a PHP script called “GaMerZ error_log Cleaner”. When it’s page is accessed “GaMerZ error_log Cleaner” crawls your website for error_log files and removes them all automatically. “GaMerZ error_log Cleaner” can be downloaded here.
As an added tip I’d suggest changing the name of the error_log.php file for security purposes lest it become an attack vector. If you do this then be sure to change the $this_file variable at the top of the script to match the new filename.
Comments to this post
Twitter Pet Peeves
As Twitter has grown in popularity I’ve developed some pet peeves about the way people use it. Here’s a few. Feel free to add yours to the comments.
Live Blogging Events
Twitter has become a place for people to live blog all sorts of things. I think this is a good thing. Well mostly a good thing.
One of the people I follow who lives in a different locale than I finds Twitter to be a good place to live blog sporting events taking place in his locale. As bothersome as it is to have these games live blogged into my Twitter feed it’s an annoyance I can live with provided I get enough out of this person’s other Tweets. But the fragmented sentences and out of context comments without explanations are really annoying (to say nothing of the equally as disjointed retweets).
If you’d like to live blog events (sporting or otherwise) over Twitter feel free to do so. But before you do I suggest you follow a few tech journalists and watch how they live blog product announcements. These are the only people I’ve seen do live blogging over Twitter in a useful way.
Gratuitous Profanity
I don’t follow people just because they follow me. If someone follows me I take a quick look at their recent tweets and sometimes their blog (if they have one) to see if I can get anything I feel would be useful out of following them. This strategy was born from a bad experience I had I followed someone simply because he followed me.
This person turned out to have very little of interest (and even less of usefulness) to say. But what really bothered me was the way he would communicate his worthless drivel. It seemed that he was unable to effectively communicate his nonsense without using profanity.
I’m no angel when it comes to language. As most people I’ve been guilty of the occasional four letter word and understand that it’s part of the language landscape we live in. But when every other word you say (or write) is of that nature I tune you out.
Needless to say I unfollowed this person pretty quickly.
Overdoing Follow Friday
Follow Friday is a practice where every Friday people tweet suggestions for people their followers may want to follow. I think the practice has pretty much jumped the shark but can still be helpful sometimes.
The problem is that there are people who over do it. For example, there’s one particular person I follow for a specific reason. His tweets are humorous, insightful and useful enough to continue following. However when Friday comes around I get at least 10 Follow Friday tweets from him and most of them are useless. Do me a favor and limit yourself to 1 or 2 Follow Friday tweets each week.
Good Morning and Good Night
“Good morning, tweeps!What’s going on today?”
“It’s been a rough one but thankfully it’s over. Goodnight all.”
We’ve all seen tweets like these. Many of us have written tweets like these. But what’s the point? Does the world really care when you get up or go to sleep? Is this really noteworthy information? I know that, as in many media” 90-something percent of Twitter is worthless. But tweets like these aren’t worth the effort of reading.
Retweet Promotions
We’ve all done it. We see “Retweet this for a chance to win!” and we obey. There’s nothing wrong with it really. Who wouldn’t click one button if it meant a chance at winning a good prize? And it’s a great marketing method too. Get people to spread the word of your new product by putting one up for a giveaway. But it’s still annoying to see it in my feed.
Tweets Longer Than 140 Characters
Twitter’s character limit is set to 140 characters. This presents a challenge when trying to communicate ideas that are slightly larger. When this happens many people either edit their tweet down to meet the character limit or split their message into two tweets.
But there’s a third option that is becoming more popular. That option is to have your longer tweets posted on a third party website. With this option part of your tweet is posted to Twitter along with a link to a website where the full tweet can be seen.
When I’m reading updates on Twitter the last thing I want to do is click a link to read the rest of the message somewhere else. Clicking links to read articles or check out a website someone suggests or view a picture someone’s posted is one thing. But if you want me to read you tweet please keep it to the limit or keep it to yourself.
Comments to this post
More Mac Password Hacking (Snow Leopard)
About 4 years ago I wrote a post on Mac password hacking in OS X. The versions of OS X I wrote about was current at that time but, obviously, there have been a few updates since then. Here’s a method I recently read about that works on the Snow Leopard version of OS X:
- Startup the computer while hold down “Command-S” until you hear the startup sound. This boots the computer into single user mode. As with the previous steps I outlined you’ll see text scrolling through the window before you get a command prompt.
- If you don’t know the user names on the machine you can type the following to pull up a list of user folders that most often correspond to all the users on that machine:
ls /Users
- At the command prompt type:
/sbin/fsck -fy [Enter]
/sbin/mount -uw / [Enter]
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist [Enter]
dscl . -passwd /Users/[username] [password] [Enter](Replace [username] with the username you want to change and [password] with new password you’d like to use for this user account. In both cases leave out the brackets I’ve used to enclose the placeholders.)
- After entering the new password, type:
reboot [Enter]
- At the login window, enter the username with the new password.
Tada!
Comments to this post