Skip to content

Instantly share code, notes, and snippets.

View tostka's full-sized avatar

Todd Kadrie tostka

View GitHub Profile
@tostka
tostka / vsc-cheatsheet.ahk
Created October 25, 2016 17:04
AHK-based Visual Studio Code popup cheatsheet
;;; vsc-cheatsheet.ahk
/*
#*------v NOTES v------
.SYNOPSIS
vsc-cheatsheet.ahk - Quick`nDirty Autohotkey-based popup reference menu for Visual Studio Code keyboard shortcuts
.NOTES
Written By: Todd Kadrie
Website: http://tinstoys.blogspot.com
Twitter: http://twitter.com/tostka
@tostka
tostka / vsc-cheatsheet.csv
Last active October 25, 2016 17:16
Supporting CSV for vsc-cheatsheet.ahk VSCode popup dialog/cheatsheet (written in autohotkey)
===VSC:HOTKEYS===
Key Purpose Key Purpose macro Purpose macro Purpose
----- --------------- ----- --------------- ----- --------------- ----- ---------------
'==Editing: '==Navigation: vsco7 Vscode open & recyclewin
Bracket/Brace Matching Ctrl+Shift+\ Goto Line Ctrl+G
Comment: (4key combos) Move Line Up/Down Alt+Up
Uncomment: Ctrl+k, Ctrl+c Al+Down
Ctrl+k, Ctrl+u Page Dn Scroll Alt+PgDn
Define Key binding Ctrl+k, Ctrl+k Page Up Scroll Alt+PgUp
Find, Select Next Find Match Ctrl+k, Ctrl+d Find Ctrl+F
;;; Ecco-Formatting.ahk
/*
#*------v NOTES v------
.SYNOPSIS
Ecco-Formatting.ahk - Autohotkey hotkeys for 'styling' the old Ecco Pro outliner.
.NOTES
Written By: Todd Kadrie
Website: http://tinstoys.blogspot.com
Twitter: http://twitter.com/tostka
@tostka
tostka / get-ExchangeUpdateRollups.ps1
Created November 29, 2016 20:11
Tweaked variant of Bhargav Shukla's script that polls all Exchange 2007/2010/2013 boxes in the org, and reports on current Exch patch revision
# Get-ExchangeUpdateRollups.ps1 - Gets the Exchange Server 2007, Exchange 2010 and Exchange 2013 Update Rollups
<#
.SYNOPSIS
Get-ExchangeUpdateRollups.ps1 - Gets the Exchange Server 2007, Exchange 2010 and Exchange 2013 Update Rollups
.NOTES
Written By: Bhargav Shukla
Website: http://www.bhargavs.com
Revised By: Todd Kadrie
Website: http://tinstoys.blogspot.com
<# Powershell snippet to retrieve details on top 3 queued domains on Exchange hubs in local AD site
I generally just paste the 1-liner version straight into a remote EMS console, for execution
#>
$TopDoms=3 ;
$Site=[System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().Name ;
$Banner="== v Site:$($Site.toupper()) - TOP $($TopDoms) QUEUED DOMAINS PER HUB: v ==" ;
write-host -foregroundcolor green "`n$((get-date).ToString('HH:mm:ss')):$($Banner)" ;
$hubsl=Get-ExchangeServer | where { $_.isHubTransportServer -eq $true -and $_.Site -match ".*\/$($Site)$"} | select -expand Name ;
foreach($hub in $hubsl){ write-host -foregroundcolor green "$((get-date).ToString('HH:mm:ss')):----$($hub):" ;
[console]::ForegroundColor = "yellow" ;
<# Exchange HubTransport queue snippet for dumping queued external delivery domain details,
for all hub servers in the local AD Site. (Exchange 2010 version)
Update the $probdom to a target fqdn, and run it.
#>
$probdom='badmaildelivery.com' ;
$Site=[System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().Name ;
$Banner="== v Site:$($Site.toupper()) - MSGS QUEUED TO $($probdom) PER HUB: v ==" ;
write-host -foregroundcolor green "`n$((get-date).ToString('HH:mm:ss')):$($Banner)" ;
$hubsl=Get-ExchangeServer | where { $_.isHubTransportServer -eq $true -and $_.Site -match ".*\/$($Site)$"} | select -expand name ;
foreach($hub in $hubsl){ write-host -foregroundcolor green "$((get-date).ToString('HH:mm:ss')):----$($hub):" ;
@tostka
tostka / append-x500LEDN-ToMbxEmailAddressess.ps1
Last active March 27, 2018 23:30
Exchange Script to splice in historical LEDN onto migrated mailboxes, to support reply-to etc on PST migrated email.
# append-x500LEDN-ToMbxEmailAddressess.ps1
<# key snippet from larger script...#>
if(test-path $InputCSV) {
write-verbose -verbose:$true "$((get-date).ToString('HH:mm:ss')):Loading Input file: $($InputCSV)" ;
$procMbxs=import-csv $InputCSV ;
foreach($pMbx in $procMbxs) {
if($tmbx = get-mailbox -identity "$($pMbx.WindowsEmailAddress)" -ea 0 ){
write-host -foregroundcolor green "$((get-date).ToString('HH:mm:ss')):MATCHED:$($pMbx.WindowsEmailAddress)($($pMbx.displayname))=>TO:$($tmbx.WindowsEmailAddress)($($tmbx.displayname))" ;
#check-ExchSvcStatusRpt.ps1
<# This gist is trimmed to just the core data gathering bits...
#>
#-------------------------------------------------
# do data collection here
<# trimmed #>
# Ex svcs
$svcs = (get-service -include *exchange* -computername $env:COMPUTERNAME | ?{$_.name -notmatch '^(Mimosa.*|wsbexchange)$'} | select name,DisplayName,status );
<# This gist is TRIMMED to just the core pieces #>
#*------v Function Test-Port() v------
function Test-Port {
# attempt to open a port (telnet xxx.yyy.zzz nnn)
# call: Test-Port $server $port
PARAM([parameter(Mandatory=$true)] [alias("s")] [string]$Server, [parameter(Mandatory=$true)][alias("p")]
[int]$port
) ;
$ErrorActionPreference = “SilentlyContinue” ;
@tostka
tostka / convert-ToMp3.ps1
Last active March 28, 2018 00:09
convert-ToMp3.ps1 - Movie to Mp3 conversion wrapper script for ffmpeg or VLC player.
# convert-ToMp3.ps1
<# This gist is TRIMMED to ust the core pieces #>
#*================v FUNCTIONS v================
#*----------------v Function convert-ToMp3 v------
function convert-ToMp3 {
<# TRIMMED #>