Making Your Own Tiny URL's with PHP

May
06
2007

As I've been using Twitter to post frivolous things that aren't worth posting as real posts here on the site, it becomes clear pretty quickly that if you want to post a URL, the 140 character limit gets in the way. The typical solution the people go to is to use something like TinyURL to get a shorter version.

While I could use that service, I decided I'd rather have my own version on my server, so this afternoon, I coded up a quick solution. It consists of an .htaccess file to route everything in a directory called "lnk" to a PHP script. That PHP script either creates a new link or redirects you to an existing one. I also made a quick bookmarklet to make creating links quick and easy.
Read the rest of this entry »

I Fell For It

May
04
2007

Earlier this week, Shelly and I were discussing our upcoming trip to Ireland. I mentioned that I'd done a bit of digging on airfare and had found some pretty good deals that got our tickets into the $750 range.

"Those are coach tickets, right?", she asked.

"Yeah. Why wouldn't they be?", I responded.

"Because we're flying to Ireland in first class. I thought we talked about this.", she continued.

I'm not sure exactly what she said immediately after that because there was this loud buzzing sound in my head that kind of muffled what she said. I think the buzzing came from the giant flying dollar signs that were whizzing around my head at the time.

As the buzzing subsided, I rejoined the conversation.

"…because I'm OK with flying coach here in the US, but for a long flight across the Atlantic, I want something like British Airways first class. You know, with the beds…"

The whizzing dollar signs were back. I didn't notice the teeth before.

I objected strenuously, indicating my complete unwillingness to go along with this particular preference. I then moved on, in completely predictable fashion, to cite the actual cost of such flights (anywhere from $3,000 to $11,000 per seat) in comparison to other things in our lives (like the fact that we only paid $6500 for my truck 4 years ago).

The argument continued until we went to bed and I dreamed about the whizzing dollar signs devouring our life savings. I spent much of my "break" times during the following day building a case against this extravagance: comparison flight prices, other things we could buy instead of that flight, things we could do *on* the vacation with the same money, etc.

In short, I was preparing to go to war over first class airfare. I went home with all of my ammunition, prepared to dig a trench and start firing.

We sat down to dinner and I launched into my prepared tirade. I got maybe 2 sentences into my speech when Shelly interrupted me.

"You know I was just messing with you, right?"

The whizzing dollar signs fell to the floor. She knew me well enough to pick something that would really get to me and used it to reel me in. I completely fell for it.

First class airfare is one of those things where even if I had $300 million in the bank, I still wouldn't pay for. The idea of paying $2500 to sit in a bigger chair for 10 hours just doesn't make sense to me on any level except complete extravagance. She knew that.

We joke around and tease a lot here. Usually, Shelly's teasing is on a small scale, but this time she brought out the big guns and won in a huge way.

Running Vista Inside VMWare on Ubuntu

May
04
2007
VMWareVista

A month or 2 ago, Geeks.com sent me another one of their emails that I should just get around to blocking. That's because they're probably one of the biggest source of revenue for my impulse tax. They don't necessarily offer the best stuff, but every one of those emails has something tempting in it.

Anyway, the email in question listed a "debranded" Compaq/HP desktop specced at a Sempron 3800+/512MB/120GB/DVD for $239. I had been thinking about setting up a VMWare host box to put all of my virtual appliances on (or at least the important ones). At the time, they were sitting on machines that really had other purposes, so the idea of a machine that just played host appealed to me.

I picked up one of them (and paid the impulse tax for it), installed Ubuntu and VMWare Server on it and put my email and PHP development server onto it and everything was humming along.

Now, given that most of my computers have been migrated to Linux as their real OS, I don't have much for Windows environments laying around. However, because I do some Windows development, I do need them. In particular, I needed a setup for *doing* that development. I've got the WinXP home theater PC and a Windows laptop, but neither is set up for doing real development work.

So, I figured that a good test of this VMWare host box would be to create a virtual Windows development workstation. And, since I have no intention of buying a Vista-specific machine, but *do* need to work with the OS to ensure I keep up to date on the platform, I figured I'd make it a Vista-based workstation (yes, I like a challenge).

Unfortunately, the 512MB of RAM the machine came with just wasn't going to cut it, so I ordered 2GB more of RAM, which came last night. Even after buying 2GB of RAM from Newegg, this box was still only $350 or so. Vista, on the other hand isn't cheap. However, I consider this a necessary cost of being in this industry and ordered that too.

The install went like any other VMWare install combined with any other Windows install. The machine boots up and is available on the network via remote desktop. I'm going to be using it primarily that way, using the Terminal Services Client in Ubuntu. Incidentally, that's the best remote desktop client I've used for RDP. When it's in full-screen mode, *everything* works like you're sitting at the remote computer: the WIN+E and other key combinations, CTRL+ALT+DEL, and all of the other stuff that efficient users of Windows workstations are likely to miss with other remote desktop connections.

