My random rumblings

Something of everything and nothing at all

What process is using my file?

We can either use SysInternals process explorer we can use tasklist.

In the command line window execute the following:

tasklist /m path\filename.extension

My random rumblings | All posts by daniel

My random rumblings

Something of everything and nothing at all

Text search in large files

It is not always possible to open large files with a text editor and sometimes it is good enough to know that data exist within a file.

You can use the following PowerShell command:
Select-String -pattern "Text Pattern" -path <FilePath>

Select-String -pattern "10016672" -path .\mprdata.xml

Analysing Memory Leaks in .NET

To determine if an application has a memory leak add the .NET CLR Memory Windows performance counter. You need check for a trend over a long period of time rather than the immediate values.

Make a memory dump of the application.

Open WinDbg.

Click on File and then on Open Crash Dump.

Type the following commands:

lm

.load C:\windows\Microsoft.NET\Framework64\v4.0.30319\sos.dll

.sympath SRV*c:\localsymbols*http://msdl.microsoft.com/download/symbols

.symfix

.reload

!dumpheap -stat

 

From the above you should see which objects have excessive number of items, with the following you should get the addresses of the object:

!DumpHeap -type <TypeName>

Use the following to see what keeps this object in memory.

!GCRoot <Object_Address>


Control

My notes from a TED talk.

We make everything that is uncertain certain.
Religion has gone from faith and mystery to certainty.
I am right and you are wrong shut up.
We need to love with out whole hearts even where there is no guarantee.
Accept your vulnerability
I am enough
Vulnerability is essential to living whole heartedly.
Vulnerability is not weakness.

Minimal git

Set path=%path%;"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd\"

git clone https://******.visualstudio.com/appfolder/_git/Android

 

git add -A && git commit -m "added application name in API calls”

git push

shifting baseline syndrome

Broadly, the effect is called “shifting baseline syndrome,” and it’s what happens when gradual, long-term change meets the dumb, immediately gratifiable human brain. - Adam Rodgers

Create scheduled taks in command line

Microsoft documentation:Schtasls

Create a task that runs every 2 minutes
Schtasks /ru SYSTEM /create /sc minute /mo 2 /tn "Fix Malaysia" /tr "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file C:\Work\scripts\FixAccounts.ps1"

Create a task that runs once a day at 08:00
Schtasks /ru "SYSTEM" /create /sc daily /mo 1 /st 08:00 /tn "PutcoFirmwareVersion" /tr "C:\Work\ScheduledTasks\R\putcounits.cmd"

Azure DevOps delete test plan item

$personalAccessToken = "<token>"
$account = "<some account name>"
$project = "<project name>"
$ids = @("264","265","266","267","268","269","270","271")
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($personalAccessToken)"))
$headers = @{Authorization = "Basic $($base64AuthInfo)" }
$ids | %{
    $uri = "https://$account.visualstudio.com/DefaultCollection/$project/_apis/testplan/testcases/$($_)?api-version=5.1-preview.1"
    write-host "Work Items: $uri" -foregroundcolor "green"
    $definitions = Invoke-RestMethod -Uri $uri -Headers $headers -Method Delete -ContentType "application/json"
}