Another wet basement weekend

I didn't post much this past weekend because on Friday morning at 7am I got a call from one of my tenants telling me their kitchen was soaked, and water was still dripping down from the apartment above. The tenant called again 2 minutes later because she felt she didn't make it sound urgent enough the first time.

I drove back to Lowell from Cambridge and sure enough, her kitchen was SOAKED. I went into the vacant unit below on the first floor -- nothing. It was dry as could be. Puzzled, I went into the partially finished basement, where I stay during the weekends. I discovered about 3" of water on the basement floor. As I walked through the water with my sandals on, the water came up to my ankles. I stood in the huge pool of water and looked over towards where my server, external hard drives, and router was plugged in -- all the power cords were partially submerged in the water... and I was standing in that same water. I realized how easily I could be electrocuted and slowly walked over to the breaker panel to turn off the main switch.

I wondered how so much water could come from the air conditioning unit on the third floor without making the first floor wet at all. As I stood there assessing the damage, I heard a dripping sound coming from the other side of the basement, near the hot water tanks. Come to find out, one of the three hot water tanks had eroded and was leaking water! It must have started earlier in the week because mold was already starting to form on the carpet and desk where my computer equipment was!

After paying $95 to have the A/C system fixed, I looked in the phone book (well actually, yellowpages.com on my Blackberry) for plumbing companies. I called 5 numbers, only one person answered. He came over with his girlfriend (or wife?), who surprisingly helped him with most of the work and knew the names of all the tools and fittings (I'm not being sexist, she just didn't look like someone who would know anything about plumbing). Within an hour he had the hot water tank disconnected and the water was turned back on. Looking around at how much stuff had been ruined by the water, I knew how the rest of my weekend would be spent.

With Sitha's help, we managed to clean the entire basement over the weekend, the first real cleaning it's had in two years. The A/C issue that was supposed to have been fixed on Friday morning was not fixed at all and I had to have an on-call A/C tech come back Saturday morning. He explained how the installation techs who install the systems don't understand what kind of access is needed to service those systems. He said if anything major happens to the system, I'll have to tear apart the bathroom walls just to gain access to the A/C unit (the unit is inside an attic crawl space of the finished attic).

After 8 years, I'm finally getting tired of the nuisances that come with living in basements or attics. This weekend I'll be moving into a second floor apartment in Cambridge, inside the same building I'm currently in, but with 5 huge windows and plenty of light. I will be quite an experience and I'm looking forward to it.

Bike stolen, for real this time

I walked outside this morning and the place where I parked my $600 Specialized RockHopper mountain bike last night was empty. Yes, it was locked, with a Kryptonite HardWire 1518 cable lock -- obviously not strong enough.

I guess that's why everyone in the city seems to be riding a road bike that looks as if its worth $20. Too bad this isn't a false alarm like last time. Maybe my recent injury was nature trying to tell me something.

*takes a deep breath*
Life is Good. 🙂
I have less stuff!

EDIT: Here is how simple it really is to steal a bike.

Bush hid the facts

If you're running Windows XP, give it a try (make sure you leave out the period!). I tried it using Windows XP from within VMWare Fusion and it worked exactly like the video. I wonder what other secrets the programmers hid inside the operating system. 😕

Here is some good info about this Easter Egg on Wikipedia.

Flesh Wound

Sunday evening, on my way back to Cambridge, I filled the tires on my mountain bike with air. When I was done, I sat on the bike to make sure the tire pressure was good. As I got off the bike, I lifted my leg over the seat and behind the bike. I have a TOPEAK cargo rack sticking off the back of my bike and my leg caught it and it scrapped me pretty bad. I needed to use the first aid kit in my truck because it was bleeding so badly -- I didn't have any band aids big enough.

It still hurts when I walk; the healing skin stretches and contracts every time I bend my knee.

Sprint Commercial

I can't get this song, and commercial, out of my head. I finally found the song and downloaded the album (through mininova.org). The song is Souvenirs by Architecture In Helsinki.

After listening to the whole song, I discovered the beginning is the only part I seem to really like, and as such, I'm considering cropping out the portion of the song from the commercial and creating my own mp3 to put on repeat. 🙂

Software Project Requirements

Requirements Toon

When it comes down to defining a exactly what a piece of software needs to do and what customer wants the software to do, there is often misunderstandings due largely to a gap in the understanding of technology. The customer is not expected to understand how the software gets the job done, just that it gets done correctly. The programmer needs to understand exactly what end result the customer expects and write the software accordingly.

I found this image here. I couldn't find any information on the author of the image or where it originated, but please let me know if you do.

ImgListGenerator

Introduction

I've been doing a lot of eBay auctions lately and one of the most time consuming parts was creating the HTML for all the images in my auction description. I could reuse a lot the HTML, simply changing the directory and image names, but it was still a lot of repetitive work. This week I had 25 items to list and the repetitive work really got to me, so I stopped and spent 30 minutes putting together a script that would help me.

Usage

To simplify things, I decided not to support the ability to choose the directory with the images for which you want to generate HTML. Instead, you simply upload the index.php file to the directory that contains your images, visit that directory with your web browser, and the HTML is generated. Since your web browser reads HTML, the images will be displayed just as they would in your eBay auction. Simply right click on the page, choose View Source, copy the nicely formatted HTML and paste it into your eBay description.

You can view this script in action by browsing some of my images here.

Details

Here's a sample output from this script:

<p align="center"><img src="http://www.ekarma.net/demo/pics/sample/DSC_0001.jpg"></p>
<p align="center"><img src="http://www.ekarma.net/demo/pics/sample/DSC_0003.jpg"></p>
<p align="center"><img src="http://www.ekarma.net/demo/pics/sample/DSC_0004.JPG"></p>
<p align="center"><img src="http://www.ekarma.net/demo/pics/sample/DSC_0010.JPG"></p>

The code I had to write for this script was rather simple. The real meat of the work is done by a very nice function called preg_find() by Paul Gregg. His code is too much to show here, but I'll show you the code I wrote for this little script:

// Find all .jpg or .JPG files in the current directory using preg_find()
$files = preg_find('/.jpg|.JPG/', '.', PREG_FIND_SORTBASENAME);

// Store the path to the current directory
// (PHP_SELF includes index.php, so we use substr to remove that)
$link_dir = substr($_SERVER['PHP_SELF'], 0, -9);

// Loop through each of the files and generate the HTML
foreach($files as $file){
$my_file = substr($file, 2, strlen($file));
echo "<p align="center"><img src="http://" /></p>\n"; 
}

That's it! Of course it would be much nicer if you could upload this script to the root directory and either enter or choose a path with images, then click generate. However, this script does exactly what I need, so I don't plan to make any changes to it.

Download

This script can be downloaded here: index.php.zip (4KB)

PC vs Mac

Here is a very funny video Thea sent me the link to. It definitely describes many of the annoying things I discovered when I first started using a Mac.

I was laughing non-stop throughout the whole thing! 😀

Dirty Air

The air quality in Cambridge (MA) doesn't even compare to that in Pelham (NH). I had to go to Lowell for some issues with my rental properties and decided to visit my parents while I was there. It had been raining and drizzling since about 3pm today and by the time I arrived in Pelham around 8pm everything felt almost tropical. It was amazing. I took a deep breath with my windows down as I drove along road, with dark green trees in every direction. The air felt clean; more oxygenated; it felt healthy.

It's easy to compare the air quality because yesterday evening I went running around the area near my Cambridge apartment. I haven't been running in awhile, and it was obvious my lung capacity had decreased a lot because I needed to take deep breaths all the time. Half way through my run I stopped. What was I breathing in? Car exhaust, the trash sitting on the sidewalk, the smell of laundry coming from a vent, the strong perfume of the person I just passed. Ugh! It felt like I was running one step forward and taking my health two steps backwards!

I can't help but wonder how much of an effect living in the city has on a persons health. I spent the majority of the first 14 years of my life in a rural area with a lot more trees than houses, the following 10 years in a semi-rural area with more houses than trees, and the past 7 months in the city, where there are more dogs than there are trees! I thought of living in a more rural area and commuting to Boston, but would that be any better? I'd probably be getting even more exposure to unhealthy air since I'll be traveling the very routes where the dirty air starts!

