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
Import-Module WebAdministration;Get-ChildItem -Path IIS:\AppPools\ | | |
Select-Object name, state, managedRuntimeVersion, managedPipelineMode, @{e={$_.processModel.username};l="username"}, | |
@{e={$_.processModel.password};l="password"}, @{e={$_.processModel.identityType};l="identityType"} | | |
format-table -AutoSize | |
# Also, to get virtual directories and auth credentials: | |
# (Need to select a new object to alias Path to AppPath, since VirtualDirectory also has a Path property) | |
# | |
get-iissite | sel -expand Applications | sel @{e={$_.Path};l="AppPath"} -expand VirtualDirectories | | |
sel AppPath, LogonMethod, UserName, Password | ft -auto -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
package client; | |
import java.io.InputStream; | |
import java.text.DateFormat; | |
import java.text.ParseException; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.List; | |
import java.util.Scanner; |
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
>>> import re | |
>>> m = re.match( r"-*(a+)-*(b+)-*(c+)", "---aaa---bbb--ccc---") | |
>>> m[1] | |
'aaa' | |
>>> m[3] | |
'ccc' | |
>>> m.group(2,3) | |
('bbb', 'ccc') | |
See python fileinput for looping over lines of a series of files on stdin. |
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
ls | ? {(-not (Test-Path (Join-Path c:\tmp\DirB $_.Name)))} | cp -dest c:\tmp\DirB -pass | |
# Not recursive. | |
# Test-Path can also do date-checking. |
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
ildasm /source /linenum /all /out=SXA.ED.Server.Web.exe.txt SXA.ED.Server.Web.exe |
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
cat edWebLog.txt | perl -e 'while (<>) { /caching service background update finished on thread \(id 21\) in ([0-9]+) ms/ && print "$1\n";}' | |
# Simpler: | |
echo abc | perl -n -e '/a(.)c/ && print "$1\n";' | |
# So, the first line becomes: | |
cat edWebLog.txt | perl -n -e '/caching service background update finished .* in ([0-9]+) ms/ && print "$1\n";' |
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
ls -rec | ? {$_ -is [IO.FileInfo]} ` | |
| ? {(cat $_ | sls '\bALTER\s+TABLE\b' -list).Count -gt 0} ` | |
| ? {(cat $_ | sls '\bADD\s+CONSTRAINT\b').Count -gt 0} | |
#### Older, more complicated cmd line follows: | |
ls -rec | ? {-not (HasNulls $_)} | ? {$_ | sls 'vital.?sign' -list} | sls 'critical' -list | ogv | |
# OR... (to post-process to filter OUT some spurious matches) |
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
System& | |
Queries | |
queries submitted -> Queries Out | |
No Queries | |
Queries Out | |
Queries Remain? | |
queries remain? -> Queries Out | |
no queries remain? -> No Queries |
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
System& | |
Queries | |
queries submitted -> Queries Out | |
response received -> Queries Remain? | |
No Queries* | |
Queries Out | |
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
-- -*- coding: utf-8; comment-start: "-- "; comment-column: 40 -*- | |
-- NOTE: Can't follow :set commands with comments on same line. Also, none of this works in PowerShell, hence the use | |
-- of System.Console.ANSI. :( | |
-- See https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences | |
-- :set prompt "\ESC[7m%s\ESC[0m\nλ> " -- Reverse video, two lines | |
-- Reverse video | |
-- :set prompt "\ESC[7mλ %s>\ESC[0m " |