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
function Is-Default-Branch { | |
return "%teamcity.build.branch.is_default%" -eq "true" | |
} | |
function Set-TeamCity-Parameter($name, $value) { | |
Write-Host "##teamcity[setParameter name='$name' value='$value']" | |
} | |
if (Is-Default-Branch) { | |
$releaseNumber = "%octopus.master.releaseNumber%" |
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
# --- NETSH Capture - Circular Logging EXAMPLE --- | |
Netsh trace start scenario=NetConnection capture=yes report=yes traceFile=C:\%computername%_NetTrace.etl | |
# netmon can open .etl files | |
# http://blogs.technet.com/b/yongrhee/archive/2012/12/01/network-tracing-packet-sniffing-built-in-to-windows-server-2008-r2-and-windows-server-2012.aspx | |
# for public networks etc | |
persistent=yes |
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
Get-EventLog System | Where-Object {$_.EventID -eq "1074" -or $_.EventID -eq "6008" -or $_.EventID -eq "1076"} | ft Machinename, TimeWritten, UserName, EventID, Message -AutoSize -Wrap |
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
HTTP requests | |
tshark -Y "http.request or http.response" -Tfields -e ip.dst | |
DNS | |
tshark -Y "dns.flags.response == 1" -Tfields -e frame.time_del | |
x509 | |
tshark -Y "ssl.handshake.certificate" -Tfields -e ip.src -e x509sat. | |
nearby wifi |
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
<# | |
set-alias appcmd "C:\windows\SysWOW64\inetsrv\appcmd.exe" | |
& appcmd list apppool /xml | appcmd set apppool /in /autoStart:true /startMode:AlwaysRunning | |
& "C:\windows\SysWOW64\inetsrv\appcmd.exe" list apppool /xml | appcmd set apppool /in /recycling.periodicRestart.time:00:00:00 | |
& "C:\windows\SysWOW64\inetsrv\appcmd.exe" list apppool /xml | appcmd set apppool /in "/+recycling.periodicRestart.schedule.[value='00:00:00']" | |
#> |
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
dsacls "CN=$UNNUMB$lastSTRING,$PATHDN" /G "$JOINGROUPDN:CA;Reset password" "$JOINGROUPDN:CA;Send as" "$JOINGROUPDN:CA;Receive as" "$JOINGROUPDN:CA;Change password" "$JOINGROUPDN:CA;Allowed to authenticate" "$JOINGROUPDN:WP;Account restrictions" "$JOINGROUPDN:WS;Validated write to service principal name" "$JOINGROUPDN:WS;Validated write to DNS host name" "$JOINGROUPDN:GR" | |
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
$downloadUrl = (Invoke-RestMethod 'https://api.github.com/repos/bliker/cmder/releases').assets.browser_download_url | ? { $_ -like '*.7z' } | select -first 1 | |
$tmpFileName = [system.io.path]::GetTempFileName() | |
(new-object net.webclient).DownloadFile($downloadUrl,$tmpFileName) |
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
set-alias setmon Set-Monitor | |
function Set-Monitor { | |
param( | |
[Parameter(Mandatory=$true)] | |
[ValidateSet('on','off','lowpower')] | |
[string]$state | |
) | |
$signature = @" | |
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] | |
public static extern IntPtr PostMessage(int hWnd, UInt32 hMsg, Int32 wParam, Int32 lParam); |
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
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul); | |
/* | |
PUT ME IN $env:appdata\Mozilla\Firefox\Profiles\{profile}\chrome\userChrome.css | |
*/ | |
/* ************************************* | |
VimFx | |
************************************* */ | |
/* Allow file:/// prefix for testing using `gulp {help,hints}.html`. */ | |
@-moz-document url(chrome://browser/content/browser.xul), url-prefix(file:///) | |
{ |
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
#--------------------------------------------- | |
# func | |
#--------------------------------------------- | |
function Test-ServiceSettings { | |
param( | |
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)] | |
[Alias('name')] | |
[string]$ServiceName, | |
[Parameter(Mandatory=$false)] | |
[int]$ResetPeriod = 3600, |
OlderNewer