Google Reported Attack Site

Google Reported Attack Site

I'm sure some of you must have seen this warning when you tried to visit my site. Fear not, I have fixed the problem. There was an old file on my domain that had a link to a site that was defined as "malicious" by Google, so they basically added my entire domain to the watch list. I removed the file and, after asking Google to check my site again using Google's Webmaster Tools, they removed my domain from the list.

So, how did I find the few pages (among thousands of files on my site) that contained a link to the malicious site Google was blocking me for? I logged into my site via SSH and ran a command like the following:

for i in `find . -name "*.ht*"` ; do echo $i; cat $i | grep 195.2.252; done

This basically searched every single .htm or .html file inside my public_html directory and returned anything that contained the IP address I was looking for. Whenever there was a match, the filename that preceded the output was the offending file. I'm sure there's a more elegant way of doing this, but hell, I just wanted to fix the problem!

Although this was annoying to deal with, it made me feel good that Google is actually keeping track of these things and, with the help of Firefox, is warning people of such sites. Site owners must be vigilant in fixing such problems or they risk losing loads of traffic from Google (and from visitors with Firefox).

A Downside of Being Organized

One of the downsides of being organized and having a clear picture of everything you need to do is that you realize just how much stuff you need to do! I've been using David Allen's GTD method a lot lately, along with the help of an application called OmniFocus, and I can't believe how much stuff I have written down since I started using this method. I have 300+ items in OmniFocus. Try to imagine the relief and freedom I have given my brain by allowing it to let go of trying to remember (subconsciously) 300+ items and you'll begin to see why the GTD method is so powerful.

Escaping Filename or Directory Spaces for rsync

To rsync a file or directory that contains spaces, you must escape both the remote shell and the local shell. I tried doing one or the other and it never worked. Now I know that I need to do both!

So let's say I'm trying to rsync a remote directory with my local machine and the remote directory contains a space (oh so unfortunately common with Windows files). Here's what the command should look like:

rsync '[email protected]:/path/with spaces/' /local/path/

The single quotes are used to escape the space for my local shell and the forward-slash is used to escape the remote shell.

Comment Threading Coming to WordPress 2.7

It looks like the WordPress commenting system will finally being overhauled in v2.7, including support for threaded comments!. If there is one thing I wished was done better in WP, it's definitely the comment system. After all, second only to the actual blog content itself, comments and discussion are the most important aspect of a blog.

Intense Debate, the makers of software which adds commenting features like threading, reply by email, voting, reputation, and global profiles to WordPress and other blogging software, was just acquired by Automattic, the company behind WordPress. I think this goes to show how serious the improvements coming to the commenting system will be.

Matt Mullenweg, the founding developer of WordPress, has a post about the acquisition and talks about what it means for WordPress.

Letting go of Stuff

I've been consistently getting rid of stuff that I don't need or that I rarely use. I'm going to continue doing so until I'm down to the bare minimum. Then I'll implement a personal rule that prohibits me from taking on more stuff unless I absolutely need it or unless I get rid of something else first. Not only have I been doing this with material stuff, but with mental stuff too. It's a freeing experience to just let go of stuff. I realize how unnecessary certain things were after they're gone.

A Week of Big Decisions

This past week my head has been full of big decisions. Late last week, I was given the opportunity to make a big chunk of cash for three hours of work if I was willing to accept a slight (although real) risk to my health by removing asbestos from an old basement boiler. I needed the money, but in the end I realized that trying to put a price on my health was just stupid.

Then yesterday, the first day of spring, I signed the paperwork to file for Chapter 7. The decision had already been made, but it was a big event in my life nonetheless.

And lastly, since a huge portion of my income currently goes to rent, I've been trying to decide what I can do to decrease that expense considerably. I have been crawling CraigsList looking at what's out there and then checking MBTA's website to determine commuting distance and cost.

Since I've accepted that I'll probably need to spend three hours a day commuting (total), I have even checked out a few places near the ocean (I love the ocean). However, the more time I spent looking for an apartment and planning my potential commute, the further from my original goal I unconsciously drifted. The original goal was to decrease expenses and to save as much money as possible. I'm still making my decision on where to move, but it's going to be an important one that will have the potential to save me a lot of money.

