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
<# | |
Zip up textbase files in preparation for FTP sync to Andornot. | |
Peter Tyrrell, ptyrrell@andornot.com | |
-textbases c:\path\to\accessions.tba, c:\path\to\descriptions.tba | |
-out c:\path\to\destination | |
#> | |
param ( | |
[string[]] $textbases, |
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
<# | |
Downsample PDF and convert to gray if necessary. | |
Requires Ghostscript (gswin64c). | |
#> | |
param ( | |
[string]$indir, | |
[string]$outdir = $indir, | |
[string]$gs = "gswin64c", | |
[string]$dpi = "150" |
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
<# | |
Rip Audio CD to mp3 files with VLC. | |
#> | |
param ( | |
[string]$vlc = "c:\program files\videolan\vlc\vlc.exe", | |
[string]$cddrive = "E:", | |
[int]$track = 0 | |
) |
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
<# | |
1. Leaf | |
Given a text file of PDF filenames, extract content from PDFs recursively | |
and create mirror directory structure for text file outputs. | |
* Handles filenames with entry separators. | |
* Ignores PDF older than its text file mirror unless -force param is used. | |
* Requires poppler pdftotext.exe | |
.\text-mirror.ps1 -in C:\dev\abc\extract\extracted\pdfs\abc-pdfs-1.txt ` |