In retrospect, a truly healthy life cannot be lived by working "where the crowd works", nor can it be lived if your goal is to simply make as much money as possible (as is my goal for the next 5 years... how much of an impact will those 5 years of living in the city have on my health!?). For many, it's not a matter of choice but a matter of necessity. I'm lucky to still have many of my options wide open.

We are what we consume.

$250,000 a month blogging?!

Yup, its true. Some people actually make that much blogging. Check out this Business Week article on the top bloggers out there (click the images across the bottom to read each story and see how much each makes). Basically, none of them expected to be making that much money blogging. They either started the blog as an inside joke or to cover a tiny niche, which then exploded. With large volumes of traffic (some 100,000 unique hits a day!), they were able to start selling ad space.

I'm up to about 2,000 unique hits per month on this blog (10,790 hits so far this year), and I've actually made a couple of dollars with my AdSense ad's -- but I'm not looking to make money with this blog. I consider this my social outlet and public diary of events; a way to go back and find out when I began trying to sell my Audi or how I solved a particular problem. The discussion created by visitors posting comments is a nice way to exchange ideas and see the point of view of others.

rdesktop running inside X11

I've been using the Remote Desktop Connection for Mac from Microsoft to connect to my Windows machines on my Mac. I've used the open source client rdesktop on Linux machines in the past, but I figured since Microsoft provided a free client I might as well take advantage of every free thing I can get from the company that loves to charge for everything. But then I heard about how the performance of the Microsoft Remote Desktop client on the newer Intel Rosetta Macs was not that great, and that rdesktop worked much better.

So I installed rdesktop using MacPorts (sudo port install rdesktop) which installed rdesktop in /opts/local/bin/. Then I had to start X11 (I already installed X11 from my Mac OS X CD) and using the X11 terminal run rdesktop from the command line to connect to my Windows PC (running open-x11 /opt/local/bin/rdesktop my-server-ip from iTerm did not work). Obviously this was a lot of work to simply open a connection to my Windows server, so I searched for a simple workaround. I found one here. For sake of maintaining a consistent source of information, and because I modified some of the steps, I'll recreate the steps here:

1) Create ~/my-windows-pc.sh (important difference in this step is the addition of the -K option):


#!/bin/sh
/opt/local/bin/rdesktop -K -f -a 16 my-windows-pc-ip

2) Make the file executable:

chmod +x ~/my-windows-pc.sh

3) Apparently the default xinitrc settings get in the way when running rdesktop full screen, so lets place a copy in our home directory and make some changes to it:

cp /etc/X11/xinit/xinitrc ~/.xinitrc

Edit the file and remove the line that says xterm &