A Unique Perspective: College Campus

Today marks the first day of my twenty-six years of living that I spent time inside a college classroom and on a college campus. (There was one time I attended an Indian classical music concert with my dad at MIT, but I was young and barely remember it.) I'm taking the Introduction to C/Unix/CGI Programming class at Harvard Extension. As I walked around campus on the first day of class, I very quickly observed how different things felt from the "normal world".

My perspective is probably somewhat unique in that I have been around business for as long as I can remember. My parents have always owned their own business and I myself just went through being a landlord for a few years and then lost all three of my houses to foreclosure. I also had my own consulting business going for awhile. Being home-schooled my whole life also meant that I saw nothing of the public school system.

The atmosphere of being on campus felt very unfamiliar to me -- almost alien. I was only a few hundred feet from streets I had driven on every day for the past few years and yet I felt as if I was on a different planet. It's a hard feeling to describe. As I stood there looking around, I could almost fool myself into believing I was in the middle of a utopian alien society where everything was about peace, harmony, learning, and knowledge. (Then I turned around, looked across the street, and saw all the money-hungry shops trying to buy your soul. I was quickly reminded that I am, in fact, still on Earth. Damn.)

As strange and different as the atmosphere felt, it also felt relaxing -- like there was nothing to do except learn and relax. I was able to walk into a building and have instant access to dozens upon dozens of computers just waiting for me to login and start using them for whatever constructive thing I needed to do. Everything outside was clean and there were plenty of benches and places to sit.

But my perspective is flawed. The company where I work is paying for the class and I'm sure things wouldn't feel quite as "free" and relaxing if I had student loans riding on my back. But that should say something for the current system. Imagine what society would be like if all education was free. Imagine the atmosphere it would create. People learning because they want to learn and because they can learn. Not learning because they want to make money and get an awesome job to pay off their student loans. No, learning because they want to create, explore, and evolve. Learning because it's fun. Learning to learn.

iTunes Genius is Genius!

One of the new features of iTunes 8 is called Genius. It basically allows you to select any song in your library, click the Genius button, and it will generate a playlist of songs from your library that it thinks go great together. I was a bit optimistic at first, but holy crap! I tried it and I suddenly feel like I have a real live DJ picking songs for me to listen to! I feel like I'm rediscovering all the music in my collection!

Think of debt payments as an investment

Think of debt payments as an investment. When you make a $100 payment on a loan with a 13% interest rate, your annual return is 13%, or $13. Why? Because you avoid having to pay that extra $13 in the future, which leaves you $13 more than you would have otherwise had. [source: wikiHow]

Switching to suPHP; What a Mess!

When one of my users reported problems deleting files he had uploaded using a PHP script, I quickly discovered all the files being uploaded were owned by the user running the web server: nobody. This meant only the root user could delete those files.

Apache suEXEC is commonly used to resolve this problem. It allows Apache to run as the user who owns the domain being accessed. This way, files created by PHP would be owned by the user owning the site instead of the default nobody user.

However, Apache suEXEC only works if you're using CGI as the PHP handler. The PHP5 handler on my server was set to use CGI, but I have PHP4 configured as the default PHP version and it was configured to use DSO. When I tried changing PHP4 to use CGI as the handler, most of the domains on my server displayed this:

Warning: Unexpected character in input: '' (ASCII=15) state=1 in /usr/local/cpanel/cgi-sys/php4 on line 772
Warning: Unexpected character in input: ' in /usr/local/cpanel/cgi-sys/php4 on line 772
Warning: Unexpected character in input: ' in /usr/local/cpanel/cgi-sys/php4 on line 772
Warning: Unexpected character in input: ' in /usr/local/cpanel/cgi-sys/php4 on line 772
Parse error: syntax error, unexpected T_STRING in /usr/local/cpanel/cgi-sys/php4 on line 772

OK, that looks like a problem with cPanel. I don't have time to debug cPanel's problems.

