Geeks With Blogs
AngelEyes on .Net Tips, tricks and WTFs about Asp .Net, SQL Server and the likes.
Over the past couple of months I've added more and more customization to my development machine. So much so, that I'd like to write down what I did in case I'll need to re-implement it - and maybe also help some others who might be interested.

First of all, install and use Launchy. This small piece of software allows quick launching of programs, and learns your habits. Since it works like a search box, the first time you may need to type "visual studio" but the next time, "stu" just might be enough. For example, these days, to launch Microsoft SQL Server Management Studio, I just press alt-space, then type "sql" and hit enter.

On top of that, use the Runner plugin. It allows to set up custom commands.
For example, I have "KillDevWebServers" which runs "C:\Windows\System32\cmd.exe" with arguments "/C taskkill /IM WebDev.WebServer40.exe /F". This kills all open web-server instances created by visual studio.

Also, this will allow to run batch scripts which can automate almost anything.

More examples:
start and stop a website
Command via launchy, then a batch file
%systemroot%\system32\inetsrv\appcmd stop site /<sitename to stop>
%systemroot%\system32\inetsrv\appcmd start site /<sitename to start>

Push to git (using tortoisegit command line):
C:/Program Files/TortoiseGit/bin/TortoiseGitProc.exe /command:switch /path:<path-to-code>

Create a branch via launchy, and switch to it:
A combination of 
  • command in launchy : 
    • command: "C:/automation/git/<projectname>CreateBranch.bat"
    • arguments: "$$" (for forwarding the new branch's name)
  • the batch file which uses mysgit
cd "<path-to-code>" 
git checkout -b %1

command "C:\Windows\System32\cmd.exe"
arguments "/C iisreset"

Replace hosts file and flush chrome's dns + sockets
  • Create a folder in C drive C:\automation\hosts
  • Install AutoHotkey, which is a macro-running program.
  • Create "chromeClearDnsAndSockets2.ahk", a script to clear chrome's dns+sockets. Here is the one I'm using, as an example. It may not run on a different machine, I haven't tried it.
  • Create a batch file that replaces your hosts file with the file given as a parameter, then runs that macro. Here's an example.
  • Then, create as many batch files and hosts files as you need, where each batch files calls the "replacer" batch file, with the hosts file as parameter. Like so.

Posted on Monday, January 26, 2015 4:58 PM | Back to top

Comments on this post: Automated development environment

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © AngelEyes | Powered by: