This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Logging functions. | |
#> | |
function logError([string]$logsrc, [string]$msg) { | |
if ([String]::IsNullOrWhiteSpace($logsrc)) { | |
write-log -msg $msg -level "ERROR" | |
} | |
elseif (@(".txt", ".log").Contains([System.IO.Path]::GetExtension($logsrc)) -eq $true) { | |
write-log -msg $msg -level "ERROR" -file $logsrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[Parameter(Mandatory = $true)] | |
[string]$in, | |
[string]$out = "d:\dev-archive" | |
) | |
$extract_output_dir = "$in\extract\extracted\output\*" | |
remove-item $extract_output_dir -Recurse | |
Write-Host "Removed $extract_output_dir" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Create sitemap index with attendant sitemaps from a Solr query. | |
A new sitemap is created every 50,000 rows. | |
#> | |
param ( | |
[string]$ChangeFrequency = "weekly", | |
[string]$IndexBaseUrl = "http://andi.andornot.com/", | |
[string]$Logsrc = "Andi Solr Update", | |
[string]$OutDir = ".\", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Backs up Inmagic textbases, both SQL Server db and relevant textbase files. | |
Peter Tyrrell, Andornot, www.andornot.com | |
sqlps dependency | |
If module sqlps does not exist, install from: | |
Microsoft SQL Server 2016 Feature Pack (https://www.microsoft.com/en-us/download/details.aspx?id=52676) | |
- SQLSysClrTypes.msi | |
- SharedManagementObjects.msi | |
- PowershellTools.msi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# restarts named app pool if stopped, writes restart event to the Application Event Log | |
# Peter Tyrrell, May 13 2013 | |
param( | |
[string[]]$names = (,"ISAPI Webpublisher") | |
) | |
# If OS < Server 2008 R2, install Powershell snap-in for IIS and uncomment: | |
#Add-PSSnapin WebAdministration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# all logging settins are here on top | |
$logFile = "log-$(gc env:computername).log" | |
$logLevel = "DEBUG" # ("DEBUG","INFO","WARN","ERROR","FATAL") | |
$logSize = 1mb # 30kb | |
$logCount = 10 | |
# end of settings | |
function Write-Log-Line ($line) { | |
Add-Content $logFile -Value $Line | |
Write-Host $Line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
setlocal ENABLEDELAYEDEXPANSION | |
SET /a x=0 | |
FOR /R E:\ %%G IN (*.cda) DO (CALL :SUB_VLC "%%G") | |
GOTO :eof | |
:SUB_VLC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[string]$server, | |
[string]$dbname, | |
[int]$daysToKeep, | |
[Parameter(Mandatory=$false)] | |
[string]$logsrc = "Andi Solr Update" | |
) | |
function logError([string]$logsrc, [string]$msg) { | |
# write error msg to Application EventLog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[Parameter(Mandatory=$true)] | |
[string]$server, | |
[Parameter(Mandatory=$true)] | |
[string]$dbname, | |
[Parameter(Mandatory=$true)] | |
[int]$daysToKeep, | |
[Parameter(Mandatory=$false)] | |
[string]$logsrc = "Andi Solr Update" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extract tif per page from djvu | |
# requires djvulibre | |
param( | |
[Parameter(Mandatory=$true,ValueFromPipeline=$true,Position=0)] | |
[string]$in | |
) | |
process | |
{ |