-
vi for Windows
Posted on October 6th, 2010 No comments
Print
You’re probably asking “Why in the world would I want to use vi in Windows?”
Well, I didn’t have an answer to that until a couple of days ago. I was testing a software that seems to have been originally designed for UNIX and ran into an issue modifying a configuration file. I needed to add an entry to the config file so I used Notepad to do it but when I tried starting the service it failed. I looked at the log file and there was an error about an unknown token in the file.
I figured it was probably an encoding issue so I logged in to one of our machines that has Cygwin installed and created the config file there with the entry I needed using vi (surprisingly, I still remember how to use it
). I then copied it over to the server running the software I was testing and I already noticed the difference in file size. I started the service back up and it worked this time!Installing Cygwin on this server seems to be too much just to be able to use vi so I just did a quick Google search for “vi for windows” and found this software called Vim and there’s a Windows version of it. When you install it make sure to select the Create .bat files for command line use checkbox so you can simply just type in vim filename from the cmd window.
You can download the Windows version here: http://www.vim.org/download.php#pc
I don’t know why but I actually find editing text files with vi fun! Here’s a good cheat sheet.
-
How to change the TIME-WAIT delay and the highest source port number that can be assigned in Windows XP or Windows Server 2003
Posted on September 15th, 2010 No comments
Print
We ran into an issue last night where a web server we use for testing wasn’t able to open anymore connections. It turned out that our web application was creating too many connections too fast and Windows ran out of port numbers to allocate.
By default, Windows XP and Windows Server 2003 (not sure about other versions of Windows) wait 4 minutes before releasing sockets in TIME-WAIT state (RFC 793) and the highest port number it can allocate is 5000. There are registry keys you can add to get around these limitations (in our case this is just a temporary workaround of course, we obviously need to fix our code
).- Open the Registry Editor (Start -> Run -> regedit).
- Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.
- Add a new DWORD value:
- To set the TIME-WAIT delay, create a new DWORD value called TCPTimedWaitDelay and assign a decimal value from 30 to 300 (the number of seconds to wait before closing the socket and releasing the port number assigned to it).
- To increase the the highest source port number that Windows can allocate, create a new DWORD value called MaxUserPorts and assign a decimal value up to 65,535 (a user port is normally above 1024 so don’t set this too low, most likely you’ll need it over 5000 anyway if you’re reading this).
- Close the Registry Editor and reboot your machine.
Source: http://msdn.microsoft.com/en-us/library/ms819739.aspx
-
How to automate Microsoft Office 2007 installation
Posted on March 11th, 2009 9 comments
Print
I was just updating some documentation on our wiki and found some old notes on automating Office 2007 installation. We upgraded our Microsoft Office software early last year from Office 2003 (and a few Office XP) to Office 2007 and this simple installation script saved us a lot of time. Here are the steps:
Step 1. Copy the contents of the Office 2007 installation CD (or package) to a network share (eg. \\server\Office12).
Step 2. Run the Office Customization Tool and create a setup customization file (I got these instructions from a BDD 2007 document on Microsoft’s website).



Recent Comments