Caveman's Blog

My commitment to learning.

Archive for the ‘Tools’ Category

PSExec: Remote command execution

Posted by cavemansblog on September 15, 2009

Ever wondered how to remotely execute a command on a remote machine. Here is what I had to deal with, leading to my research and a subsequent discovery of this powerful utility. We have this ASP.Net project that was getting deployed to the various in-house environments using Hudson, a continuous deployment tool. There was this requirement that the web.config had to be encrypted. In our project configuration setup, the files from the build (CI) server will be deployed/coped to various environments, however the web.config cannot be pre-encrypted, rather it has to be encrypted in the hosting environment.

I have created a batch file  that has to be executed on the deployed environment to be able to encrypt the web.config file. PSExec came to my rescue by being able to execute the batch file on the host environments from the continuous integration server. The account that is used to run Hudson should also have rights on the host machines to be able to run PSExec.

PsExec is a light-weight telnet-replacement that lets you execute processes on other systems, complete with full interactivity for console applications, without having to manually install client software. PsExec’s most powerful uses include launching interactive command-prompts on remote systems and remote-enabling tools like IpConfig that otherwise do not have the ability to show information about remote systems. [1]


psexec \\MACHINE_NAME c:\temp\encrypt.bat

I hope I made my point in showcasing a capability of this tool.

Reference:
1. PSExec – by Mark Russinovich

Posted in Tools | Leave a Comment »

SQL Server: Data dictionary

Posted by cavemansblog on July 15, 2009

Data dictionary creator [1] is a simple-to-use free tool that helped me immensely with a SQL Server database documentation. It stores all the information in Extended Properties, so it’s easier to keep the documentation in sync with the database as it changes. I was able to generate a data dictionary with a couple of of mouse clicks after I have entered the connection string. The dictionary can be exported to various formats: Excel, XML, Word and HTML. Click on the reference [1] for a step by step tutorial on the usage of this utility. (The current version does not seem to support SQL Server 2008). This can be download from codeplex.

Data Dictionary-90

Reference:
1. Data Dictionary Creator

Posted in Sql Server, Tools | Tagged: | Leave a Comment »

Useful run commands

Posted by cavemansblog on July 3, 2009

Here are some of the commands that can be executed from the Run dialog box in the Start menu to launch the following applications. I have picked up them over the years and am not sure of one particular source as a reference.

  • MSConfig – Microsoft configuration utility
  • Explorer – Windows explorer
  • Cmd – Command window
  • Inetmgr – IIS Manager
  • Services.msc – Windows services Administrator
  • Pbrush – Paint brush
  • Chrome – Google chrome browser.
  • Firefox – Firefox browser
  • ISqlw – Query analyzer
  • Eventvwr.msc – Event viewer
  • Dcomcnfg – Component services
  • Notepad – Notepad
  • Calc – Calculator
  • Winword – MS Word
  • Excel – MS Excel
  • Access – MS Access
  • Regedit – Registry editor
  • Taskmgr – task manager
  • Write – Wordpad
  • Osk – On screen keyboard
  • Logoff – logs of the user
  • Shutdown /s – shutdowns the system
  • Perfmon – Performance monitor
  • Mstsc – Remote desktop
  • Firewall.cpl – Windows firewall
  • odbcad32 – ODBC administrator

Posted in Sudheer Reddy Battula, Tools | Tagged: , | 2 Comments »

Recursively delete a folder

Posted by cavemansblog on July 1, 2009

Today is the first day for me on another project at work. I could not get the latest code  from Subversion [2] because I did not have sufficient privileges. I had borrowed the source code from a colleague so that I can get up to speed with the existing framework, while the permissions are resolved. In the solution that I copied all the sub folders had a “.svn ” folder and I just did not like that.

I thought of writing a .Net console app to recursively delete all the “.svn” folders of the solution and as always googled first, to see if there was a easy alternative — why reinvent ;) . Indeed there is a command line solution by “Eber Irigoyen” [1], that does a fantastic job. Here is how I used the command;

1. Open a command window.
2. Navigate to the root folder from where you would want to start deleting the “.svn” sub-folder recursively.
3. Execute the following command


for /f "usebackq" %d in (`"dir *.svn /ad/b/s"`) do rd /s/q "%d"

Replace the “.svn”  from the command with another folder name to delete it recursively.

Reference:
1. Recursively delete svn folders easy way
2. Subversion

Posted in Tools | Tagged: | Leave a Comment »

Free Screen Capture Utilities

Posted by cavemansblog on June 19, 2009

Moi only knows how many times I would have wished that I owned a copy of Snag-It [3], a screen capture tool. This is one of the most awesomest screen capture aid available in the market. It even supports the capturing of a multi-page screen shot. This tool is easy to use, has a bundle of exciting features and the interface is very sleek. I know that not everything is life is free; meaning to say some are infact free and here is a list of a free alternatives:

Cropper [1] is a screen capture application written in C# on the Microsoft .Net platform. It makes it fast and easy to grab parts of your screen. Use it to easily crop out sections of vector graphic files such as Fireworks without having to flatten the files or open in a new editor. Use it to easily capture parts of a web site, including text and images. Cropper can save the screen capture to the clipboard, have it sent directly to the printer, or automatically save it to disk as a BMP, PNG, or JPG file. The nice set of features in this app makes it my favorite free screen capture aid.

Cropper

Tebo Screen [2] is a simple screen capture utility developed by Guy Thiebaut [2]. It is another C# .Net application that has three buttons; Capture Screen: To capture the entire screen, Capture Area: holding down the left mouse button, users draw a rectangle specifying which part of the screen they wish to capture. On releasing the left mouse button, the user selects a file name and the area behind the drawn rectangle is captured to this file. Exit: obviously, to exit the application. I like the simplicity of the code and is an excellent source for beginners to understand how this is done programatically. BMP is the default image saving format, the code can be tweaked very easily to save the image in other formats like .jpg, .gif, etc.

Tebo Screen

ZScreen [4] is another C# .Net 3.5 utility for the same purpose. I am yet to try this and will post about this soon.

FireShot [5] is an add-on for the Firefox and IE browsers that can be used to capture entire or part of a web page. This comes with an editor that is handy to manipulate the screen capture. Screen shots can be saved in one of these formats: PNG, GIF, JPEG and BMP. Check here to download Firebox add-on and here to downloadIE add-on.

References:
1. Cropper by Brian Scott
2. Tebo Screen by GuyThiebaut
3. Snag-It from Tech Smith Corporation.
4. ZScreen by Zachary Hudock.
5. FireShot

Posted in Tools | Tagged: , | 3 Comments »