Skip to content

Instantly share code, notes, and snippets.

@timdenholm
timdenholm / get-sslSigningAlgorithm.ps1
Last active May 9, 2016 22:44 — forked from derekmurawsky/get-sslSigningAlgorithm.ps1
Check for certificate signing algorithm from a web server using powershell. Based on the Test-WebServerSSL cmdlet from http://en-us.sysadmins.lv/Lists/Posts/Post.aspx?List=332991f0-bfed-4143-9eea-f521167d287c&ID=60 which is the same as https://pspki.codeplex.com/wikipage?title=Test-WebServerSSL I think. Modified with input from the Philly Powers…
function get-SSLSigningAlgorithm {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)]
[string]$URL,
[Parameter(Position = 1)]
[ValidateRange(1,65535)]
[int]$Port = 443,
[Parameter(Position = 2)]
[Net.WebProxy]$Proxy,
@timdenholm
timdenholm / hb_all_books_dl.js
Created November 26, 2016 02:55 — forked from graymouser/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
*/
$('a').each(function(i){
if ($.trim($(this).text()) == 'MOBI') {
$('body').append('<iframe id="dl_iframe_'+i+'" style="display:none;">');
document.getElementById('dl_iframe_'+i).src = $(this).data('web');
}
});
@timdenholm
timdenholm / reflect.py
Created June 29, 2017 07:02 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@timdenholm
timdenholm / CheckMaxTokenSize.ps1
Created November 7, 2017 03:53
Query for all token items (groups, SIDs, SIDHistory) and calculate an estimated current token size for the logged on user. Calls out if the token is potentially too large for consistently successful use based on operating system defaults.
PARAM ([array]$Principals = ($env:USERNAME), $OSEmulation = $false, $Details = $false)
#************************************************
# CheckMaxTokenSize.ps1
# Version 2.0
# Date: 9/18/2014
# Author: Tim Springston [MS]
# Description: Query for all token items (groups, SIDs, SIDHistory) and calculate an
# estimated current token size for the logged on user. Calls out if the token is potentially too
# large for consistently successful use based on operating system defaults.
# KB http://support.microsoft.com/kb/327825
@timdenholm
timdenholm / rpi-sht31.py
Created April 7, 2018 02:21
Raspberry Pi SHT31 Example
import smbus2
import time
# Get I2C bus; SHT31 address 0x44(68)
bus = smbus2.SMBus(1)
bus.write_i2c_block_data(0x44, 0x2C, [0x06])
time.sleep(0.5)
# SHT31 address 0x44(68)
/(?:and)(?:\s|(?:%20))(?:"|\'|(?:%27))?(\d)(?:"|\'|(?:%27))?(?:\s|(?:%20))?(?:=|(?:%3D))?(?:\s|(?:%20))?(?:"|\'|(?:%27))?(?:\s|(?:%20))?\1/gi
@timdenholm
timdenholm / scom-get-agents.sql
Last active April 30, 2019 05:55
Get SCOM Agents
USE OperationsManager
GO
SELECT
CASE
WHEN LOWER(ManagedEntityGenericView.DisplayName) LIKE LOWER('%.%')
THEN REPLACE(SUBSTRING(ManagedEntityGenericView.DisplayName,1,CHARINDEX('.',ManagedEntityGenericView.DisplayName)),'.','')
ELSE ManagedEntityGenericView.DisplayName
END AS host,
CASE
WHEN InMaintenanceMode = 1 THEN 'Yes'
@timdenholm
timdenholm / sccm-get-agents.sql
Last active April 30, 2019 08:48
Get SCCM Agents
SELECT distinct
SYS.Name0 AS 'host',
SYS.User_Name0 AS 'sccm_login_name',
CASE
WHEN SYS.User_Domain0 = SYS.Name0 THEN 'WORKGROUP'
ELSE SYS.User_Domain0
END AS 'sccm_domain',
CASE
WHEN SYS.Client0 = 1 THEN 'Yes'
WHEN SYS.Client0 = 0 THEN 'No'
@timdenholm
timdenholm / sccm-get-mw-membership.sql
Last active April 30, 2019 23:16
Get SCCM Maintenance Window Memberships
SELECT
fcm.Name AS 'host',
cg.CollectionName AS 'sccm_collection_name',
fcm.CollectionID AS 'sccm_collection_id',
sw.Name AS 'sccm_mw_name',
CASE sw.ServiceWindowType
WHEN '1' THEN 'All Deployments'
WHEN '4' THEN 'Software Updates'
WHEN '5' THEN 'Task Sequences'
END AS 'sccm_mw_type',
@timdenholm
timdenholm / sccm-get-su-membership.sql
Created May 1, 2019 03:42
Get SCCM Software Update Collection Membership
SELECT
fcm.Name AS 'host',
fcm.CollectionID AS 'sccm_su_collection_id',
cg.CollectionName AS 'sccm_su_colection_name'
FROM v_FullCollectionMembership fcm
JOIN Collections_G cg ON cg.SiteID = fcm.CollectionID
WHERE cg.CollectionName LIKE 'SU-%'
ORDER BY host