I had a challenging evening yesterday with my old workhorse wireless router, the D-Link DI-624 (rev. C). The trouble occured in two stages. I'll give the problems faced, and what solved them for me.
No Outside World
OK. So, I get one of Comcast's self-install kits, and follow the directions to the letter. I install their software on a laptop, hook that laptop directly to the cable modem, and voila! we have internet. Next, I hook up the router, and access it wirelessly from the same Vista laptop.Local Access Only and no outside internet. The little manual from Comcast is useless, but as many readers probably know, Comcast often requires the MAC address on the device connected to their modem to be the same as the registered device. Luckily, I think of this, and there's a configuration setting in the router firmware (I have the v2.76 on my router)to emulate any MAC address I want. I run "ipconfig /all" inside a PowerShell window and find the MAC address for the laptop's ethernet port. Once I've set this in the routers administration panel, I'm googling like a pro.
No Work World
Now, the whole point of getting this set up was so that I could connect to my work's VPN and work from home. I am in Tennessee, and they are in Washington. A good VPN link is my lifeline. Every time I go to log in to my company's VPN network, the DI-624 reboots and I lose the connection. In fact, everyone in the house loses internet connectivity for a moment. I search the internet high and low for a solution. No love. Then I notice something odd on my router. It's date and time are set to April, 2002, close to the manufacture date. That's weird. Hypothesis: Maybe the IPSec, etc. magic that VPN uses relies on an accurate time on your router. I set it to be the same as my computer's current date and time, and try again. Everything works!
Now I'm not sure of the exact reason this helped, so if anybody wants to leave comments linking the symptoms to the disease, I'd love to see them.
I just decided to check out this new hulu.com, and right away found this hilarious SNL sketch:
My wife and I drove up to Pigeon Forge Saturday, and I did something I've been wanting to do for a long time: I got myself some cowboy boots and a Stetson hat. Now I'm one rootin' tootin' redneck physicist computer geek. I'm even starting to enjoy watching NASCAR.
Besides that, I just decided to finally see what this Twitter thing is all about. If you want to follow my Twitter exploits, here's the link: http://twitter.com/sdesciencelover
My wife actually cried as we drove the final 5 mile stretch of highway to her parents' house yesterday. Tears of joy. Seattle has been so miserable for us, disconnected from good weather, and familiar and friendly people. After a false start last night trying to connect to work, I am solidly connected today from a different laptop.
OneCare and VPN
Don't ever play around with putting 3rd party security software on systems that you need to connect to your corporate VPN servers. In my case, I had Windows Live OneCare on my system. It had to have anti-virus disabled in order to allow my company-mandated AV software to work. This caused OneCare to always be in a warning status mode, telling me I need to turn on AV protection. I asked on the OneCare forum what to do, and they recommended I not have it on my system, as it could mess with other AV software in unpredictable ways. I hadn't had any problems so far, but took that as my cue to uninstall to get rid of the annoying red icon in my system tray.
Now, previously, I had to enable some ports in OneCare's firewall to enable VPN connectivity. After uninstalling it, I tried to connect to my work VPN, and got an error message stating that I needed to enable OneCare's firewall to connect. 2 hours later, my corporate IT support had tried to help me through clearing any remnants of OneCare from my system. No success. The VPN connection manager still insists that OneCare is on my system.
Last Resort
Aside from paving the system, which I am reluctant to do since my system disks are in storage, and we our primary copies of family photos and videos are on it, my last option was to re-install OneCare. This is proving impossible. This is not an uncommon problem, judging from the OneCare forums. Microsoft needs to really improve its install/upgrade/uninstall picture for OneCare. I never recall having these kinds of issues with Norton or McAffee. Blame also lies with my IT department's VPN software for failing to realize that I've actually uninstalled the dang thing.
At the moment, my family and I are on the way to Tennessee to have boy #2. We decided that we didn't trust our doctors in Seattle, and would rather have the new baby with doctors we trust, and among family. I still retain my Seattle job, working remotely. In fact, we are currently staying with relatives in Broken Arrow, OK, so that I can work in their house using their broadband connection, before making the final 2 day (remember we're travelling with a toddler) trip into Tennessee. The kids are having a blast playing with their cousins every day. I've changed my blog theme, as you'll notice, to reflect our current surroundings.
I recently ran into a situation where my test code was failing only under certain types of test pass runs on machines that I have no access to. To diagnose the problem, I wanted to log the contents of the filesystem under certain directories.
I was already familiar with System.Diagnostics.Process and System.Diagnostics.ProcessStartInfo, which exist to let you launch processes from your .Net program. In fact, the problem was that I was attempting to launch an executable using these classes, but the executable file wasn't being found. I struggled for over an hour with trying to run 'dir /s', the command for recursively listing the contents of a folder and all subfolders, using the Process class. Eventually, I worked out one solution, shown in the C# fragment below, that allows me to run the command and grab the output into a string.
using System.Diagnostics;
using System.IO;
/// <summary>
/// Outputs recursively the contents of the specified path to
/// the test log.
/// </summary>
/// <param name="path">The path to list contents from.</param>
private static void LogRecursiveDirectoryContents(string path)
{
string batchFile = Path.ChangeExtension(Path.GetTempFileName(),".bat");
string commands = "dir /s" + Environment.NewLine;
File.WriteAllText(batchFile, commands);
ProcessStartInfo batchInfo = new ProcessStartInfo(batchFile);
batchInfo.UseShellExecute = false;
batchInfo.RedirectStandardOutput = true;
batchInfo.WorkingDirectory = path;
using (Process batchProcess = Process.Start(batchInfo))
{
SuiteLogger.LogInfo(batchProcess.StandardOutput.ReadToEnd());
batchProcess.WaitForExit();
}
}
As you can see, I used static methods in System.IO.Path and System.IO.File to generate a temporary batch file with my shell command as the contents. Then, I create a ProcessStartInfo object for running the batch file, setting 'UseShellExecute' to false and 'RedirectStandardOutput' to true. Setting these two properties will allow me to get the ouput of the batch file process from the Process's StandardOutput stream. The final step before launching the process is to set the 'WorkingDirectory' where the batch file will be executing from. In my case, I used the result of Environment.GetEnvironmentVariable("programfiles").
Finally, the process is launched in the context of a 'using' block, since Process uses native resources and needs to have Dispose() called on it in order to release them. I log the output using boilerplate code from the documentation of Process.StandardOutput and my test environment's logger.
I hope you found this useful and interesting.
Yes.My wife's laptop is the system in question. It is the nicest computer we have. She was really great, saying... read more
on Safely in Tennessee, OneCare/VPN Woes