Skip to content

Instantly share code, notes, and snippets.

$ie = New-Object -ComObject InternetExplorer.application
$ie.Navigate("http://somewebsite")
while ($ie.Busy) { Start-Sleep -Seconds 1 }
Write-Host $ie.Document.body.innerText
$ie.Quit()
#https://msdn.microsoft.com/en-us/library/windows/desktop/aa374830.aspx
$AlternativeNameType = @{
XCN_CERT_ALT_NAME_UNKNOWN = 0
XCN_CERT_ALT_NAME_OTHER_NAME = 1
XCN_CERT_ALT_NAME_RFC822_NAME = 2
XCN_CERT_ALT_NAME_DNS_NAME = 3
XCN_CERT_ALT_NAME_DIRECTORY_NAME = 5
XCN_CERT_ALT_NAME_URL = 7
XCN_CERT_ALT_NAME_IP_ADDRESS = 8
XCN_CERT_ALT_NAME_REGISTERED_ID = 9
function Get-SPSiteList {
param(
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)][ValidateNotNullOrEmpty()]
[String]$WebAppUrl
)
process {
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($WebAppUrl)
$q = new-object Microsoft.SharePoint.Client.Search.Query.KeywordQuery($ctx)
$q.QueryText = "ContentClass=STS_Site"
$se = new-object Microsoft.SharePoint.Client.Search.Query.SearchExecutor($ctx)

Keybase proof

I hereby claim:

  • I am ctkirkman on github.
  • I am ctkirkman (https://keybase.io/ctkirkman) on keybase.
  • I have a public key whose fingerprint is A8A3 C930 7CB1 C2E9 B956 6E83 1F60 624E 8725 25D6

To claim this, I am signing this object:

Verifying that "ctkirkman.id" is my Blockstack ID. https://onename.com/ctkirkman
$CaView = New-Object -Com CertificateAuthority.View.1
[void]$CaView.OpenConnection("SERVER\CA")
$templates = @{}
Get-ADObject -SearchBase (Get-ADRootDSE).ConfigurationNamingContext -filter {objectclass -eq "pKICertificateTemplate"} -Properties "CN", "DisplayName", "msPKI-Cert-Template-OID" | %{ $templates.add($_."msPKI-Cert-Template-OID",$_."DisplayName") }
$columns = @(
"Binary Certificate",
"Certificate Effective Date",
"Certificate Expiration Date",
import pathlib
import cgi
def parse_multipart(data, headers):
result = list()
content_type, options = cgi.parse_header(headers.get("Content-Type"))
if options.get("boundary") is not None:
result = data.split(b"--" + options.get("boundary").encode())
for r in result[1:]:
def parse_chunked(data):
result = b""
state = "header"
while data:
if state == "header":
chunk, data = data.split(b"\r\n", 1)
length = int(chunk.strip(), 16)
if length == 0:
state = "finished"
else:
import magic
def read_magic(contentBytes):
magicType = None
try:
with magic.Magic() as m:
magicType = m.from_buffer(contentBytes)
except Exception as e:
print("libmagic")
print(str(e))
import hashlib
from io import BytesIO
from zipfile import ZipFile
from operator import itemgetter
def read_zip(contentBytes):
zip_metadata = dict()
file_list = None
errors = None