Skip to content

Instantly share code, notes, and snippets.

View jacobhackl's full-sized avatar

Jacob Hackl jacobhackl

  • minneapolis, mn
View GitHub Profile
@jacobhackl
jacobhackl / export_directories_windows.bat
Last active May 3, 2016 15:28
Export the md command for all folders in a location
setlocal
set "location=d:\"
for /F "delims=" %%a in ('dir /s /ad /b "%location%"') do (
echo md %%a >> createDirectorys.bat
)
@jacobhackl
jacobhackl / Windows Server ownership and read rights.ps1
Created May 16, 2016 18:02
Windows Server ownership and read rights.ps1
TAKEOWN /F "<foldername>" /R /D N /A
Remove folder read-only attribute
ATTRIB -R /D /S "<Foldername>"
@jacobhackl
jacobhackl / gist:248befe1feac5811b42b33a0be90ff67
Last active August 4, 2023 11:19
How to examine IO subsystem latencies from within SQL Server
--http://www.sqlskills.com/blogs/paul/how-to-examine-io-subsystem-latencies-from-within-sql-server/
SELECT
[ReadLatency] =
CASE WHEN [num_of_reads] = 0
THEN 0 ELSE ([io_stall_read_ms] / [num_of_reads]) END,
[WriteLatency] =
CASE WHEN [num_of_writes] = 0
THEN 0 ELSE ([io_stall_write_ms] / [num_of_writes]) END,
[Latency] =
CASE WHEN ([num_of_reads] = 0 AND [num_of_writes] = 0)
declare @hyperthreadingRatio bit
declare @logicalCPUs int
declare @HTEnabled int
declare @physicalCPU int
declare @SOCKET int
declare @logicalCPUPerNuma int
declare @NoOfNUMA int
select @logicalCPUs = cpu_count -- [Logical CPU Count]
@jacobhackl
jacobhackl / gist:678fb32a99029cdb7d4816ed5784f10f
Created March 28, 2017 18:51
Force https for iis rewrite and aws LB
<rule name="Force Https" stopProcessing="true">
<match url="health.htm" negate="true" />
<conditions>
<add input="{HTTP_X_FORWARDED_PROTO}" pattern="https" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
</rule>