Thursday, June 15, 2017

Makin' Music (from movies, convert-ToMp3.ps1 Powershell script for ffmpeg or vlc player)

6/15/2017: Sometimes, you just need to convert that video into an mp3 file. You, know, something to take along in the car. Something to spin at your next 'rave' (ho-hum). :P

So what I have here, is a Powershell 'wrapper' for ffmpeg or VLC Player's native ability to convert video's to Mp3. Sure, you could use ffmpeg's command line, (or VLC's Media > Convert\Save menu). But sometimes you want to convert a whole batch, or directory, or recursive directory tree! And that is exactly where this .ps1 comes in.

All you need to do is download and install one or both of the above. I've found that ffmpeg works more consistently and bug-free than VLC. But take your pick. And then get-content c:\path-to-videos\. and pipeline them into the script, and you're off to the mp3 races. Docs and examples are in the script comments.

Here's the code

Wednesday, June 14, 2017

Get the Picture? (get-ImdbSearch.ps1 Powershell script)

6/14/2017: Two Posts in a day! And both're scripts to-boot!

I like movies. A lot. Last time we moved, I donated piles of dvd's! 

Wonderful thing, moving. Clears the head!  Gives you massive perspective.
Makes you want to donate 300-400 books, and hundreds of dvd's, JUST BECAUSE YOU NEVER WANT TO MOVE THEM AGAIN! :D Ever!. Really. :^S

Anyway, on to today's script: This one runs an interactive Imdb title search (using Google - smaht!) for near-miss title-matching, then returns a console menu of the Google hits, from which to pick. Pick a movie from the menu, and it pulls some fairly decent amounts of info on the chosen flick from Imdb.

Two outputs: Default 'Summary': 

And '-Full':

Here's the code

And the current revision can always be found at Github: Get-IMDBSearch.ps1

Nuke the entire site from orbit (close-WinsAll.ps1 Powershell script)

6/14/2017: One of the distinct 'costs' of running Office 365/Office 2016 at the office, seems to be that I spend a lot more time:
  1. Shutting down my work box for patching (now that both centralized patch management AND Office 365, independently do their own self-scheduled patching passes),
  2. and, much more frequently and defensively rebooting my box to try to scrape a few more ounces of performance from Word/Excel2016's bloated mass and resource sucking appetite.  
Both of which motivations naturally mean I'm trying to get faster reboots through on my box -- and this is coming from a guy that for the last 4-5 years has consistently hibernated his laptop at each day's end, to try to hit the ground running the next day, from the point I left off. :^|

Anyway, needless to say, the prospects and days of running a given 'up' session of Win7 for, "a couple of weeks" a stretch, appear to be long, long gone. Well, until they hand me a 36gb laptop (and some down time from work burn, to reinstall everything back to spec). But I digress....

So what's the point of this post? Simple: I've got a small and handy script I use, to get my box knocked down and into a reboot POST-HASTE!.

close-WinsAll.ps1 goes through and quickly does the following:
  • Issues a 'CloseWindow' on all visible desktop processes: Causing each to prompt for a save, if they're in an unsaved state, 
  • ... and then issues a 'Quit' on all Control Panel or  Explorer windows. 
Net result after a pass: Everything that can be closed, closes. And everything that needs an explicit save, is left with a save dialog popped. Confirm or cancel the save prompts,hit ctrl+alt+del, pick Reboot, and you're off to a Refreshening™ as fast as your wee little fingers can take you. :D

Here's the code

Thursday, February 2, 2017

Two is one, one is none

And this... why I run both Google Drive & Dropbox. This morning Google Drive fired up on my laptop and promptly threw the prompt above, and refused to sync in the latest changes from home. 😒

I use drive sync'ing to pull daily changes in files back and forth between work & home. And I frequently hit the ground running in the morning, and don't have time to monkey with mandated forced-marches to, "The Latest Revision™", that the above reflects. *eyeroll*

All of which means, having my data concurrently synced into Dropbox as well as GDrive, keeps me rolling when one of the vendor's unilaterally decides to  fold it's tent. Keeping some fault-tolerance in critical links helps yield up a smooth, impact free, and productive work flow. Regardless of vendor mandates...

And don't get me started on the New-n-Improved™, "Patch & Regression-testing's for Weenies!",  methodology behind releasing half-baked patches for apps like Office 365, Windows-itself, and any number of 'modern' rolling apps. 😒

Sure, when it comes to security - for yer granny - Herd Immunity's a thing, and has statistical benefits across thousands to millions of folks. But that doesn't help much when you're the individual that got floored by the vaccine. 😜  And as a power-user, it's more important that I get my work done quickly and with minimal hurdles, than it is that I be 'protected' from clicking idiot-exploit links that I'd never go near with a 10-foot-pole...

Yea, it'd be nice to have some choice on the patch timing.Patching reboots and downtime per month seems to have _doubled_ now that Office 365 runs it's own patch requests, out of sync with desktop patching... Used to be one set of Black Tuesday patches per month could get'r all done neatly. Ahh, for those less-thrilling days of yesteryear. :D

Is it just me, or have vendors gotten awfully dictatorial in the last 5 years?  Heh, welcome to, "One Size WILL Fit All!"

Tuesday, November 29, 2016

Visual Studio Code: Autohotkey-based popup Cheatsheet for Keyboard Shortcuts

11/29/2016: I like Visual Studio Code a lot - it's got some warts, and gaps, but there's some thing's it does amazingly well (and some it sort of stumbles at). If you write in Powershell, it's probably the best/lightest/most-stable editor I've found, with the range of features you get, and rampant-growth and availability in user-created extensions -  (Though it really needs better-rounded debugging... *grumble* ;P) .

Anyway, one of my pet peeves for 'Code.exe' is it's lack of good quick popup references for common tasks - well that and some of it's interface & control choices that don't match most of the common keystrokes and mouse behaviors I've gotten used to in other editors.

Autohotkey fills the gap!

Toward that end, the below is an Autohotkey-based quick-n-dirty Popup Cheatsheet for Visual Studio Code. If you use  AHK & 'Code', you might find this gapfills a niche.

I don't doubt you can hack Code.exe itself to display a menu with a hot key binding. But I work for a living ; I don't want to burn a lot of time learning how to build objects in code.exe itself. :P But I do make tons of use of AutoHotKey these days -- (automation tied to working for a firm with a lot more user-interaction than I've had in the past: BOILERPLATE! AUTOMATE!) --  so I decided yesterday to take a few minutes and whip up a quick popup dialog in AHK that just lists out the key keyboard shortcuts I want to use (especially where addon extension commands and bindings are concerned).

It's pretty simple, docs are inline in the script (stored & kept updated at Github):
Two chunks below: the .ahk script file, and a .csv file that drives the displayed menu.

Lemme know if you have any questions. :^D

What's your revision, Exchange?

11/29/2016: More quick-shared code: This is a 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.
Changes I made were pretty minimal: adding pshelp, reformatting layout a tad, adding progress echo's, and renaming the output to a timestamped csv file, named for the script itself (easier to track changes over time, than the default 'results.csv' in your script directory). 

Here's the code