This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://chatgpt.com/share/6a13f2c7-ca34-83eb-83b9-f171f0d54e44 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Cmder (inside WT)", | |
| "guid": "{b9b4c6b1-7f2b-4f9a-9f5a-cccc11112222}", | |
| "commandline": "cmd.exe /k \"%CMDER_ROOT%\\vendor\\init.bat\"", | |
| "startingDirectory": "%USERPROFILE%", | |
| "icon": "C:\\tools\\Cmder\\icons\\cmder.ico", | |
| "hidden": false, | |
| "env": { | |
| "CMDER_ROOT": "C:\\tools\\Cmder" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // GlobalRetryOnFailureAttribute.cs | |
| using NUnit.Framework; | |
| using NUnit.Framework.Interfaces; | |
| using NUnit.Framework.Internal; | |
| using NUnit.Framework.Internal.Commands; | |
| using System; | |
| [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = false)] | |
| public sealed class GlobalRetryOnFailureAttribute : NUnitAttribute, IWrapTestMethod | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Requires VIEW SERVER STATE | |
| SELECT | |
| wt.session_id, | |
| wt.blocking_session_id, | |
| wt.wait_duration_ms, | |
| COALESCE(r_req.request_id, r_blk.request_id) AS request_id, | |
| COALESCE(r_req.sql_handle, r_blk.sql_handle) AS sql_handle, | |
| COALESCE(st_req.text, st_blk.text) AS batch_text, | |
| -- extract currently executing statement using offsets (bytes -> chars) | |
| CASE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $cluster = "my-cluster" | |
| # 1) Get all service ARNs | |
| $services = aws ecs list-services --cluster $cluster --query 'serviceArns' | ConvertFrom-Json | |
| # 2) Describe services in batches of 10 to get task definition ARNs | |
| $taskDefs = New-Object System.Collections.Generic.List[string] | |
| for ($i = 0; $i -lt $services.Count; $i += 10) { | |
| $end = [Math]::Min($i + 9, $services.Count - 1) | |
| $batch = $services[$i..$end] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT dtl.request_session_id AS WaitingSessionID, | |
| der.blocking_session_id AS BlockingSessionID, | |
| dowt.resource_description, | |
| der.wait_type, | |
| dowt.wait_duration_ms, | |
| DB_NAME(dtl.resource_database_id) AS DatabaseName, | |
| dtl.resource_associated_entity_id AS WaitingAssociatedEntity, | |
| dtl.resource_type AS WaitingResourceType, | |
| dtl.request_type AS WaitingRequestType, | |
| dest.[text] AS WaitingTSql, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @schema sysname = N'dbo', @table sysname = N'TableName'; | |
| SELECT | |
| s.name AS stat_name, | |
| CASE WHEN s.auto_created = 1 THEN 'auto' | |
| WHEN s.user_created = 1 THEN 'user' | |
| ELSE 'index' END AS kind, | |
| i.name AS index_name, -- NULL = column stat | |
| sp.last_updated, | |
| sp.rows, -- table (or partition) rows when stat was last updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Net.Http; | |
| using System.Text; | |
| using System.Text.Json; | |
| using System.Threading.Tasks; | |
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Jobs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE @Tables TABLE (TableName NVARCHAR(128)); | |
| INSERT INTO @Tables (TableName) | |
| VALUES ('YourTable1'), ('YourTable2'); -- Add your table names here | |
| DECLARE @SQL NVARCHAR(MAX) = N''; | |
| SELECT @SQL = @SQL + | |
| 'SELECT ''' + t.TABLE_NAME + ''' AS TableName, ''' + c.COLUMN_NAME + ''' AS ColumnName, ' + | |
| ' [' + c.COLUMN_NAME + '] AS Value ' + | |
| 'FROM [' + t.TABLE_NAME + '] ' + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| r.session_id, | |
| r.status, | |
| r.start_time, | |
| r.command, | |
| r.percent_complete, | |
| r.estimated_completion_time, | |
| r.cpu_time, | |
| r.total_elapsed_time, | |
| r.logical_reads, |
NewerOlder