At any rate, the machine is now running 4 virtual machines:

  • Ubuntu Email - My IMAP/SMTP/fetchmail setup allocated 128MB of RAM.
  • Ubuntu PHP - My PHP development server allocated 128MB of RAM.
  • TrixBox - The PBX phone system project I'm tinkering allocated 256MB of RAM.
  • Vista Business Workstation - This new one allocated 750MB of RAM.

What's amazing is that with all 4 of those running, plus the host OS, the CPU is idling aroung 16% and despite the fact that 1.25GB of RAM has been provisioned for the running virtual machines, they and the host OS are only using 340MB of RAM together.

Sure, that'll go up when I start using the Vista workstation heavily, but I'm just impressed with how well it all runs even at low levels of utilization. I *did* shut off all of the eye candy in Vista, which I'm sure made a huge difference. That's both a performance gain and my personal preference.

Regardless, the fact that this $350 box is being used as: a Linux email server, a Windows workstation, a Linux PHP server and a phone system all at once is pretty cool.

Leaving My Job and Back to Independent Contract Consulting

May
02
2007

Today I had all of the official conversations with all of the people who need to know. I'm leaving my job at Meritide. There were a lot of things that contributed to this decision, many of which are personal and private and have nothing to do with Meritide. We're talking about how I will be able to help them with my areas of expertise on a contract/hourly basis going forward, so we're parting on good terms.

I'll be returning to doing contract consulting, starting a 1 year contract on May 21 in Eden Prairie, working on a complicated Javascript/AJAX app on top of Jakarta Tapestry. It should be interesting. All of this work will be routed through Pragmapool, Inc., the company I own with someone else. Pragmapool hasn't had any employees for the last year or so, but everything is still set up, so it won't be a big deal to start running invoices through again.

I'm both sad and excited about this change. I enjoyed working with the people at Meritide and got to build some very interesting and challenging software while there. I had every intention of sticking around for a while. Unfortunately, situations change and this is the best decision given the circumstances. Of course, I'm also going to miss playing Call of Duty at lunch. :)

I am excited, however, to be back working "for myself". There's a freedom working under 1099 that isn't there in even the best W-2 situation. The relationship is just different. One thing that I've been wanting to be able to do more of is work on some of my own projects and put more time into them. To that end, I'm going to be putting "workshop" days into my schedule along with sick/vacation days. On those days, I'll work on projects like my Atom Publishing Protocol implementation for a full working day and pay myself normally out of the pool of money that will get set up to manage cashflow (that's another article).

At any rate, the next couple of weeks will be transitional as things shift around, but this move is something that needed to happen and moves me forward.

Decompiling C# DLL's with Reflector for .NET

May
01
2007

A couple of days ago, I had a coding accident. I moved a couple of files into a subdirectory of a C# DLL project. I did a bit of work on things and needed to roll back to earlier code. So, I had Subversion do exactly that.

I moved on and built the project a couple of times. Then I went to look at one of those moved classes and discovered the disaster. Somewhere along the way, an entire days worth of work disappeared without getting committed into the repository. Actually, it was a hugely *productive* day of work that disappeared.

As I looked down the deep pit that my stomach fell into, I heard a voice in the back of my head saying, "Isn't it possible to decompile .NET DLL's and EXE's?" See, I *knew* for a fact that I'd compiled and committed the DLL in the interim.

Indeed it is. Unless someone goes to the effort to prevent it, all of the code is actually available in the DLL. However, I'd never needed to do this, so I went looking for a solution that wasn't in the "Enterprise" price class. Fortunately, I found Reflector for .NET, which, ironically, I'd already bookmarked for the Writer for .NET project on the same page a while back.

Instead of $2500 (the cost of one of the solutions I found), this baby is free. And it works. Oh, how well it works.

I've seen other decompilers for other languages and what you usually get is variables and methods named "widkriwp" instead of "GetUser", which leads to the joyous experience of trying to rename everything until it both works and makes sense. But, this resulted in pretty much my exact source code.

Variables, methods and class names were all intact, neatly indented with hyperlinks to trace method definitions back to their origins. In short, I pretty much had the exact thing I needed to restore the project to its previous state: a giant pile of spaghetti. But it's *functional* spaghetti and I could move on.

In short, this thing saved my hide. Of course, now I want to point it at every .NET DLL and EXE on my Windows workstations and peek at the insides.

  Newer Entries »

J Wynia

For better or worse, I'm the guy who runs things here. I'm a web consultant, software developer, writer and geek from Minneapolis, MN. This site is a fairly wide cross-section of the things I'm interested in and enjoy writing about.

Oh, and if you happen to be looking for hosting for your Subversion repositories or just web hosting in general, take a look at Dreamhost. It's what I use for Subversion and your signup helps me out.

Feeds and Links


www.flickr.com
This is a Flickr badge showing public photos from J Wynia. Make your own badge here.

Search


Pages

Archives

Computers Blog Directory
© 2003-2008 J Wynia. All original content is licensed under the terms of the Creative Commons Attribution license unless otherwise noted. Content from other sources is licensed under its original terms.