ict.ken.be

 

Posts in Category: Windows

Adding new certificate remote access windows 

Categories: Windows

You can get a new remote desktop self-signed certificate by removing the old and restarting the service.

  • Goto certification store: Computer / Local Machine / Remote Desktop
  • Remove the current certificate
  • net stop SessionEnv
  • net start SessionEnv
  • Refresh store to check if new certificate is correct

 

Stop Teamcity build when other build starts 

Categories: Windows

Most likely you want to stop running your long end-2-end tests when a new deployment is ready.
You will lose the correlation between when the error happened, but at least you can move on.
The easiest way to do this in Teamcity (as there is no support at this writing),
is to add an additional step before the deployment build configuration using the following powershell script.

So you basically cancel the test build configuration when the deployment starts.

$buildConfigurationId = '%E2ETestBuildConfigurationId%'
If (![string]::IsNullOrWhitespace($buildConfigurationId)) { 
    Write-Host "Finding test builds"
    $user = '%system.teamcity.auth.userId%'
    $pass = '%system.teamcity.auth.password%'
    $pair = "${user}:${pass}"
    $bytes = [System.Text.Encoding]::ASCII.GetBytes($pair)
    $base64 = [System.Convert]::ToBase64String($bytes)
    $basicAuthValue = "Basic $base64"
    $headers = @{ Authorization = $basicAuthValue; "Content-Type" = "application/xml" }
    $response = Invoke-WebRequest -Uri "http://teamcity.conseur.org/app/rest/builds?locator=buildType:($buildConfigurationId),state:queued" -Method GET -Headers $headers
    $postParams = "<buildCancelRequest comment='Build was canceled because of new deployment.' readdIntoQueue='true' />"
    Foreach($buildId in ([xml]$response.Content).builds.build.id) 
    {
        Write-Host "Cancel queued buildId: $buildId"
        Invoke-WebRequest -Uri "http://teamcity.conseur.org/app/rest/buildQueue/id:$buildId" -Headers $headers -Method POST -Body $postParams
    }
    $response = Invoke-WebRequest -Uri "http://teamcity.conseur.org/app/rest/builds?locator=buildType:($buildConfigurationId),state:running" -Method GET -Headers $headers
    $postParams = "<buildCancelRequest comment='Build was canceled because of new deployment.' readdIntoQueue='false' />"
    Foreach($buildId in ([xml]$response.Content).builds.build.id) 
    {
        Write-Host "Cancel running buildId: $buildId"
        Invoke-WebRequest -Uri "http://teamcity.conseur.org/app/rest/builds/id:$buildId" -Headers $headers -Method POST -Body $postParams
    }
}

Set network adaptor order for windows 7 or 2008R2 

Categories: Windows

You can re-order the priority of your network connestions through the adapter settings window, but you need to know the secret key...

Control Panel -> Network and Sharing Center -> Change adapter settings -> Press Alt Key to make the Advanced menu visible -> Advanced Settings.

Things you should know about the windows command window 

Categories: Windows

When you are in explorer and you type cmd + enter in the address bar a command window (cmd.exe) will open in that location.

Shortcut keys

  • tab : to cycle through the files beginning with letters you already typed
  • f7 : show history of commands
  • arrow up/down : loop through commands
  • winkey + cmd + ctrl/shift/enter : will open elevated prompt
  • ctrl + c : stop current action

Commands

  • cls
  • color A
  • dir | find "grep" /i /v /c /n : ignore case, exclude, count, line number
  • netstat -o
  • tasklist -m
  • taskkill -pid 4
  • tracert ken.be
  • sfc /verifyonly
  • assoc | more
  • driverquery
  • powercfg /energy
  • arp -a
  • nslookup ken.be

 more at Windows key + R shortcuts and technet command-line reference

Change hostname on windows 

Categories: Windows
netdom renamecomputer WIN-05CX1975EF04 /Newname MyServer
Page 1 of 4 1 2 3 4 > >>