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
Err.Clear
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 )
adminManager.CommitChanges()
end function
What's wrong? The answer - the order.
The AddElement() should be called with the second parameter which is the position in the list:
handlersSectionCollection.AddElement( addElement, 0 )
Monday, July 19, 2010
IIS tricks
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!
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
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
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.
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:
HKLM\SOFTWARE\Classes\Installer\Products\0E8BA73496BF22242B086AF4D32E5219
HKLM\SOFTWARE\Classes\Installer\Patches\C7C9F39D75BA8C44AB6D414976B4AC7F
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.
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:
HKLM\SOFTWARE\Classes\Installer\Products\0E8BA73496BF22242B086AF4D32E5219
HKLM\SOFTWARE\Classes\Installer\Patches\C7C9F39D75BA8C44AB6D414976B4AC7F
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.
Thursday, June 17, 2010
Upgrade
Hooray, I'm doing an upgrade my work machine!
Last time a significant upgrade was seven (duh!) years ago.
But if you don't run some crap like Windows Vista, it's ok.
So, now I have:
1. Gigabyte GA-P55-USB3 (rev.1) motherboard. As seen from the model name it bears the latest USB3 controller on it. I don't have any USB3 devices yet. But it's cool isn't it?
2. Intel Core i5-750 (Lynnfield) 2.66GHz Quad-Core Processor. Why all other i5 processors except this one are double cored?
3. 4GB (2x2Gb) G.Skill Ripjaws DDR3 (PC3 10666) memory. (F3-10666CL8D-4GBRM)
4. XFX GeForce 8400GS PCI Express 2.0 x16 Video Card (fanless).
5. CORSAIR CMPSU-450VX 450W Power Supply (very good package).
I chose this motherboard not only because it has USB3 (actually I don't care about it), but because it is simple yet powerful and hopefully reliable. It has only one PCI16 socket, no extra whistles, PATA port (JMicron) and even an old good floppy drive port! I'm going to keep the same OS which is Windows v5.2, on the same RAID set, so I need an easy way to install the new ICH9 driver.
The fight for life of the current RAID installation is still ahead of me (probably on the weekend). But now the system is assembled in an old borrowed case, it works with a freshly temporary installed Windows v5.2 on an old (borrowed) 9Gb hard drive and it works fine and smooth and even has survived a number of stress tests.
Now, about some issues.
1. Another similar system was not able to boot old Windows XP.
2. Memtest86 v3.5 goes to reboot if both DIMMs are installed. It's the Memtest's issue, as the internet says, because it does not work with 4Gb memory. Older memtest v3.4 works fine.
3. Memory timings of the memory I bought is declared as 8-8-8-21, but the system auto setting was 9-9-9-24. I set the timings manually to 8-8-8-24, it seems it works.
4. The videocard's heat sink is hot as hell. 70 degrees in idle. I'm not going to play games, but still it's a lot.
Speaking of the temperatures.
Idle MB's CPU is 31C, under load is 71C.
Idle CPU core is 41, under load 80C
Everything else is cool.
Performance:
Everest's CPU Queen gives me 8700 points. It's funny, but accordwing the score, Core2Extreme 2.6GHz still beats it.
Installation procedure:
I find out the 1156 socket CPU does not have holes on it, it has just contacts. I was sure the 775 socket CPU had holes. May be I was mistaken.
The CPU fan sink is light and small and set easily, much easier then 775's huge heavy sink.
Stage 2.
Ok, now is time to migrate the current system (MS Windows v5.2) to the new platform.
Two major problem I mostly afraid of are:
1. Will the existed RAID0 set be recognized by the new platform
2. Will the windows run on it.
The firs one was resolved instantly. As soon the RAID controller is Intel made
it's compatible, at least in one direction. So the set is created on ICH5R was recognized instantly on the motherboard with ICH9 (P55 chipset). All I need to do is set the RAID mode to the SATA controller in the BIOS setup.
The second was not so easy. Windows started to boot but suddenly restarts computer, same way as XP did with another case.
Not thinking long I started the repair procedure, providing the floppy drive with the ICH drivers. After the repair had done, the windows loaded succesfully.
But the repair procedure brought me some more problem: Internet Explorer 8 was gone. Windows SP2 was gone. Many other MS made utilites were not functioned as well.
Also I had to reactivate Windows because the hardware was significantly changed.
Last time a significant upgrade was seven (duh!) years ago.
But if you don't run some crap like Windows Vista, it's ok.
So, now I have:
1. Gigabyte GA-P55-USB3 (rev.1) motherboard. As seen from the model name it bears the latest USB3 controller on it. I don't have any USB3 devices yet. But it's cool isn't it?
2. Intel Core i5-750 (Lynnfield) 2.66GHz Quad-Core Processor. Why all other i5 processors except this one are double cored?
3. 4GB (2x2Gb) G.Skill Ripjaws DDR3 (PC3 10666) memory. (F3-10666CL8D-4GBRM)
4. XFX GeForce 8400GS PCI Express 2.0 x16 Video Card (fanless).
5. CORSAIR CMPSU-450VX 450W Power Supply (very good package).
I chose this motherboard not only because it has USB3 (actually I don't care about it), but because it is simple yet powerful and hopefully reliable. It has only one PCI16 socket, no extra whistles, PATA port (JMicron) and even an old good floppy drive port! I'm going to keep the same OS which is Windows v5.2, on the same RAID set, so I need an easy way to install the new ICH9 driver.
The fight for life of the current RAID installation is still ahead of me (probably on the weekend). But now the system is assembled in an old borrowed case, it works with a freshly temporary installed Windows v5.2 on an old (borrowed) 9Gb hard drive and it works fine and smooth and even has survived a number of stress tests.
Now, about some issues.
1. Another similar system was not able to boot old Windows XP.
2. Memtest86 v3.5 goes to reboot if both DIMMs are installed. It's the Memtest's issue, as the internet says, because it does not work with 4Gb memory. Older memtest v3.4 works fine.
3. Memory timings of the memory I bought is declared as 8-8-8-21, but the system auto setting was 9-9-9-24. I set the timings manually to 8-8-8-24, it seems it works.
4. The videocard's heat sink is hot as hell. 70 degrees in idle. I'm not going to play games, but still it's a lot.
Speaking of the temperatures.
Idle MB's CPU is 31C, under load is 71C.
Idle CPU core is 41, under load 80C
Everything else is cool.
Performance:
Everest's CPU Queen gives me 8700 points. It's funny, but accordwing the score, Core2Extreme 2.6GHz still beats it.
Installation procedure:
I find out the 1156 socket CPU does not have holes on it, it has just contacts. I was sure the 775 socket CPU had holes. May be I was mistaken.
The CPU fan sink is light and small and set easily, much easier then 775's huge heavy sink.
Stage 2.
Ok, now is time to migrate the current system (MS Windows v5.2) to the new platform.
Two major problem I mostly afraid of are:
1. Will the existed RAID0 set be recognized by the new platform
2. Will the windows run on it.
The firs one was resolved instantly. As soon the RAID controller is Intel made
it's compatible, at least in one direction. So the set is created on ICH5R was recognized instantly on the motherboard with ICH9 (P55 chipset). All I need to do is set the RAID mode to the SATA controller in the BIOS setup.
The second was not so easy. Windows started to boot but suddenly restarts computer, same way as XP did with another case.
Not thinking long I started the repair procedure, providing the floppy drive with the ICH drivers. After the repair had done, the windows loaded succesfully.
But the repair procedure brought me some more problem: Internet Explorer 8 was gone. Windows SP2 was gone. Many other MS made utilites were not functioned as well.
Also I had to reactivate Windows because the hardware was significantly changed.
Labels:
CPU,
Intel,
memory,
Motherboard,
PC,
performance,
Upgrade
Thursday, June 3, 2010
windows sudo ersatz
To see if a process is executed with elevated rights or not: open the Process Explorer (as Administrator), find the process you need to check, then open the property's Security tab.
If the "BUILTIN\Administrators" record says "Deny" - that means the process is standard,
if it says "Owner", then it's elevated.
IIS's pool process (w3wp.exe) is executed elevated, so no need to worry, but need make sure if the application pool is running as "LOCAL SERVICE", that "LOCAL SERVICE" have rights to the resources the web application need access to. Also to give it more rights, in the web application setting check "Same as the application pool".
If the "BUILTIN\Administrators" record says "Deny" - that means the process is standard,
if it says "Owner", then it's elevated.
IIS's pool process (w3wp.exe) is executed elevated, so no need to worry, but need make sure if the application pool is running as "LOCAL SERVICE", that "LOCAL SERVICE" have rights to the resources the web application need access to. Also to give it more rights, in the web application setting check "Same as the application pool".
Subscribe to:
Posts (Atom)