4) Finally, we can do some cool stuff. Lets create a single .app (Mac's application file) that can do all the work of opening X11 and running our my-windows-pc.sh script. Start by opening the Script Editor (Finder -> Applications -> Apple Script -> Script Editor). You should be presented with an Untitled script editor window (if not, choose File -> New). Type the following into the editor window:

do shell script "open-x11 ~/my-windows-pc.sh &"

Choose File -> Save As. Then change File Format to Application. Type a name to save your application (such as My Windows PC), select a place to save the application (such as your home directory or Desktop), and click Save. Now you should be able to double click on the My Windows PC file to open your Remote Desktop connection.

Full screen issues

The first major difference between this method and using Microsoft's Remote Desktop client was that I could not press Apple+H to hide the Remote Desktop connection window, and then Apple+Tab to switch back to it, while running Remote Desktop in full screen mode (the -f option in the rdesktop command). Also, in full screen mode the Apple+H shortcut doesn't work by default. The -K option (keep window manager key bindings) we added to the rdesktop command allows us to still use the Apple key to do things while we're connected to the Windows PC (including Apple+H), however it doesn't work the way it's supposed to! Another huge annoyance is that when running Remote Desktop in full screen mode, its not truly full screen because we still see the Apple Dock and the X11 bar across the top.

The way to fix these problems is by enabling full screen in X11 (X11 -> Preferences -> Output -> Enable the Enter Full Screen menu). Keep in mind, Alt+Apple+A switches between full screen and windowed mode in X11 (in full screen X11 mode, you can't see the X11 menu bar to get back into the Preferences without changing back into windowed mode!). Also, I can't remember, but I might have also checked the "Enable keyboard shortcuts under X11" option. Now, if you start your full screen Remote Desktop connection, it should really look full screen (nothing visible except your Windows PC).

Finally, it would be really nice to be able to switch between the Remote Desktop connection and applications running on the Mac. I currently use Witch as my application switcher, instead of the default application switcher that comes with the Mac (so I can't tell you if this issue applies if you're not using Witch (and if you're not, you should be!)).

To make the X11 application show up in the Witch list, choose System Preferences -> Witch -> Behavior. Then enable the "Show an Activate Item for windowless/hidden applications". Now when you're inside a full screen Remote Desktop connection, you can press Apple+H to hide the full screen window, and you should see an "Activate X11" option in your Witch list, which you can use to switch back to the full screen session. This method also works if you're using a windowed rdesktop session.

Thermogenics are Evil

Don't take a thermogenic on an empty stomach and then go without food for an hour. I did that this morning and I've felt so sick the past few hours that I'm barely able to think. I constantly feel like puking and I have waves of chills followed by sweating. Combine all that with a raging headache and you can imagine the discomfort. I don't want to take any pain killers because they will probably make the nausea worse.

Strangely enough, this is the same way I felt almost exactly a week ago. I've learned my lesson. No more thermogenics!

Repetitive Immobility is Killing Me!

I've been stuck in what feels like a rut, an endless loop of procrastination, confusion, and indecisiveness. If it sounds very much unlike me that's because it is. Perhaps it is so unfamiliar to me that I feel stuck and have a constant desire for change.

I crave the outdoors and yet I spend my days in the office, my evenings in a basement apartment with very little natural light and no ability to see the sky, and my weekends working inside on my rental properties or driving in the car. When I'm indoors I feel compelled to be sitting at my computer, whether for work or entertainment, because I refuse to hook up a television and although I have plenty of gym equipment, I've been finding it difficult to be motivated when I'm in a gloomy basement and the weather is beautiful outside.

I've been thinking seriously about finding a new apartment, one above ground and with plenty of windows, hoping that maybe that is what I need to satisfy my desire for natural light. But is that what I really need? I'm already 1 month behind on a house payment and I'm struggling to pay even the rent at my current apartment. Credit cards are already maxed with purchases from rental apartment repairs and the bills for everything else are slowly stacking up.

The constant repetitiveness of my daily routine of sitting in a chair, whether while work, at home, or while driving, is having an extreme negative effect on my posture and muscles. What amount of stretching and exercise can counter 12 hours of sitting in a chair if I plan to get 6 hours of sleep and spend 4 hours doing other daily activities? How can 2 hours of exercise and stretching counter 18 hours of near immobility?

I've been sitting outside on a public sidewalk bench typing this entire post on my Blackberry. I had to get outside, regardless of what I was going to do outside, I just needed to get out. I can think more clearly when I'm outside. Maybe I should start a time journal to keep track of exactly where all my time goes. Then after one month review the journal and look for patterns of wasted or ill spent time and change them.

I need to start, no... I'm going to start some type of daily, outdoor activity; preferably one physical enough to be called exercise. I'm also going to get back on my three day a week lifting routine.

Installed reCAPTCHA Plugin

SecureImage is nice, but the problem is that SecureImage doesn't work well with wp-cache, the cache plugin I use to insure a speedy experience for my visitors. So only a few minutes after installing SecureImage, I found another solution: reCAPTCHA.

The idea behind reCAPTCHA is very cool. It works by asking you to read two words, one which the computer generated and one that is part of a scanned page from a book, a word that the computer was not able to decipher. If you can understand the computer generated word, chances are that you'll also be able to decipher the scanned word. This helps digitize books! If you want to learn more about reCAPTCHA, I suggest you visit their site and read the "What is reCAPTCHA?" page.

I had to do a little tweaking to get it positioned properly with my custom WordPress theme, but that wasn't too bad. I'm really liking reCAPTCHA. Not only does it work with wp-cache, but it also fixes the annoying problem where your comment data would be lost if you enter the wrong information in the captcha. Of course, the captcha will be used by you, my visitors, more than anyone else, so please leave me your comments!

Installed SecureImage Plugin

A few months ago I installed the Challenge plugin, which presents a math question for anyone wanting to post a comment. It's been working great and I have not received a single spam comment... until this morning. I woke up and checked my Blackberry for new email: 49 new email messages. They were all comment notifications. Apparently a spam bot managed to get around the Challenge plugin and posted 49 spam comments throughout my blog!

After deleting the spam, I decided to install the same plugin I've installed on a couple of other WordPress blogs, SecureImage (the developers site is down and that is the best URL I can find for SecureImage). It's a simple captcha plugin that generates an image containing a string of letters. Other captcha plugins required GDLib, which I couldn't seem to find on my web server (or at least didn't bother spending much time looking for it). SecureImage requires ImageMagick, which is readily available (read: default /usr/bin/convert path worked fine). After installing a TrueTypeFont (FreeSansBold.ttf) I was up and running.

A few new photos

Before I sold my Thinkpad T41 to Aerva I took some photos of it for remembrance. I also took a photo of myself with my new MacBook Pro's built-in iSight camera, which by the way is very nice. It's so cool to have a web cam that's built right into a laptop screen!

I've been meaning to take photos of it and post them up, but I've been procrastinating. Well actually, I've been waiting to make a post that includes all the cool applications I've downloaded and installed on my new Mac, but the truth is I simply have so much other stuff to get done that it keeps getting put on the back burner.

I went on a camping trip this past weekend with my Dad, brother, and brother-in-law. I'd post photos, but they're all in my brother's camera (I don't have a point-and-shoot and I'm not willing to risk the elements with a $2500 camera). Hell, I brought my MacBook with me camping but realized I would be too dirty to use it and left it in the truck. Before the 2 hour drive home I stuck it back in the backpack and when I arrived home and took it out, it was soaked from condensation! It scared the crap out of me because I had it on sleep and not off (electronics are usually destroyed by water when they short circuit, so you're usually safe as long as they're not turned on). Luckily after drying it out everything worked fine.

The camping trip was fun, though strangely not as relaxing as it usually is. Perhaps its because of everything that's on my mind and all of the bills that are stacking up. I wasn't able to make last month's house payment for my Ware St property, so it was reported as late to the credit bureau. I tell myself I'm not getting stressed out about it, but the truth is it's definitely having an effect on me.

Washing Machine Dies

Last night I put clothes in the washing machine, added soap, put $1.25 in the machine, and... it wouldn't turn on! After tinkering with it for 20 minutes, hoping I could figure out what the problem was, I gave up and decided I would bring them to a laundry mat the following day.

The machine either broke right after the last person used it or someone else discovered it was broken and didn't bother posting a notice on the machine. I printed an OUT OF ORDER sign and slapped it on the machine. I then paid another $2 to wash my clothes at the nearest laundry mat.

Apparently my landlord is very frugal and doesn't like to pay for or fix anything he doesn't need to, which is why he wouldn't take a penny off my rent when a broken water pipe flooded my apartment. I also recently discovered that back when he was the Cambridge Police chief, he made a lot of money by looking the other way (?) and that he most likely bought all the properties he currently owns with that money. 😐 I learned this when I was taking a look at an apartment in the Winter Hill area of Somerville the other day. But, past is past. I'll leave it at that.

Contemplating switching apartments

I've been thinking about switching apartments. I can get an apartment that is twice the size as the one I'm living in now, for same $950 per month. The only difference is that it's about 1.5 miles further from my office. Probably the main reason I'm even thinking about switching is that I'm so sick of not getting any sunlight living in the basement. I can't feel comfortable leaving the windows open, for fear of someone breaking in (the windows are, after all, at ground level).

But then I'd have to order cable again and move all my stuff from one apartment to another. If I switch apartments now, I will be responsible for finding another tenant to rent my current apartment, since the lease doesn't expire until the end of the year. Renting my current apartment will be a breeze since it's only 1/2 a mile from Central Square. According to a rental agent friend of mine, apartments in this area disappear very quickly -- which is one reason I feel lucky to be where I am.

As much as I'd like a bigger place right now, I think I'll just wait and keep my eyes out for a really good deal. There are some nice apartments in Somerville, however I'd really like to stay in Cambridge if at all possible. Another reason I don't want to switch now is because I'm going through some tough financial times and until I fix that situation, I don't want to lock myself into another 1 year lease.