Category Archives: tips&tricks

Great Resources: WindowsITPro and TechNet magazines

Two magazines that regularly help me learn more about managing Windows server systems are WindowsITPro and Microsoft’s own TechNet magazine.

One reason that I love WindowsITPro is the searchable online archive. It’s worth subscribing just to get access to all of those articles.

Microsoft’s TechNet magazine is available online for free, and also contains a lot of good information. I especially enjoy the Scripting Guys. They have a column in the magazine, and you can also just go to the Microsoft TechNet Script Center.

Right-click on Start menu, then Explore

If you right-click on the Start menu and choose “Explore” a lot like I do, but never want it to drill down to where it does, here’s a very handy tip that I found.

Disclaimer: If you mess up your registry and don’t have a backup, it’s not my fault.

  1. Run regedit
  2. Navigate to HKEY_CLASSES_ROOT\Folder\shell\explore\ddeexec
  3. Edit the value and replace "%l" and %I with the path you want Explorer to open to. For example: [ExploreFolder("d:\download", d:\download, %S)]

Redirecting stdout and stderr in a batch file

One thing that I constantly need and can never remember the syntax for is redirecting stdout and stderr in a Windows batch file or cmd script (actually, the syntax is pretty much the same for *nix shell scripts).

Rather than just a one-sentence note here to remind me, I’ll write a few more sentences as explanation. Hopefully this will save someone a little bit of time

For starters, you can redirect the output of a command to a file like so:

blah.exe > output.txt

That example will overwrite any pre-existing output.txt file. If you want to append to the file, use:

blah.exe >> output.txt

But this only redirects “standard output” (stdout). If your program encounters an error, the output generated by the error condition probably won’t show up in the file. If you want it to show up in the file, redirect “standard error” (stderr) also like so:

blah.exe 2>&1 output.txt

At the moment, I can’t tell you if that will append or overwrite. I’ll check that out and update the post…

Temporary email addresses

You want to sign up for that free whitepaper on the Internet, but you don’t want your email address to end up on a dozen more mailing lists — what do you do?

Use a temporary email address. Mark Gibbs has a great article about them at NetworkWorld.com.

Of course, there are drawbacks. If everyone starts using these, the companies giving out free stuff will have to find another revenue model. Mark says he’s going to talk about the consequences in a future issue of his newsletter.

Installing Cacti on CentOS with yum

I’ve been wanting to try the Cacti network graphing system for a while, but wasn’t sure how much effort it would take. Well, it wasn’t too bad, and here are the steps that I used. Hopefully this will save someone else a few minutes.I started with the CentOS 4.3 Server CD. I really like having a single CD that will install what’s necessary for a server. I use the .iso and VMWare Server, and can have a server installed from scratch in very little time. For this server, I chose to customize the list of packages. I unchecked Mail Server, Windows File Server, DNS Name Server, FTP Server, and Printing Support. I added System Tools. I’ll assume that you have your OS installed at this point.

Configure yum. Since I want to use yum as much as possible, and cacti is not in the default CentOS repositories, I added Dag to my list of repositories. This is as simple as creating the file /etc/yum.repos.d/Dag.repo and putting the following in it:

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=0
enabled=1
protect=0

That last option (“protect=0”) only does anything if you’ve installed the ProtectBase plugin for yum. This plugin keeps yum from updating system or base packages from non-CentOS repositories (or however you want to configure it). You can read about it here.

Continue reading