Monthly Archives: August 2009

Change timezone with TZ environment variable in Windows

If your program uses one of the following MFC or CRT function, then you can change timezone using TZ environment variable: CTime::GetLocalTm CTime::Format COleDateTime::operator= ctime _wctime _tctime _ctime64 _wctime64 _tctime64 mktime _mktime64 _utime _wutime _tutime _utime64 _wutime64 _tutime64 For example, … Continue reading

Posted in OS | Tagged , , | Leave a comment

PHP $_POST returns only one item for SELECT multiple HTML tag

PHP developers decided that values posted from HTML select tag with attribute multiple, somehow overwrites some internal variable data. Basically it goes like this – you have the following form with a select tag: <form action=”/post.php” method=”post”>   <select name=”MyMultiSelect” multiple> … Continue reading

Posted in Web | Tagged , | Leave a comment

CSS pseudo-element first-letter using form label element

Today I spent 1/2 hour trying to understand, why my labels do not respect CSS rule first-letter. Here is an example snippet: #myform label:first-letter {text-decoration:underline} <form id=”myform” action=”/test/” method=”post”> <label title=”From”>From:</label> The problem was, that The ‘first-letter’ pseudo-element can only … Continue reading

Posted in Web | Tagged , | Leave a comment

Edit any website / webpage with simple JavaScript

Copy the following one line JavaScript into address bar of browser to enable ‘edit mode’. javascript:document.body.contentEditable=’true’; document.designMode=’on’; void 0 Now you can add or delete any text, move images and objects, and more. Have a fun! Tested on Internet Explorer … Continue reading

Posted in Web | Tagged , | Leave a comment

Getting file size in KB using batch file

To get file size using batch file, we use variable with modifier. Then set /a, performs match operation (divide by 1024). Unlike other examples, this example works on any Windows language. @echo off :: Name: file_size.bat :: Author wishmesh.com :: … Continue reading

Posted in OS, Programming | Tagged , , , | Leave a comment

xcopy alternative for Windows Vista and Windows Server 2008 – ROBOCOPY

Robocopy – Robust File Copy for Windows is bundled with Windows Server 2008, Windows 7 and Vista. If you can not do something in xcopy, you probably can in robocopy. For example robocopy can: resume on network error, specify number … Continue reading

Posted in OS | Tagged , , | Leave a comment

VMware ESXi enable remote ssh access (unsupported)

To enable VMware ESXi 4.0 SSH (Windows Putty) access: At physical console press ALT+F1. VMware ESXi banner will appear. There is no prompt on the screen, but type ‘unsupported’ and press Enter. Now at password prompt type root password. You … Continue reading

Posted in OS | Tagged , , , | Leave a comment

VMware ESXi unsupported console

By default ESXi does not support console. To enable it you must be at physical terminal (screen & keyboard). Press ALT+F1 and type “unsupported”. Then at the Password prompt type root password. You are in. Tested on ESXi 4.0 @ … Continue reading

Posted in OS | Tagged , | Leave a comment

Make asynchronous call in PHP using PHP socket and custom User agent string

Recently I wrote about async calls in PHP. In the provided example from w-shadow.com there is one thing missing – User agent string. Changing User agent string to something unique is handy, when analyzing log file. You can see, if … Continue reading

Posted in Programming, Web | Tagged , | Leave a comment

Make asynchronous call in PHP

The problem is, that there is no standard way of making asynchronous function or other calls in PHP version 5. In search for async calls I found, that socket version works for me. Here is link to example from W-Shadow.com: … Continue reading

Posted in Programming | Tagged | Leave a comment