Thursday, July 29, 2010

rank earned

Cool, now I'm a Wizard on the experts-exchange site!

Wednesday, July 28, 2010

Security asshole

To remove elevated right requirement from a folder in a windows 6+
you just need to add the "Modify" rights to the group "Users".
That's it.

MSXML error

Suddenly an attempt to instantiate a "Msxml2.ServerXMLHTTP" object on a workstation begin to lead to the "ClassFactory cannot supply requested class" message.
Just "Msxml2.XMLHTTP" works though.

Monday, July 19, 2010

IIS tricks

I wrote a VBscript to automate IIS7 setup to use with ISAPI extension.
It creates absolutely the same XML node in the global config file as if I add the handler
mapping manually via the UI. But if I add the mapping manually, the
server works as it should (loads and calls the extension's dll, (does
not matter the requested file exists or not)), but if I use the script
like below, the server sends the file back to the client (if the file
exist) or returns the 404 if the file does not exist.

const TrgExt = "*.sxt"

const waDll = "myISAPI.dll"

Dim adminManager
Set adminManager = CreateObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"
call AddHandlierMapping( adminManager, "C:\app_folder" )

function AddHandlierMapping( adminManager, path )
On Error Resume Next
Dim handlersSection, handlersSectionCollection, addElement, addProperties
Set handlersSection = adminManager.GetAdminSection("system.webServer/handlers", "MACHINE/WEBROOT/APPHOST")
Set handlersSectionCollection = handlersSection.Collection
Set addElement = handlersSectionCollection.CreateNewElement("add")
Set addProperties = addElement.Properties
addProperties.Item("name").Value = "Tree"
addProperties.Item("path").Value = "*" & TrgExt
addProperties.Item("verb").Value = "*"
addProperties.Item("modules").Value = "IsapiModule"
addProperties.Item("scriptProcessor").Value = path & "\" & waDll
addProperties.Item("resourceType").Value = "Unspecified"
addProperties.Item("preCondition").Value = "bitness32"
handlersSectionCollection.AddElement( addElement )
end function

What's wrong? The answer - the order.
AddElement() should be called with the second parameter which is the position in the list:
handlersSectionCollection.AddElement( addElement, 0 )

Saturday, July 10, 2010

mime action sending

Found a bug in Android API. In the following code,
if the file name has a space character, the result mime is null.

File f = some_file;
String mime = null;
MimeTypeMap mime_map = MimeTypeMap.getSingleton();
mime = mime_map.getMimeTypeFromExtension( MimeTypeMap.getFileExtensionFromUrl( f.getAbsolutePath() ) );

Also, there is another problem. Even though I pass the correct mime type along the file stream calling the Intent.ACTION_SEND activity, the resulting email has the file section without any "content-type" field!

Wednesday, July 7, 2010


curl is a very powerful utility. It even can upload a file to a FTP server (-T option) and it's possible to create a directory on the remote FTP folder by sending an arbitrary command:

curl ftp://server/existed_parent_folder/ -Q -"mkd new_subfolder_name"

Here "mkd" is the server's command.

To know the list of the server commnads, execute:

curl ftp://server/ -Q -"help" -v

Monday, July 5, 2010

A taste of Froyo

Finally my N1 has been upgraded to version 2.2 "Froyo".
The download of 44Mb was completely stealthy - no idea when it took time to do that, at least I did not notice anything (WiFi is turned on only time to time). Hope it did not used the cell network, or else it will cost me a lot.
Here's what I like and what I don't about the new version:
1. + Like the phone button on every home page. It covers the lack of the hardware phone button a little (what a stupid idea - to remove the phone button from a phone?)
2. + Flash in browser is a cool addition! Expected it instantly, but it turned up I need to install the Adobe Flash application from the Market.
3. +/- The applications screen now autorotates in both directions - to the left and to the right. It'd be better if there be an option.
4. Number of last used application icons is increased to eight. Big achievement!
5. Autobrightness mode is added to the control bar. Not sure.
6. Moving apps to the SD card works, but I don't need it, at least now.
Now about the bad:
7. The Skype application stopped working properly. I had to remove the battery twice after the phone's completely freeze. Even if it's a Skype problem and has been already fixed, because the application is not on the Market anymore it's impossible to make the update.

Friday, July 2, 2010

VS update

An old computer has a Visual Studio 2005 without latest update (VS80sp1-KB971090-X86-INTL.exe). This update is necessary to let the system libraries be version .4053
But update did not want to be installed and even the studion did not want to be reinstalled.
Here is the solution: remove the following registry keys:
and then reinstall the studio and the update.

Also, the previous experience says you need the Swap file be on to allow the VS update be installed. Weird, but true.

To install the update, instead of "Windows Update" you can use the "Microsoft Update" which checks the updates to download for all Microsoft software installed, not only the Windows' itself.
To install the "Microsoft Update" need to go to the "Windows Update" web site and look the installation link on the page.