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
@tostka
tostka / vsc-cheatsheet.ahk
Last active March 28, 2018 02:48
Visual Studio Code 'cheatsheet' popup menu, rendered in Autohotkey script
;;; vsc-cheatsheet.ahk
/* TRIMMED DOWN GIST, KEY CODE BITS, SEE FULL SCRIPT FOR DETAILS
*/
sAHKSdir :="C:\sc\ahk\ahkscripts\"
;;;*------v hs-vsc-cheatsheet (QuickRef) v------
:!:7VSCm::
capslock & F1::
@tostka
tostka / get-Tlogs-FreeSpace-Report.ps1
Last active March 28, 2018 02:56
Remote drivespace reporting script to monitor and report on the available Transaction Log space on Exchange servers.
<# TRIMMED gist, see full script for details #>
#*---------------------------v Function Get-TLogSpaceRegion v---------------------------
Function Get-TLogSpaceRegion ($ExTargVers,$SiteName) {
If ($bDebug -eq $TRUE) {
Write-Host ("Get-TLogSpaceRegion,ExTargVers: " + $ExTargVers)
}
@tostka
tostka / close-WinsAll.ps1
Last active March 28, 2018 02:42
close-WinsAll.ps1 - Gracefully close (prompted saves) on all desktop windows, Control Panel Wins, and Explorer Wins
<# trimmed gist, see full close-WinsAll.ps1 for details #>
write-host -foregroundcolor green "***v ISSUING CLOSE ON _ALL_ DESKTOP WINDOWS! v***" ;
(get-process | ? { $_.mainwindowtitle -ne "" -and $_.processname -ne "powershell" } )| % {"proc:$($_.Name)" ; $_.CloseMainWindow() ; } ;
<# express equiv: KILL everything but ps, dead
(get-process | ? { $_.mainwindowtitle -ne "" -and $_.processname -ne "powershell" } )| stop-process ;
#>
# 10:07 AM 3/13/2018 #25 IE close: first do all IE, windows and blow past the 'Close All' prompts (only IE turns up in ShellApp):
$ShellApp = New-Object -ComObject Shell.Application ;
@tostka
tostka / Get-IMDBSearch.ps1
Last active March 28, 2018 02:34
Interactive Imdb title lookup function, uses xml (html) parsing. Returns and lists closest matches in menu, then returns details of selected choice
<# TRIMMED GIST, SEE FULL Get-IMDBSearch.ps1 SCRIPT FOR DETAILS#>
#*------v Function Get-IMDBSearch v------
Function Get-IMDBSearch {
<# TRIMMED #>
$qryUrlRoot = "http://google.com/search?q=site:imdb.com/title" ;
$url = "$($qryUrlRoot) $($Title.trim())" ;
@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 #>
<# 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" ;