Silent install IIS UrlRewrite and ARR by #PowerShell

Create-Item c:/msi -Type Directory Invoke-WebRequest ‘http://download.microsoft.com/download/C/F/F/CFF3A0B8-99D4-41A2-AE1A-496C08BEB904/WebPlatformInstaller_amd64_en-US.msi’ -OutFile c:/msi/WebPlatformInstaller_amd64_en-US.msi Start-Process ‘c:/msi/WebPlatformInstaller_amd64_en-US.msi’ ‘/qn’ -PassThru | Wait-Process cd ‘C:/Program Files/Microsoft/Web Platform Installer’; .\WebpiCmd.exe /Install /Products:’UrlRewrite2,ARRv3_0′ /AcceptEULA /Log:c:/msi/WebpiCmd.log

Howto rename Lotus Notes field by using PowerShell

You need to have Lotus Notes client installed on your machine. Then you need to run PowerShell (x86). $lns = New-Object -ComObject Lotus.NotesSession $lns.Initialize() $db= $lns.GetDatabase(”,’YOUR_DB_NAME’) $doc = $db.GetDocumentByUNID(‘1E733555DDB27DA785257D7E005E64B0’) $doc.RemoveItem(‘TARGET_FIELD_NAME’) $doc.CopyItem($doc.GetFirstItem(‘SOURCE_FIELD_NAME’),’TARGET_FIELD_NAME’) $doc.RemoveItem(‘SOURCE_FIELD_NAME’) $doc.Save($false, $true)

Howto disable hotlinking for your AWS S3 resources

It is good idea to serve static content (e.g. images, video, …., not a JavaScript files) on AWS S3 instead of from your AWS EC2 server. In this case you reduce the workload on your web application. The problem is that AWS S3 resources are not available for public by default. The simple stupid solutionContinue reading “Howto disable hotlinking for your AWS S3 resources”

Split a project between the teams and not other way around!

Software development managers accustomed to moving people around the projects. Instead they should be able to split a project between the teams and not other way around! This implies that software development manager should be a software development practitioner. There is a lot of similar ideas around this topic below by Pieter Hintjens

#SQL: Update xml field from value from other table

We are going to update Title field in XML below. Assume we have incorrect values there in our Library table. We will find the correct values by using Title field from AllBooks table. <Book xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt; <Title>Incorrect Title</Title> </Book> UPDATE Library SET info.modify(‘replace value of (/Book/Title/text())[1] with sql:column(“Title”)’) FROM Library  LEFT OUTER JOIN AllBooks ON Library.BookID=AllBooks .ID WHERE info.value(‘data((/Book/Title)[1])’,’nvarchar(max)’) likeContinue reading “#SQL: Update xml field from value from other table”

Doctrine 1.x log all queries

To log all queries we need to use Event Listeners class QueryDebuggerListener extends Doctrine_EventListener { public function preStmtExecute(Doctrine_Event $event) { $q = $event->getQuery(); $params = $event->getParams(); while (sizeof($params) > 0) { $param = array_shift($params); if (!is_numeric($param)) { $param = sprintf(“‘%s'”, $param); } $q = substr_replace($q, $param, strpos($q, ‘?’), 1); } error_log($q); } } $queryDbg =Continue reading “Doctrine 1.x log all queries”

#Apache: avoid using .htaccess files completely

.htaccess files are read on every request. … You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache http server. Any directive that you can include in a .htaccess file is better set in a Directory block, as it will haveContinue reading “#Apache: avoid using .htaccess files completely”