Archive for the ‘Code Scripts’ Category

In IT Stop anticipate the Future and Become More Responsive Instead

Tuesday, November 25th, 2014

Those working in corporate IT used to be able to depend on upon the fact that they were the only game in town. If employees needed technology or technology advice, it was only available from the IT function.

Now, as employees are more comfortable with using technology than ever before and with the advent of cloud-based services, employees will often happily buy the technology direct from vendors without having to go through IT.

And the rise of disruptive corporate tech aimed at helping employees in particular roles or improve particular processes – such futuristic things as mobile supply chain apps, SaaS ERP solutions, and end-user biometrics, to name a few – means IT professionals are less likely than they once were to know what’s most appropriate for the end user.

information technology

From ‘Anticipate’ to ‘Respond’

All of this means that it is now an essential leadership competency for all managers to be able to get the most from the technology and information at their disposal. And this shift has forced forward-thinking IT functions to spend less time trying to anticipate corporate technology trends and more time responding to those changes.

IT’s fundamental role hasn’t changed: it was, and will continue to be, to help its firm get as much value as possible from technology. But, instead of predicting the future and explaining it to line managers, IT teams should now set themselves up to help the line use the technology it deems most appropriate and ensure this use doesn’t result in wasted spending, excessive complexity, and the taking on of ill-considered risk.

Traditionally, IT governance has relied on long-term planning to make technology as efficient and reliable as possible. But with the rise of digitization and ever more niche corporate tech innovation, long-term planning often ends up missing the mark.

Three Ways to Become More Responsive

  1. Avoid multi-year commitments: Results from the benchmarking survey show that IT organizations are adapting to more unstable planning horizons. While previous versions of the emerging technology roadmap showed relatively consistent results for implementation timelines across organizations, the most recent results show timelines that vary widely, based on the companies’ perception of a technology’s relative risk and value.

Most notably, implementation timelines are shortening across the board as progressive CIOs avoid multi-year commitments— a reflection of their reluctance to “lock in” spending in areas where marketplace maturity remains unclear (e.g., for software-defined infrastructure).

  1. Shorten planning cycles: The velocity of change in both business partners’ demand and in-market offerings requires that IT organizations develop capabilities to adapt their roadmaps to shorter, more iterative cycles.

IT organizations have decreased their general technology planning cycles from three years to 18 months, according to survey results.

  1. Harness the opportunities of the cloud: Despite risk concerns, data show that cloud computing is already mainstream in corporate hosting, storage, and employee computing for 2014–2015. CEB’s data also indicate that more than a third of organizations are evaluating more extensive uses of cloud services, such as public cloud-based disaster recovery and desktop-as-a-service.

Furthermore, the fact that organizations are already moving toward a more sophisticated suite of employee computing capabilities, including access to cloud-based email and productivity tools, support for more diverse front-end interfaces, mobile access to video, etc., indicates that moving from “anticipate to respond” is becoming the norm in the employee computing capabilities area.

For More Information related to IT blog then visit at itetc



Copy open files from command line – Robocopy alternative

Tuesday, February 5th, 2013

Not too long ago we needed to keep two servers in sync (one way sync). We looked around for a command line tool that can copy files that only got modified on a set interval. However we needed that tool to copy open files as well.

Well, GSCopyPro was the tool that we found to meet all of our needs. Not only can it keep folders in sync, but it can actually copy open files as well. It took a lot of research and we evaluated a lot of good tools out there in the market. GSCopyPro was certainly the one the ranked high in our charts from performance standpoint and in terms of the features it offers.   (more…)

Application Development: Top 10 Programming Languages to Keep You Employed

Tuesday, February 5th, 2013

If you want to make money in programming what are the best languages to learn? Well, This question was asked to a host of developers, recruiters, born-on-the-Web startups and the creators of some of the most widely used programming languages out there. However, picking the language that is right for you also has as much to do with what kind of development you want to do and who you might want to work for as it does with how much money you want to earn.


For the enterprise, Java and Microsoft’s .NET rule. However, Java has the edge, as it is No. 1 language in terms of number of developers. According to Evans Data, there are more than 9 million Java developers in the world. That means there are tons of Java applications out there that will have to be supported, updated and maintained. Furthermore, Java is the language of the Android mobile operating system. Android provides the tools and APIs necessary to begin developing applications for the Android OS using the Java programming language. Java ranks No. 1 on the TIOBE Programming Community Index for June 2010 (after a brief stint at No. 2, behind C, in May). The need for Java developers to build new Java applications is not about to wane.


C# is a multiparadigm programming language encompassing imperative, functional, generic, object-oriented and component-oriented programming disciplines. Microsoft developed C# within its .NET initiative and the language was later approved as a standard by Ecma and ISO. C# also is slated by Microsoft to become the primary development language for Windows Phone 7. Like Java, C# is big in the enterprise. However there are considerably fewer C# developers than there are Java developers. But the importance of C# as part of the Microsoft .NET strategy and its support through the Visual Studio tools suite make C# a formidable contender in the programming language race. C# ranked No. 6 on the most-recent TIOBE Index

How to redirect traffic to another domain aka 301 redirect

Thursday, June 5th, 2008

301 Redirect

301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It’s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it’s the safest option. The code “301” is interpreted as “moved permanently”.

You can Test your redirection with Search Engine Friendly Redirect Checker

Below are a Couple of methods to implement URL Redirection

