Skip to content

Instantly share code, notes, and snippets.

View rysstad's full-sized avatar

Tor Arne Rysstad rysstad

View GitHub Profile
@rysstad
rysstad / Get-ComputerADSite.ps1
Created December 9, 2014 13:43
Get Active Directory site for computer
[DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().Name
# Create name and path for a tempfile
[System.IO.Path]::GetTempFileName()
@rysstad
rysstad / SplunkUniversalForwarderInput-WindowsPerformanceCounters.ini
Created September 17, 2014 08:53
Splunk Universal Forwarder Input - Sharepoint Performance Counters
[perfmon://PerfMemory]
interval = 900
object = Memory
counters = Committed Bytes; Available Bytes; % Committed Bytes In Use
disabled = 0
[perfmon://PerfProcessor]
interval = 900
object = Processor
counters = % Processor Time;
@rysstad
rysstad / SplunkUniversalForwarderInput-SharepointPerformanceCounters.ini
Created September 17, 2014 08:52
Splunk Universal Forwarder Input - Sharepoint Performance Counters
[WinEventLog://Microsoft-SharePoint Products-Shared/Operational]
disabled = 0
current_only = 1
[WinEventLog://SharePoint Event Log]
disabled = 0
current_only = 1
[perfmon://PerfdotNETCLRmemory]
interval = 900
@rysstad
rysstad / SplunkUniversalForwarderInput-SQLServerPerformanceCounters.ini
Created September 17, 2014 08:50
Splunk Universal Forwarder Input - SQL Server Performance Counters
[perfmon://PerfSQLServerGeneralStatistics]
interval = 900
object = SQLServer:General Statistics
counters = User Connections; Transactions; Processes blocked
disabled = 0
[perfmon://PerfSQLServerBufferManager]
interval = 900
object = SQLServer:Buffer Manager
counters = Database pages; Buffer cache hit ratio; Page life expectancy; Checkpoint pages/sec
; Make text in clipboard lowercase with Win+8
#8::
StringLower, clipboard, clipboard,
Return
; Make text in clipboard uppercase with Win+9
#9::
StringUpper, clipboard, clipboard,
Return
::dd--::
FormatTime, date2, ,yyyy.MM.dd
SendInput %date2%
return
::dt--::
FormatTime, dateTime2, ,yyyy.MM.dd-HH.mm
SendInput %dateTime2%
return
; Turn on NumLock for ever and always... aahh...
SetNumLockState, AlwaysOn
@rysstad
rysstad / Get-ChildItemInMb
Created June 3, 2014 07:51
Show files with filesize in Mb
Get-ChildItem | Select-Object Name,LastWriteTime,@{Name="Size Mb"; Expression = {[math]::round($_.Length /1Mb, 2)}}