Archive for the ‘tools’ category

Automatic Web Server Monitoring

February 15th, 2011

Hi there! Here’s another quick suggestion for all of you out there who have to deal with a lot of web server environments and need to make sure that they’re all alive and responsive. Sure there are all sorts of tools for server monitoring and performance tracking, but I found that most of the time you just need to know if the server is up & running. And of course you should be notified if it’s not. Here’s my short Python script that does just that. You will need to tweak it a little to use in your environment. First of all I’ve set the content threshold to 2000 Bytes which means that the expected length of the page content returned is no less than 2000 Bytes. If it’s below this value, one could assume that something’s fishy going on. You might want to change this value to something else depending on what your web server returns. Another thing that you’ll want to change is the servers dictionary in the main() method. The logic behind this is that each of the web servers is assigned a responsible person that you would need to inform if something is wrong with the server. You should list all your servers that need to be monitored and the responsible person’s e-mails. The final change is on the line where you instantiate the HeartbeatMonitor class. The first parameter admins is a list of e-mails of the people who will receive the notification if any of the servers are down. You can leave this list empty if you want, but I usually put my e-mail in there since I like to be in the loop. The second parameter mailServer is the SMTP server which will be used to send notifications so make sure this one is set correctly. This parameter is actually optional and localhost will be used as the default mail server if you decide to skip it.

Search for Files on Remote FTP Server

February 14th, 2011

I’ll keep this one short. Don’t know about you, but I’ve always been frustrated about how most FTP clients won’t let you search for files on a remote FTP server. I remember I used some client that had this functionality, but this was quite a while ago so I can’t even remember the name of it. If someone else knows any lightweight tools that let you do that, please leave a comment. Recently I needed to do some quick searches on the servers that I have only FTP access to. And you know what they say… “when you can’t find the right tool for the job – write it yourself” Actually I don’t know if anyone says that :) but I decided to do it and put together a Python script just for this task. I’m not sure if many others have run into a similar problem, but I put it on GitHub anyway. I called it FTP search for obvious reasons. You can find the script and a short documentation there. The only prerequisite is that you have Python 2.7.x installed. I can’t promise you that it will work with Python 3.x but you’re welcome to try.  If you have any ideas on how to improve this little tool and wish to contribute then leave a comment bellow or contact me via e-mail that’s specified on GitHub’s project page.

Modifying Treepie To Display File Count

January 25th, 2011

I’ve already talked a bit about managing large amounts of files in my post Disk efficiency when dealing with tons of small files so you can kind of tell that I’m a proponent of having as little files on disk as possible (but not less). In my everyday tasks I’m using this program called Everything by David Carpenter and I suggest you check it out if you don’t know it yet. The concept is simple, but the consequences are immense – the program indexes all the files and folders on all volumes connected to your computer i.e. your hard disk drives, flash drives, cd/dvd-roms, etc. And it tracks the changes so this index is always up-to-date allowing you very fast access to ANY FILE on your computer. The thing is that it indexes all the files on startup so the more files you have the longer it takes. To illustrate another reason why too many files aren’t great see the picture below.

Online Tools That Make My Life Easier

November 25th, 2010

Imagine a situation where you’re sitting in front of a colleague’s computer or one that is publicly used. By definition you’re missing all your favorite tools that you’re used to and you can’t install them even if you wanted to. Here’s a short list of online tools that help me a lot when I’m using a computer other than my own. These do not fully replace the desktop equivalents, but they’re good enough. Though it’s not a list of tools that replace desktop applications, but rather a list of online tools that complement them and some provide functionality that does not exist in desktop based applications.

Improving Architecture with Structure 101

July 18th, 2010

I want to share with you yet another tool this one will help you with the architecture development. The tool is called Structure 101 and you can download a trial version here. That’s right, this tool is not free, but it does it’s job really well and at the time I can’t think of a free alternative that would be just as good. If you do know any good alternative, please, do leave a comment. The first thing you need to do is chose the version that’s right for you. There are three main flavours:

  • JAVA – cross platform

Fun System Tool for Process Analysis and Debugging

July 14th, 2010

Over time I used quite an arsenal of various small utilities and tools for Windows that do some specific task. Some of them are outdated, no longer maintained, others I simply forgot because they were rarely used. One tool that I’ve been using for a while now is Process Explorer by Mark Russinovich who created many great tools to the Windows platform. If you don’t know this tool it’s a replacement for the Task Manager with many great features for monitoring processes, file handles, etc.

