Skip to content

Instantly share code, notes, and snippets.

View larrye11ison's full-sized avatar
💭
Would you hold still, please, sir?

Not Larry Ellison larrye11ison

💭
Would you hold still, please, sir?
  • Substantially earth-adjacent
View GitHub Profile
Ensure data is contained in an Excel Table
Add new column on end of your data, enter "0" as column header/name
"Fill down" on that column with this formula:
=IF([@OnChangeColumnName] = OFFSET([@OnChangeColumnName], -1, 0), OFFSET([@0], -1, 0), OFFSET([@0], -1, 0) + 1)
"OnChangeColumnName" is the name of the column on whose values you want to trigger the background change
Select all data in the table, excluding the header row
Menu: Conditional Formatting / New Rule
Select "Use a formula to determine which cells to format", use this:
=AND(LEN($A2)>0,MOD($D2,2)=0)
"A" is the on-change trigger column, "D" is the "0" column added above
<#
Dumps out metadata for one or more SQL queries into CSV files.
"Metadata" means FieldName, DataType, ColumnSize, plus "Values".
"Values" means a list of distinct values for each column where
the code detects a code lookup scenario.
* Only for string datatypes (where the SQL datatype name is
like "*char*") - types like int, date, etc. are ignored.
## The name of the remote computer on which we want to run the task
$remoteMachineWithTheScheduledTask = '<<remote machine name>>'
## This is the "full path" to the task, starting with a backslash and including any folders.
## Check the output of "schtasks.exe /query /s $remoteMachineWithTheScheduledTask"
## to see the exact value to use.
$taskName = "<<task name>>"
function Get-CurrentTaskStatus()
{
return (& schtasks.exe /query /s $remoteMachineWithTheScheduledTask /tn $taskName /fo csv | convertfrom-csv).Status
param($startIn , $writeOutputTo )
set-strictmode -version latest
$startTime = get-date
$startingFolder = $startIn
$outputFile = $writeOutputTo
##########################################################################################
## Set this folder to the location where all your PDFs are located:
##
$startInFolder = "c:\path\to\your\pdfs"
## MAYBE set this... it's the image resolution. 300 worked well for the MSI
## PDFs. Numbers lower than this did provide MUCH smaller files, but they
## seemed to lose quite a bit of detail in the images.
$imageResolution = 300
set-strictmode -version latest
## Opens all word docs (*.doc, *.docx) in a specified directory
## and saves them back out as PDF format.
#################################################
#################################################
## SET THIS VALUE HERE to a valid folder
$folderToProcess = "C:\Users\<<<FOO>>>\Documents\crap\filth"
#################################################
#################################################
@larrye11ison
larrye11ison / script-entire-database.ps1
Created May 25, 2016 23:25
Semi-non-hacky way to script out all objects in one database. Depends on SQL Powershell, or at least needs the snap-ins loaded to use that stuff (so you can connect using SQLSERVER:\SQL\Server\Instance\DBName... etc).
param($dbPath)
function SanitizeFileSystemPath([string]$path)
{
$ic = [io.path]::GetInvalidFileNameChars()
$invalidCharPosition = -1
$invalidCharPosition = $path.IndexOfAny($ic, $invalidCharPosition + 1)
while($invalidCharPosition -gt -1)
{
$path = $path.Remove($invalidCharPosition, 1)
@larrye11ison
larrye11ison / check-versions-on-terminal-server.ps1
Last active December 14, 2017 17:50
Check versions of AMS on terminal server
$paths = gci '\\<<< put server name here>>>\c$\Documents and Settings' -direct |
% { get-item (join-path $_.FullName "Local Settings\Application Data\AMS\Production\snsccontainer.exe") -ea silent } |
select -exp FullName |
select @{ n = 'Version'; e = {
$v = [Diagnostics.FileVersionInfo]::GetVersionInfo($_).FileVersion.ToString()
$v.SubString(0, $v.IndexOf(';'))
} },
@{ n = 'FullName'; e = { $_ }} |
Group Version
############################################################
## Set these two params - first the "input" file
$sourceFilePath = '??????????????????'
## Point to the output folder - where do you want your results written to?
$outputPath = '??????????????????'
############################################################
## you MAY need to adjust these next two items for some prior servicers...
$loanIDRegex = [regex]"(?n)LOAN NUMBER:\s*(?<loanid>\d+)"
$firstPageRegex = [regex]"(?m)^.*(PAGE 01)[\n\r]*$"
@larrye11ison
larrye11ison / fix-pdf-and-tiff-file-extensions.ps1
Created June 4, 2015 19:40
Fix TIFF and PDF file extensions
########################################################################
########################################################################
## put the full path to the folder to be fixed here
$path = '??????????????????????'
########################################################################
########################################################################