suPHP, like suEXEC, is used to run Apache as the user who owns the domain. I decided to try recompiling Apache and PHP with suPHP enabled to see if that would fix the problem.

File Ownership Hell

suPHP worked, except now the sites using PHP sessions were trying to access stored session data in /tmp/ that was owned by the user nobody! So I deleted all the session data and that allowed the PHP sites to create new session data with file ownership of the user owning the domain.

But then I tried accessing my WordPress admin page and started getting permission denied errors in /wp-content/cache/. Same problem: the cache files that had been created before I enabled suPHP were owned by the user nobody and now the user who owns my domain couldn't access them. A quick chown -R raamdev:raamdev /wp-content/cache/ fixed that problem.

Yeah, I could simply chown -R [user]:[user] /home/[user] for each of the users on the server, but there's something about running a recursive command on files I've never seen, and know nothing about, that makes me uncomfortable.

More suPHP Limitations

I was beginning to worry that this was going to be more difficult than simply enabling suPHP and I wondered how many other sites I'm hosting could have similar problems. I tried accessing one of the high priority sites I'm hosting and discovered it was broken and displaying an "Internal Server Error".

After a little research, I discovered that you cannot use php_value directives in .htaccess files with suPHP. The .htaccess file included with (created by?) Joomla! contained this at the bottom:

#Fix Register Globals
php_flag register_globals off

I already knew register_globals was turned off in the global PHP configuration, so I simply commented out that line and the site started working again.

Conclusion

It was at this point that I concluded it was too risky to just blindly enable suPHP while hosting over 50 domains, many of which I am not at all familiar with what's being used or hosted. I will need to take the time to carefully crawl through all the sites making sure their .htaccess files don't contain anything that might disrupt suPHP and then confirm all the sites are still working properly.

Lesson learned: Setup suPHP before you're hosting 50+ domains.

Accessing the VMWare Fusion BIOS

As noted in the Known Issues section of the VMWare Fusion Release Notes, the VMWare Fusion BIOS goes by way too fast to give you a chance to access it. The only way you can access it is by modifying the .vmx configuration file for the VM:

The VMware Fusion BIOS posts too quickly to access.

Most users will not need to access the BIOS, but advanced users might want to do so, to change the boot order, set a boot password, or enable a second floppy drive. To work around this problem, use a text editor to add the following line to the configuration (.vmx) file of the virtual machine:

bios.forceSetupOnce = "TRUE"

The next time you boot up the virtual machine, it will automatically boot into the BIOS. This configuration option then reverts to FALSE. You must set the option to TRUE each time you want to boot the virtual machine into the BIOS.

Having trouble finding the .vmx file?

You cannot edit the .vmx file by opening it with Finder. You need to use the Terminal to edit the file. Here's how you do that:

Launch Terminal (Applications -> Utilities -> Terminal.app) and navigate to the folder (or directory) where your Virtual Machines are stored. To do this, you use the "cd" command. For example, my Virtual Machines are stored in Documents -> Virtual Machines, so I type the following to change into that directory: cd Documents/Virtual Machines/ and then press Enter.

Now you need to change into the directory that matches the name of your Virtual Machine. For example, let's say it's called "Windows XP" -- you would type cd Windows XP/. (Note that you have to "escape" spaces in the folder name by preceding them with a backslash.)

Once you're there, you can use the "ls" command (that's a lowercase L) to list the contents of that folder. You should see the .vmx file you're looking for. Now to edit that file in TextEdit, simply run the following command: open -e *.vmx.

That's it! Now you can edit the file as described above to enable the BIOS.

Labor Day Volleyball

I played volleyball two days in a row (yesterday and the day before) at my brother-in-law's house and now my feet, and body, are so sore. I like playing sports barefoot because I sprain my ankles easily when I wear shoes. However, after I stubbed my big toe and obtained a quarter-size blister on the other, I decided shoes were needed for the second day. My body feels so stiff -- this isn't what I should feel like at twenty-six. I need to commit to a daily two hour running and stretching routine and stick with it.