IIS Redirect

  • In internet services manager, right click on the file or folder you wish to redirect
  • Select the radio titled “a redirection to a URL”.
  • Enter the redirection page
  • Check “The exact url entered above” and the “A permanent redirection for this resource”
  • Click on ‘Apply’

ColdFusion Redirect

<.cfheader statuscode=”301″ statustext=”Moved permanently”>
<.cfheader name=”Location” value=””>

PHP Redirect

Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location:” );

ASP Redirect

<%@ Language=VBScript %>
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”,””

ASP .NET Redirect

<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
Response.Status = “301 Moved Permanently”;

JSP (Java) Redirect

response.setHeader( “Location”, “” );
response.setHeader( “Connection”, “close” );

CGI PERL Redirect

$q = new CGI;
print $q->redirect(“”);

Ruby on Rails Redirect

def old_action
headers[“Status”] = “301 Moved Permanently”
redirect_to “”

Redirect Old domain to New domain (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)$1 [R=301,L]

Please REPLACE in the above code with your actual domain name.

In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

Redirect to www (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all requests coming in to will get redirected to
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^ [nc]
rewriterule ^(.*)$$1 [r=301,nc]

Please REPLACE and with your actual domain name.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

How to Redirect HTML

Please refer to section titled ‘How to Redirect with htaccess’, if your site is hosted on a Linux Server and ‘IIS Redirect’, if your site is hosted on a Windows Server.

There is a good resource site that talks into similar details about domain forwarding, search engine friendly methods and so forth. check it out 


PHP error 5.2.4 Getting error “Error in my_thread_global_end(): 1 threads didn’t exit”

Thursday, October 25th, 2007

We have noticed a few web server admins to be getting an error message Getting error “Error in my_thread_global_end(): 1 threads didn’t exit” when running php on IIS windows servers in CGI. the issue is caused by libmysql.dll found in php directory. The file size for the libmysql.dll was 1.94 MB (2,035,712 bytes).

To fix the issue and clear the error message, you must replace libmysql.dll with an earlier version from release 5.2.1 of PHP.

I noticed many people were not able to get their hands on it so we have uploaded it to our server to make it easily availble.
Download php mysql libmysql.dll

DOS IF command to check file if exist

Friday, August 10th, 2007

Simple opertations can seem easy but in some instances it is challenging.

Many network administrators can find this useful when deploying new files to the company computer using batch files.

Here is some good info on how to use the if statement.

Performs conditional processing in batch programs.

IF [NOT] ERRORLEVEL number command
IF [NOT] string1==string2 command
IF [NOT] EXIST filename command

  NOT               Specifies that Windows XP should carry out
                    the command only if the condition is false.

  ERRORLEVEL number Specifies a true condition if the last program run
                    returned an exit code equal to or greater than the number

  string1==string2  Specifies a true condition if the specified text strings

  EXIST filename    Specifies a true condition if the specified filename

  command           Specifies the command to carry out if the condition is
                    met.  Command can be followed by ELSE command which
                    will execute the command after the ELSE keyword if the
                    specified condition is FALSE

The ELSE clause must occur on the same line as the command after the IF.  For

    IF EXIST filename. (
        del filename.
    ) ELSE (
        echo filename. missing.

The following would NOT work because the del command needs to be terminated
by a newline:

    IF EXIST filename. del filename. ELSE echo filename. missing

Nor would the following work, since the ELSE command must be on the same line
as the end of the IF command:

    IF EXIST filename. del filename.
    ELSE echo filename. missing

The following would work if you want it all on one line:

    IF EXIST filename. (del filename.) ELSE echo filename. missing

If Command Extensions are enabled IF changes as follows:

    IF [/I] string1 compare-op string2 command
    IF CMDEXTVERSION number command
    IF DEFINED variable command

where compare-op may be one of:

    EQU – equal
    NEQ – not equal
    LSS – less than
    LEQ – less than or equal
    GTR – greater than
    GEQ – greater than or equal

and the /I switch, if specified, says to do case insensitive string
compares.  The /I switch can also be used on the string1==string2 form
of IF.  These comparisons are generic, in that if both string1 and
string2 are both comprised of all numeric digits, then the strings are
converted to numbers and a numeric comparison is performed.

The CMDEXTVERSION conditional works just like ERRORLEVEL, except it is
comparing against an internal version number associated with the Command
Extensions.  The first version is 1.  It will be incremented by one when
significant enhancements are added to the Command Extensions.
CMDEXTVERSION conditional is never true when Command Extensions are

The DEFINED conditional works just like EXISTS except it takes an
environment variable name and returns true if the environment variable
is defined.

%ERRORLEVEL% will expand into a string representation of
the current value of ERRORLEVEL, provided that there is not already
an environment variable with the name ERRORLEVEL, in which case you
will get its value instead.  After running a program, the following
illustrates ERRORLEVEL use:

    goto answer%ERRORLEVEL%
    echo Program had return code 0
    echo Program had return code 1

You can also using the numerical comparisons above:

    IF %ERRORLEVEL% LEQ 1 goto okay

%CMDCMDLINE% will expand into the original command line passed to
CMD.EXE prior to any processing by CMD.EXE, provided that there is not
already an environment variable with the name CMDCMDLINE, in which case
you will get its value instead.

%CMDEXTVERSION% will expand into a string representation of the
current value of CMDEXTVERSION, provided that there is not already
an environment variable with the name CMDEXTVERSION, in which case you
will get its value instead.