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 :: Calculate file size in KB from %1 set /a size = %~z1 / 1024 echo …

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 someone is messing with your hidden asynchronous PHP script. Here is an example, that uses …