Linux GUI on Your Windows Desktop Through the Magic of Xming

May 18th, 2010

I decided to write down a short introduction to Xming. For those not in the know Xming is an implementation of the X Window System for Microsoft Windows operating systems. This means that you can install this software on Windows, run a remote linux program that requires a graphical interface and see the result on your local computer. Visit the Xming home page and see the screenshots if it seems difficult to wrap your mind around the concept.

Download the latest version of Xming software from their home page and install it. Prepare the remote linux machine by connecting to it via SSH and checking if the file /etc/ssh/sshd_config contains an uncommented line

Task automation and ultimate control over Windows

March 22nd, 2010

This post is a continuation on my quest for applications that help me do more by doing less. After choosing and installing an application launcher mentioned in my previous post the next thing I wanted to do is automate a few tasks that I do several times a day. Each one takes a while and throughout the day this adds up. The worst thing is that sometimes another person distracts you from what you were doing and then it takes a while to get back into  it. An interesting coincidence is that while looking for some kind of tool for this I found a very interesting video – a talk called The Productive Programmer by Neal Ford at the Oredev conference. It’s about 50 minutes in length, but I believe it’s a time well spent. He talks about the mechanics of increasing your productivity which, among other things involves learning to let go of the rodent sitting next to your computer that you call a mouse.  After watching this video I went and tried out a few tools mentioned that I didn’t use before and found the Holy Grail of automation software – AutoHotKey. I can’t believe how I managed to live without it all this time. By the way I suggest you download the SciTE4AutoHotKey to help you write the automation scripts. I started simple by defining a few keyboard shortcuts for some actions like running an application or opening a specific webpage.

Keyboard oriented application launchers

March 21st, 2010

Last week I set out to find the best tools I could to increase my overall productivity when doing my everyday tasks and I want to share my experience. When writing this I quickly realized that putting everything in one chunk would make it quite long and as a fan of blog post brevity I decided to split it into a few posts. This one will cover applications that allow you to quickly launch other programs on your machine.  First thing I’ll mention is what lead me to this search in the first place and that is – dock applications. You know the ones like in Mac OS that sit at the bottom or some other part of your screen and look pretty, but in my experience are a huge obstruction to productivity. I thought I was solving the problem with the desktop clutter by having all of the useful applications at my fingertips. But the thing is I’m always conserving the screen’s real estate especially when coding and so I set the auto-hide option. It took only a few days to bother the hell out of me because there’s no place for it at the bottom because of the task bar, no place at the top because it pops up when I’m trying to reach a menu item. It’s annoying even at the sides of the screen because of the scrollbars and the layout of some of the applications that I use. I wanted to get rid of it so badly, but I still wanted a quick way to launch my applications without going back to desktop, opening the whole Start menu hierarchy or remembering tons of hotkeys for each application.

Disk efficiency when dealing with tons of small files

March 12th, 2010

When dealing with source code from projects of various sizes the disk quickly gets filled up with literally tens or even hundreds of thousands of files. Especially when the project is under source control and has metadata files for each of the project’s file. While you may still have a lot of disk space left on the drive I found that this kind of setup is highly inefficient when jumping from file to file in an IDE or doing a full text search. While thinking of a quick fix for that one thing came to mind – virtual disk images. So I grabbed my TrueCrypt and created a few volumes for the bigger projects. I know that TrueCrypt is not actually meant for that, but while I was creating the volumes I realized that in my case this was an advantage, because not only am I creating a single file on the physical disk that will be easier to maintain, but also I’m encrypting all the project data thus gaining an additional security layer. I’m not going to get into the details of actually creating a volume file since it is well documented in the TrueCrypt Beginner’s Tutorial though I will advice one thing. Source code files under source control contain a whole lot of tiny metadata files which contain less than 1KB of information, but the most common file system cluster size is 4KB. In practice this means that if you have a file on your disk which contains only the string “hello, world” it will still occupy 4KB of disk space (assuming that your disk’s cluster size is 4KB). It’s the smallest amount of data that can be allocated for file storage. You can read more about cluster sizes here and here. When creating a virtual disk image TrueCrypt lets you choose the cluster size before formating the volume. In my case selecting the smallest available cluster size like 512 Bytes is the most efficient choice and in some cases saved nearly 20MB. I know it’s not much, but I just like things efficient :)