Illusory Follies Andrew Flanagan's Blog

11Apr/082

Integration of Information = Value

... at least in some cases.

It's easy to store information on your cell phone by typing some text in. It's more advanced to be able to send text messages. But what about providing a "universal" interface (meaning a web services interface) that can receive text and makes text available?

This is what Twitter does. I wasn't very impressed when I first heard about it a while back because it seemed so... simplistic. Anyone can write a simple database with users and allow them to post text messages. But I was missing the point.

I can now use my cell phone to send a message to Twitter (there's a program called MobileTwitter that I just downloaded and installed. This text messages pretty much instantly wings its way to the Twitter servers. From there, people can subscribe to my "stream" of messages using desktop-based clients (I use Spaz on my MacBook and my Windows PC). However, I'm not stuck using one companies application -- all I need to do is poll the web service. A simple curl call will easily retrieve my latest Twitter message

curl -u andrewflanagan:mypassword http://twitter.com/statuses/user_timeline
/andrewflanagan.xml?count=1 -s -o /var/twitter/andrewflanagan.xml

and a few lines of PHP will make it displayable on my web page:

$xml = new SimpleXMLElement('/var/twitter/andrewflanagan.xml', 0, true);
$status = $xml->status->text;

Alternatively I could have the PHP script directly call Twitter but I ran into some problems since it takes longer to load the pages each time someone visits and Twitter unfortunately limits requests to 70/hr which results in ugliness when I get too many hits on my site. So instead I set up a cron job that runs every 5 minutes (using the curl call above) and updates the locally-stored XML file.

But anyway, the point of this is that you can easily define new interfaces for entering, receiving, and displaying text. It's simplistic, yes. But it means that on my way back from work (in the car) I can update the front page of my blog with a message using my cellphone. I can also be pulled over by a state trooper. They have no appreciation for the depth and usefulness of this technology!

22Mar/083

iPhone Happiness

Well. I purchased an iPhone Thursday. Friday was NOT a productive day. In fact, neither was today. It's a great little tool and it's very handy.

One of the first things I noticed was that my voicemail messages (which get emailed to me from my VoIP provider) were NOT able to be played on the iPhone. Basically, they support WAV files but they must be in a specific format.

Solution? Well, I immediately thought that I could set up a spare email account on one of my domains and use procmail to run a conversion on the audio on my Linux box (and forward the results to my regular email account). I did a search and was pleasantly surprised to see that it had already been done (in exactly this way). However, after trying to get it working on mine I realized that it was a little messy since I was using virtual mappings (in order to store all email domains/users/aliases in a Postgresql database). Hmmm... So, I played around with maildrop (with which I was previously not at all familiar with). After much, much tweaking of permissions on folders (maildrop requires some odd and sometimes nearly conflicting permissions for things to work) I was able to get it to work as expected. I shamelessly stole the script that had already been created, emerged sox and some other utilities to support the conversion and fixed some bugs that I found along the way in my mail config (finally cleared out 250+ emails that had been queued up forever).

After all that, I still have a slight issue. A WAV file goes from being 60K to being 500K when I convert it to the "acceptable" format. Oh well. AT & T's EDGE network isn't the fastest for downloading 500K but I guess it's a lot better than nothing. It sure is nice to be able to get both your Cell voicemails and your home voicemails all on the same device. The iPhone is the first (so far as I know) cell phone to offer "visual voicemail" where voicemail is essentially downloaded rather then being available over one of those irritating "press 7 to delete your message"-type interfaces.

Phew... fun stuff. I've decided that since I spent the time playing with maildrop I might add some fun things (like system automation via email). There are definitely a few maintenance tasks that might be nice to automated via email. At work I have a proxy and email (at least from my work email account) is one of the few things that I'm allowed to use. I guess in theory I could run a really slow, email-based terminal session (email "ls -al" and after about 30 seconds get the results emailed back). That would be kind of cool. And a terrible security hole. 🙂

Sorry I've been slow on updating. I need to get back into the habit. Hope all my faithful reader(s) are well!

30Jan/081

VPS Hosting

So I had been looking for a new VPS host... I've used GoDaddy for a while and although it was decent a few years ago because of it's pointy-clicky Plesk interface, I've since found that it's easier to maintain it myself at the command line. I'm still running Fedora Core 2 and in order to upgrade, it's really painful. Back in the day, there were packages that I could install but now my only real option is to upgrade the OS entirely (which involves backing up, wiping, and restoring). Seems easier to move to a Gentoo-based VPS, save a few shekels, and get better performance. I also previously only used my server for hosting simple LAMP web sites. I'd like to move towards not only Apache/MySQL/PHP but also Ruby on Rails, Subversion, Trac, and other things.

So, my two main options were VPSLink in Seattle, WA and Slicehost in St. Louis, MO. These were chosen somewhat arbitrarily based off of reviews (mostly "personal" type reviews from blogs).

I purchased a 1GB RAM VPS for a month from VPSLink and a 3 month 512MB RAM VPS from SliceHost. Prices for equivalent products are very close but SliceHost does require a minimum of 3 months.

First off, I noticed that my ping time is obviously pretty good to the Seattle based VPSLink. I get 30-40ms response. I get 50-60ms response from SliceHost. Now, I remote into a server in the D.C. area and try again. Now I get a response time of 90-100ms for VPSLink and 30-40ms for SliceHost. This seems to make sense since SliceHost is more centrally located. Since my website traffic is fairly evenly spread across the U.S. (only rarely overseas) this seems to be a plus for SliceHost.

I like the SliceHost management interface. It's a "developer" type interface that's very simple but very fast and gives me a lot of flexibility. I don't like the VPSLink interface. It's annoying and (as I just noticed tonight -- doesn't always seem to be exactly running). Most of the features are similar but I do feel like I can really control things better with SliceHost. For starters, the VPSLink is dog-slow compared to SliceHost and also has separate sections for billing, support, management, etc. It's a pain to deal with. SliceHost is essentially one page with tabs. And it has more features like the rescue mode (mentioned below).

Well, the VPS with VPSLink is FAST. I do an emerge --sync && emerge world and I get the entire Gentoo installation updated quickly. However, now things seem a little odd and it seems like something's caused a memory leak. Rather than chase it down, I do a reboot instead. Whoops -- mistake. Gentoo (configured in a Xen environment) has a known bug which causes some problems. A trivial fix but I need to boot with a Live CD or something similar. And my server is in a data center in Seattle somewhere. Hmmm... I contact tech support -- do they offer a Live CD equivalent boot? They do not. SliceHost does. This is a big deal overall. Especially with Gentoo, I have a bad habit of goofing something up and breaking my boot process. Since I've always dealt with locally stored boxes, it's just a minor annoyance to have to connect a monitor and keyboard to the system and resolve the issue. However, the only fix VPSLink offers is "rebuild the box". So if I break the boot process, I lose ALL data on the box. Ouch.

So, after one month of using SliceHost and not really being excited about rebuilding my VPSLink box AGAIN, I've canceled VPSLink and have begun to migrate all websites from my old Fedora Core 2 server to the new SliceHost Gentoo. It seems stable, fast, and reliable and if I do make a mess of things I'm confident I can get it back up and running without too much pain.

Over the last week I've spent FAR too much time trying to resolve little things like successfully getting non-Roman characters into the MySQL database (it's odd the way the Gentoo MySQL USE flags work), getting Apache updated and still having PHP work, resolving a mess of library dependencies (I got to use revdep-rebuild -- yay!) and also playing with Jails and getting an SSH account setup that chroot's it to it's web page root. All fun stuff but time consuming. I love Gentoo though -- it's not always the cleanest but it seems like you're never "stuck". Or at least that's been my experience.

Tagged as: , , , 1 Comment
8Jan/083

Wiring (update 2)

Bill had commented on an older post about wiring and had asked for an update. I had thought I had posted one but couldn't find any when I just looked.

So, basically, at this point, the following is complete:

  • TV is installed in the main room. Wires are cable tied to the cantilever arm and go through a nice-looking plastic grommet in the wall. My options were to buy grommets at Lowe's (surprisingly, they were like $6 each) or simply steal some from some of our furniture (the little holes designed to have wires go into for your computer stuff). I went with the stealing.
  • All speaker wiring is done. I have speakers installed everywhere except the sub-woofer (which I installed in the back center. At some point I want a sub-woofer but the high-cost and low utility (hey, the kids are napping whenever we watch anything!) has delayed my purchase.
  • All wiring for Phase 1 is complete. This is a nice, official way of saying that there will be a phase 2 and we're not there yet. However, for this first phase, we have all audio wiring (to 5.1 speakers) installed, two power outlets (4 plugs) are installed and the cable re-wired and split (in the wall). In addition, all wiring through the wall to the TV is complete. I may change what I have going through the wall to the TV at some later date, but for now, it's everything we need.
  • No more mess in the main room (just the TV on the wall, speakers on the wall, and two floor speakers). Now we have extra room and I'm considering getting a nice leather chair (in black) that matches our surprisingly well-constructed Ikea couch.

Here are the pictures:

New Shelves
New shelves in closet. The small top shelf is just for wiring and equipment. We'll likely use the lower shelf for the printers. There's another shelf below that's outside of the shot. Notice the nice blue paint. It's not fun painting in a closet -- no room.

Top Computer Shelf
Here's the rather cluttered high shelf. It's close to the door and has all the audio/video equipment as well as the phone and two computers. The upper computer is just there temporarily. (I'm not sure exactly what to do with it -- need a computer?). It does have some spare room on the shelf for remotes and DVDs and such.

Top Computer Shelf (no flash)
Here's a shot of the same thing without the flash. This is what it looks like when you open the door. I tied some tube lights into the power plugs on the back of the receiver so that if you're using it, there's a strip of light that goes around the edge of the door frame on the inside. I considered a brighter light, but you don't need to see much and anything too bright is annoying.

New outlets
Here's a cable-filled shot of the new power outlets, the cable outlet and above (a little hard to see) the 5.1 audio outlet 5 stereo and one mono plugs (for the sub-woofer).

img_6205.JPGSpeaker on the rear, left
Here are two shots of the surround speakers. I found the mounting shelves at Lowe's for a pretty good price Looks a lot nicer than having those horrible little plastic arms.

Front view of system
Here's a shot of the front. This shows the TV mounted on the cantilever arm, the center channel (mounted a bit high but tilted appropriately) and the right front speaker (just on the floor). All the equipment is in the closet directly behind the TV. I dislike how I couldn't mount the TV in the center (but the arm does swing over and it's very close). The mind is a funny thing -- voices (played on the center channel) do sound like they're coming directly from the TV even though though they're clearly not.

Binding Posts
Here's a shot of the binding post. Hey, it looks professional! It might look nice to use banana plugs instead of bare wire, but that's too fancy...

Sub-woofer binding post
Here's the unused sub-woofer binding post behind the couch. This is an RCA-type plug so it's a little easier to connect than the screw-on/banana plugs used for the stereo binding posts.

Behind the TV
Here's what behind the TV looks like. You can see the plastic grommet in the wall (which is very functional). The arm itself is attached very solidly to a stud and the cable ties may not be pretty but they're not normally visible, so it's no problem.

I'm considering as part of Phase 2, the following:

  • CAT5, DVI and USB runs throughout the house. Realistically, probably just to the office and the "kitchen office" nook.
  • An upgrade of our main room TV (the in-laws have a bigger one -- it's time to upgrade! hehe...) and moving the upstairs TV to my office (for use with the computer)
  • Dispose of an old inkjet printer, move the newer inkjet to the closet, and get a laser printer also for the closet.
  • I'm considering (just considering) replacing my Linux machine with a dedicated "always-on" 8-core Mac. The brand new Mac Pros are just so darn cool. I could realistically do a 3-drive, RAID 5, 1TB array with the Mac and still have room on the main drive for "non-critical" stuff. I have a 1.5TB array now on 4 drives but the extra 500MB is somewhat unnecessary for redundancy. Down the road, I could upgrade to a 2TB (3x1TB HDs) setup if I needed to expand. The new machines have max RAM capacity at 32GB -- that's simply amazing (and expensive).

Note to scoffers: This does NOT mean I would give up my Linux server -- I would simply virtualize it and run it in all the spare RAM I'd have.

But except for the printers I'm not really thinking this is going to happen anytime really soon. Maybe by the end of the year. Just maybe.