The Developer Day | Staying Curious

CAT | Tools

Sep/08

3

Linux like terminal on Windows!

Have you ever wanted to make your CMD window fullscreen? You did? And it didn’t work? Too bad. Have you ever wanted to search something in your files using grep, awk, less, sort? Have you ever tried to mass rename your files ? You did? And it didn’t work? Too bad.Be worried no more! First you need Cygwin. Cygwin is a Linux-like environment for Windows. It also provides you a lot of tools which provide linux look and feel. Install cygwin while changing none of the default settings. Now you can do something like this:

Cygwin Terminal 

Notice that this is a simple CMD like window but it now has some nice colors and new shiny tools.Now in order to make it even more cool you need a tool named PuTTYcyg. PuTTYcyg is a patched version of PuTTY that, in addition to telnet, rlogin, ssh, and serial connections, can also be used as a local Cygwin terminal instead of the Windows console. Download the package and unzip it somwhere. I put it in C:\Program Files\puttycyg. Now double click on a file named putty.exe. Now fill everything as in the image bellow and press save.

 cygwin putty configuration 

Now make a shortcut of this putty.exe on your Desktop. And change it’s properties like this:

cygwin putty terminal shortcut  

Click apply and you are ready to go myfriend! Double click on the shortcut and you should be able to do thins like this including full screen resize yay!

putty cygwin terminal 

Now .. Begone CMD!

, , , Hide

Oct/07

12

PHP Fatal Errors Handling Continued

In my previous post I wrote about few ideas how to capture PHP fatal errors. After some more research I found a few more elegant solutions.

You can wrap all your site with ob_start which accepts a call back function as a parameter which it calls when the content is flushed to the browser. You can use that call back function to preg match for fatal errors.

Another solution is the one I like the most. In my previous post I wrote about a possibility to examine the PHP errors log. Well I found that there are log watch tools to do that easily.

With something like this:

watchfor /(PHP.*error:.*?)$/i
mail addresses=root
threshold=on
threshold track_by=$1,type=limit,count=1,seconds=10

# swatch -daemon -c /root/php_fatal.conf -tail-file=/var/log/apache2/error.log

You can easily track php errors and send them to yourself over the email. And the most exciting detail about this tool is that it won’t spam you with thousands of emails with the same error.

, , Hide

Aug/07

21

PHP load testing tool

I needed to test load some of our applications. I’m currently using a windows machine as my workstation. For some weird reason I’ve decided to develop such a load testing tool myself. It was both interesting and fun.

I used php curl extension multi_ functions that are only available since PHP5. The script is very simple. It accepts an integer parameter with max clients and a string parameter where a URL list file resides. You can run the script either from the command line or a browser. The script outputs average client response time, average responses per minute, total amount of responses and time elapsed during test loading. After a client responds the tool requests another URL. You can only stop the tool by killing the process.

You can try my php test loading tool yourself. If you are looking for something more serious try apache ab under Linux or Cygwin.

, , , Hide

Jul/07

9

Free multiple XHTML, HTML validator tool

If you’re working with SEO you want to make sure your website is XHTML valid. SE crawlers understand your website better if a website is XHTML valid. To make sure that a website is XHTML valid one would use http://validator.w3.org validator.

A problem arises when you need to check fifty or a hundred pages. For that particular reason I wrote a yet another extremely simple tool to validate lists of URL’s. It uses the same w3.org validator by opening the URL and searching for a phrase “page is valid”. You can check out my XHTML validator online or you can download the source code of HTML validator.

Basically all you need is a list of URLs and the validator will tell you which pages are valid and which ones are not. I hope you will find it useful. Let me know what you think by leaving a comment.

, , , Hide

Jun/07

22

Free Online SEO Sitemap Crawler Tool

The company that I work for has a lot to do with SEO, SEM, PPC. There are such a thing as sitemaps and URL lists that are used in SEO for Search Engines to optimize your site easier and better.

We have a lot of sites which have some SEO development going on. To generate these URL lists is not a task for a human being to do and I didn’t want to develop a custom sitemap generator for each of our projects.

I have tried to search for a tool that could generate these URL lists given only a single root URL. It was a while ago so I cannot say that such tools don’t exist. I also like my tools to be simple and easily extended so I developed a tool of my own. It’s a simple crawler that only needs to know the start URL and the base URL and it can find all your URLs in no time. The tool remembers the pages it has already visited. So for example let’s say I wanted to know all my blog URL’s. I just feed the crawler two URLs and wait for the results. The tool also ignores any outside URLs and adds the base URL to relative links.

You can download the crawler or try it out for yourself.

Please read comments below if you are interested why the second input field is needed.

, , , , Hide

Jun/07

20

XML beautifier tool

This post describes a tool that I wrote long time ago. By now I have published a new refactored version of the XML beautifier which solves a few problems of the original tool.

I’m currently working with a system that is communicating with various third parties using web services. There are times when I need to view some of the XMLs or output them for some particular reason. Because of the last reason I wanted the beautifier to be written in PHP so that I could implement it easily. After spending some time googling with keywords like “php xml indent”, “php xml output”, “php xml human readable”, “php xml beautifier” I found that there are some code snippets or incomplete /not fully working classes / functions.

I’ve also tried pear.php.net and there indeed is a package named “XML Beautifier” that is no longer maintained. And I was frightened away by lot’s of dependencies: PEAR, XML Parser, XML Utilities, XML Beautifier .. Brrrr ..

Finally I visited phpclasses.org and found a class named “Beauty XML”. It’s simple, works but has a few bugs. So I modified the class to do the following things:

  • To ignore adding a new level after if finds a tag like <tag />
  • To remove all XML headers
  • To remove white spaces from situations like “</tag2> </tag1>”

You can download the beauty XML or try it out yourself.

I think there still may be some XMLs that don’t get indented nicely and if i don’t find out that myself maybe You will. So please tell me if you do. I’ve also added a simple interface file to view XMLs in your web browser.

Maybe you already have or know a tool that does this job perfectly and I would be happy if you shared this with me.

, , Hide

<< Latest posts

Find it!

Theme Design by devolux.org