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
| #define BLYNK_PRINT Serial | |
| // Blynk app | |
| #include <BlynkSimpleEsp8266.h> | |
| #include <RTClib.h> | |
| #include <WidgetRTC.h> | |
| // Non Blynk specific, local files | |
| #include <WiFiUdp.h> | |
| #include "NTP.h" |
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
| cls | |
| $dnssubject = 'CN=servername.goes.here' | |
| $WorkingCert = Get-ChildItem CERT:\LocalMachine\My |where {$_.Subject -match $dnssubject} | sort $_.NotAfter -Descending | select -first 1 | |
| if ($WorkingCert -eq $null) | |
| { | |
| Write-Host "Unable to locate certificate for $($dnssubject), attempting to create..." | |
| [string[]] $dnsnames = @("alternate.name.one", "altername.name.two", "alternate.name.three") |
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
| // Init: Hierarchy hierarchy = (Hierarchy)LogManager.GetRepository(); | |
| // hierarchy.Root.AddAppender(CreateWSMFileAppender("logger-name-here")); | |
| // Usage: var wsmLog = LogManager.GetLogger("logger-name-here"); | |
| // if (wsmLog != null) | |
| // { | |
| // wsm.InfoFormat("Hi, you did it dynamically!"); | |
| // { | |
| private static IAppender CreateFileAppender(string appenderName) | |
| { |
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
| cls | |
| [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Client") | |
| [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Build.Client") | |
| $serverName = "http://server.fqdn:8080/tfs" | |
| $teamProject = "project_name" | |
| $tfs = [Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer($serverName) | |
| $buildserver = $tfs.GetService([Microsoft.TeamFoundation.Build.Client.IBuildServer]) | |
| $buildDefinitions = $buildServer.QueryBuildDefinitions($teamProject).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
| $website = 'Default' | |
| $server = 'SOME_SERVER_01' | |
| $session = New-PSSession -ComputerName $server -Name "My_Session_Name" | |
| $remoteOriginalFolder = Invoke-Command -Session $session -ScriptBlock { param($website) | |
| Import-Module WebAdministration | |
| $originalFolder = Get-WebFilePath IIS:\Sites\$website | |
| return $originalFolder.FullName | |
| } -ArgumentList $website | |
| $remoteOriginalFolder |
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 @SQL VARCHAR(MAX) | |
| DECLARE @SearchString VARCHAR(100) | |
| SET @SQL = '' | |
| SET @SearchString = 'some string here' | |
| SELECT @SQL = @SQL + 'SELECT CONVERT(VARCHAR(MAX),COUNT(*)) + '' matches in column ''+''' | |
| + C.name + '''+'' on table '' + ''' + SC.name + '.' + T.name + | |
| ''' [Matches for '''+@SearchString+''':] FROM ' + | |
| QUOTENAME(SC.name) + '.' + QUOTENAME(T.name) + ' WHERE ' + QUOTENAME(C.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
| param([parameter(Mandatory=$true,HelpMessage="Server Environment")]$state,$env) | |
| Import-Module WebAdministration; | |
| switch ($env) | |
| { | |
| "### SERVERNAME ###" | |
| { | |
| if ($state -eq "STOP") | |
| { |
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
| private void SetKeepAliveIOControl(Socket socket, uint interval, uint retryInterval, bool enabled) | |
| { | |
| int size = sizeof(UInt32); | |
| uint on = enabled ? (uint)1 : (uint)0; | |
| byte[] inArray = new byte[size * 3]; | |
| Array.Copy(BitConverter.GetBytes(on), 0, inArray, 0, size); | |
| Array.Copy(BitConverter.GetBytes(interval), 0, inArray, size, size); | |
| Array.Copy(BitConverter.GetBytes(retryInterval), 0, inArray, size * 2, size); | |
| socket.IOControl(IOControlCode.KeepAliveValues, inArray, null); | |
| } |
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
| cls | |
| $source = "\\sourcefiles\path\here"; | |
| $auth = "\\authserver\c$\Fileroot"; | |
| $destDev = "\\devserver\C$\FileRoot"; | |
| $destTest = "\\testserver\C$\FileRoot"; | |
| $destStage = "\\stageserver\C$\FileRoot"; | |
| $destProd = "\\productionserver\C$\FileRoot"; | |
| #$scriptBlock = { Param($source,$destination) robocopy $source $destination /MAXAGE:21 /MT:32 /S /NC /NS /NDL /NJH /NJS /NFL } | |
| $scriptBlock = { Param($source,$destination) robocopy $source $destination /MAXAGE:21 /MT:32 /S } |
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
| # Usage: Audit.ps1 'pathtolistofservers' # | |
| # The file is optional and needs to be a plain text list of computers to be audited one on each line. # | |
| # | |
| param([string] $auditlist) | |
| cls | |
| $Error.Clear() # clear the stack | |
| $targets = $null | |
| if ($auditlist -eq "") |
NewerOlder