mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-19 00:18:20 +02:00
Merge branch 'main' of github.com:fleschutz/PowerShell
This commit is contained in:
commit
fa466955a4
@ -140,6 +140,7 @@ ARINC,Aeronautical Radio, Inc. (USA)
|
|||||||
ARLNO,Airline Office
|
ARLNO,Airline Office
|
||||||
ARP,Airport Reference Point
|
ARP,Airport Reference Point
|
||||||
ARTCC,Air Route Traffic Control Centre
|
ARTCC,Air Route Traffic Control Centre
|
||||||
|
ASACS,Air Surveillance and Control System
|
||||||
ASB,Airspace Block
|
ASB,Airspace Block
|
||||||
ASDA,Accelerate Stop Distance Available
|
ASDA,Accelerate Stop Distance Available
|
||||||
ASDE,Airport Surface Detection Equipment
|
ASDE,Airport Surface Detection Equipment
|
||||||
@ -319,6 +320,7 @@ IGLR,Integrated Ground Lighting and Radar
|
|||||||
ILS,Instrument Landing System
|
ILS,Instrument Landing System
|
||||||
ISA,International Standard Atmosphere
|
ISA,International Standard Atmosphere
|
||||||
IMC,Instrument Meteorological Conditions
|
IMC,Instrument Meteorological Conditions
|
||||||
|
JTAC,Joint Terminal Attack Control
|
||||||
KAT,Kaufbeuren ATM Training (DFS subcompany)
|
KAT,Kaufbeuren ATM Training (DFS subcompany)
|
||||||
KCAS,Calibrated AirSpeed in Knots
|
KCAS,Calibrated AirSpeed in Knots
|
||||||
KIAS,Indicated Airspeed in Knots
|
KIAS,Indicated Airspeed in Knots
|
||||||
@ -368,6 +370,7 @@ OGE,Out of Ground Effect
|
|||||||
OFZ,Obstacle Free Zone
|
OFZ,Obstacle Free Zone
|
||||||
OJT,On the Job Training
|
OJT,On the Job Training
|
||||||
OODA,"Observation, Orientation, Decision, and Action"
|
OODA,"Observation, Orientation, Decision, and Action"
|
||||||
|
OSC,On Scene Commander
|
||||||
PA,Pressure Altitude
|
PA,Pressure Altitude
|
||||||
PADS,Parallax Aircraft Docking System
|
PADS,Parallax Aircraft Docking System
|
||||||
PAPA,"Parallax Aircraft Parking Aid (docking system)"
|
PAPA,"Parallax Aircraft Parking Aid (docking system)"
|
||||||
@ -397,7 +400,7 @@ RB,Relative Bearing
|
|||||||
RBI,Relative Bearing Indicator
|
RBI,Relative Bearing Indicator
|
||||||
RBAF,Royal Belgium Armed Forces
|
RBAF,Royal Belgium Armed Forces
|
||||||
RCAF,Royal Canadian Air Force
|
RCAF,Royal Canadian Air Force
|
||||||
RCC,Rescue Co-ordination Centre
|
RCC,Rescue Coordination Center
|
||||||
RCL,Runway Centre Line Lighting
|
RCL,Runway Centre Line Lighting
|
||||||
RCR,Runway Condition Reading
|
RCR,Runway Condition Reading
|
||||||
RCS,Radar Cross Section
|
RCS,Radar Cross Section
|
||||||
@ -421,7 +424,8 @@ RRPM,Rotor Rotations per Minute
|
|||||||
RSA,Runway Safety Area
|
RSA,Runway Safety Area
|
||||||
RSAF,Republic of Singapore Air Force
|
RSAF,Republic of Singapore Air Force
|
||||||
RSC,Runway Surface Condition
|
RSC,Runway Surface Condition
|
||||||
RSI,Remote Status Indicato
|
RSI,Remote Status Indicator
|
||||||
|
RSO,Range Safety Officer
|
||||||
RSRS,Reduced Same Runway Separation
|
RSRS,Reduced Same Runway Separation
|
||||||
RTCA,Radio Technical Commission for Aeronautics
|
RTCA,Radio Technical Commission for Aeronautics
|
||||||
RVR,Runway Visual Range
|
RVR,Runway Visual Range
|
||||||
@ -462,6 +466,7 @@ SM,Statute Mile
|
|||||||
SMR,Surface Movement Radar
|
SMR,Surface Movement Radar
|
||||||
SOF,Supervisor of Flying
|
SOF,Supervisor of Flying
|
||||||
SOW,Statement of Work
|
SOW,Statement of Work
|
||||||
|
SRA,Surveillance Radar Approach
|
||||||
SRC,Safety Regulation Commission (EUROCONTROL)
|
SRC,Safety Regulation Commission (EUROCONTROL)
|
||||||
SRU,Safety Regulation Unit (EUROCONTROL)
|
SRU,Safety Regulation Unit (EUROCONTROL)
|
||||||
SSR,Secondary Surveillance Radar
|
SSR,Secondary Surveillance Radar
|
||||||
|
Can't render this file because it has a wrong number of fields in line 139.
|
@ -53,6 +53,7 @@ NSA,U.S. National Security Agency
|
|||||||
NYPD,New York Police Department
|
NYPD,New York Police Department
|
||||||
OECD,Organization for Economic Cooperation & Development
|
OECD,Organization for Economic Cooperation & Development
|
||||||
ONCD,Office of the National Cyber Director
|
ONCD,Office of the National Cyber Director
|
||||||
|
RSF,Reporters Sans Frontières (French for: Reporters Without Borders)
|
||||||
SAARC,South Asian Association for Regional Cooperation
|
SAARC,South Asian Association for Regional Cooperation
|
||||||
TREAS,U.S. Department of the Treasury
|
TREAS,U.S. Department of the Treasury
|
||||||
ULA,United Launch Alliance
|
ULA,United Launch Alliance
|
||||||
|
Can't render this file because it has a wrong number of fields in line 14.
|
@ -20,18 +20,19 @@
|
|||||||
param([int]$port = 8099, [string]$mediaFolder = "$HOME/Calibre Library", [string]$userDB = "$HOME/CalibreUsers.sqlite", [string]$logfile = "$HOME/CalibreServer.log")
|
param([int]$port = 8099, [string]$mediaFolder = "$HOME/Calibre Library", [string]$userDB = "$HOME/CalibreUsers.sqlite", [string]$logfile = "$HOME/CalibreServer.log")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($IsLinux) {
|
if (-not $IsLinux) { throw "Sorry, currently only supported on Linux" }
|
||||||
|
|
||||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
"⏳ (1/5) Updating package infos..."
|
"⏳ (1/5) Updating package infos..."
|
||||||
& sudo apt update -y
|
& sudo apt update -y
|
||||||
if ($lastExitCode -ne "0") { throw "'apt update' failed" }
|
if ($lastExitCode -ne "0") { throw "'apt update' failed" }
|
||||||
|
|
||||||
"⏳ (2/5) Installing Calibre..."
|
"⏳ (2/5) Installing Calibre package..."
|
||||||
& sudo apt install calibre -y
|
& sudo apt install calibre -y
|
||||||
if ($lastExitCode -ne "0") { throw "'apt install calibre' failed" }
|
if ($lastExitCode -ne "0") { throw "'apt install calibre' failed" }
|
||||||
|
|
||||||
"⏳ (3/5) Searching for Calibre server executable..."
|
Write-Host "⏳ (3/5) Searching for Calibre server executable... " -noNewline
|
||||||
& calibre-server --version
|
& calibre-server --version
|
||||||
if ($lastExitCode -ne "0") { throw "Can't execute 'calibre-server' - make sure Calibre server is installed and available" }
|
if ($lastExitCode -ne "0") { throw "Can't execute 'calibre-server' - make sure Calibre server is installed and available" }
|
||||||
|
|
||||||
@ -42,12 +43,9 @@ try {
|
|||||||
& calibre-server --port $port --num-per-page 100 --userdb $userDB --log $logfile --daemonize $HOME/'Calibre Library'
|
& calibre-server --port $port --num-per-page 100 --userdb $userDB --log $logfile --daemonize $HOME/'Calibre Library'
|
||||||
|
|
||||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ Installed Calibre server on Web port $port in $elapsed sec (media folder: $mediaFolder, user database: $userDB, log file: $logfile)"
|
"✔️ Installed Calibre server on port $port in $($elapsed)s (media at: $mediaFolder, user DB: $userDB, log to: $logfile)"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} else {
|
|
||||||
throw "Currently only supported on Linux"
|
|
||||||
}
|
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
try {
|
||||||
"📋 $(get-clipboard)"
|
[string]$text = (Get-Clipboard)
|
||||||
|
Write-Output "📋 `“ $text `„"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Lists Git repositories
|
Lists Git repositories
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script lists all Git repositories in a folder with details such as tag/branch/status/URL.
|
This PowerShell script lists all Git repositories in a folder with details such as latest tag/branch/status/URL.
|
||||||
.PARAMETER parentDir
|
.PARAMETER parentDir
|
||||||
Specifies the path to the parent directory (current working directory by default)
|
Specifies the path to the parent directory (current working directory by default)
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
Local Repo Latest Tag Branch Status Remote Repo
|
Local Repo Latest Tag Branch Status Remote Repo
|
||||||
---------- ---------- ------ ------ -----------
|
---------- ---------- ------ ------ -----------
|
||||||
📂cmake v3.23.0 main ✔️clean git@github.com:Kitware/CMake ↓0
|
📂cmake v3.23.0 main ✔️clean ↓0 git@github.com:Kitware/CMake
|
||||||
...
|
...
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
@ -35,8 +35,8 @@ function ListRepos {
|
|||||||
$numCommits = (git -C "$folder" rev-list HEAD...origin/$branch --count)
|
$numCommits = (git -C "$folder" rev-list HEAD...origin/$branch --count)
|
||||||
$status = (git -C "$folder" status --short)
|
$status = (git -C "$folder" status --short)
|
||||||
if ("$status" -eq "") { $status = "✔️clean" }
|
if ("$status" -eq "") { $status = "✔️clean" }
|
||||||
elseif ("$status" -like " M *") { $status = "⚠️modified" }
|
elseif ("$status" -like " M *") { $status = "⚠️changed" }
|
||||||
New-Object PSObject -property @{'Local Repo'="📂$folderName";'Latest Tag'="$latestTag";'Branch'="$branch";'Remote Repo'="$remoteURL";'Status'="$status ↓$numCommits"}
|
New-Object PSObject -property @{'Local Repo'="📂$folderName";'Latest Tag'="$latestTag";'Branch'="$branch";'Status'="$status";'Remote Repo'="↓$numCommits $remoteURL"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ try {
|
|||||||
$null = (git --version)
|
$null = (git --version)
|
||||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||||
|
|
||||||
ListRepos | Format-Table -property @{e='Local Repo';width=19},@{e='Latest Tag';width=18},@{e='Branch';width=15},'Remote Repo',@{e='Status';width=14}
|
ListRepos | Format-Table -property @{e='Local Repo';width=19},@{e='Latest Tag';width=16},@{e='Branch';width=19},@{e='Status';width=10},'Remote Repo'
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -59,7 +59,8 @@ function GetDescription { param([string]$text)
|
|||||||
"Patchy snow possible" { return "❄️ patchy snow possible" }
|
"Patchy snow possible" { return "❄️ patchy snow possible" }
|
||||||
"Sunny" { return "☀️ sunny" }
|
"Sunny" { return "☀️ sunny" }
|
||||||
"Thundery outbreaks possible" { return "⚡️thundery outbreaks possible" }
|
"Thundery outbreaks possible" { return "⚡️thundery outbreaks possible" }
|
||||||
default { return "$Text" }
|
"Thundery outbreaks in nearby" { return "⚡️thundery outbreaks in nearby" }
|
||||||
|
default { return $text }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +120,7 @@ try {
|
|||||||
}
|
}
|
||||||
$Day++
|
$Day++
|
||||||
}
|
}
|
||||||
"$(($Hour.toString()).PadLeft(2))°° $Temp° $Precip $Humidity% $($WindDir)$WindSpeed $UV $Clouds% $Visib $Desc"
|
"$(($Hour.toString()).PadLeft(2))h $Temp° $Precip $Humidity% $($WindDir)$WindSpeed $UV $Clouds% $Visib $Desc"
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -6,12 +6,12 @@
|
|||||||
.PARAMETER pathToRepo
|
.PARAMETER pathToRepo
|
||||||
Specifies the file path to the local Git repository (default is working directory)
|
Specifies the file path to the local Git repository (default is working directory)
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./pull-repo.ps1 C:\Repos\rust
|
PS> ./pull-repo.ps1
|
||||||
⏳ (1/4) Searching for Git executable... git version 2.44.0.windows.1
|
⏳ (1/4) Searching for Git executable... git version 2.44.0.windows.1
|
||||||
⏳ (2/4) Checking local repository...
|
⏳ (2/4) Checking local repository... 📂C:\Repos\rust
|
||||||
⏳ (3/4) Pulling remote updates...
|
⏳ (3/4) Pulling remote updates...
|
||||||
⏳ (4/4) Updating submodules...
|
⏳ (4/4) Updating submodules...
|
||||||
✔️ Pulled updates into 📂rust repository in 14 sec.
|
✔️ Pulled remote updates into 📂rust repo in 14s.
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -27,10 +27,10 @@ try {
|
|||||||
& git --version
|
& git --version
|
||||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||||
|
|
||||||
Write-Host "⏳ (2/4) Checking local repository..."
|
Write-Host "⏳ (2/4) Checking local repository... 📂$pathToRepo"
|
||||||
if (-not(Test-Path "$pathToRepo" -pathType container)) { throw "Can't access folder: $pathToRepo" }
|
if (-not(Test-Path "$pathToRepo" -pathType container)) { throw "Can't access folder: $pathToRepo" }
|
||||||
$result = (git -C "$pathToRepo" status)
|
$result = (git -C "$pathToRepo" status)
|
||||||
if ("$result" -match "HEAD detached at ") { throw "Currently in detached HEAD state (not on a branch!), so nothing to pull" }
|
if ("$result" -match "HEAD detached at ") { throw "Nothing to pull due to detached HEAD state (not on a branch!)" }
|
||||||
$pathToRepoName = (Get-Item "$pathToRepo").Name
|
$pathToRepoName = (Get-Item "$pathToRepo").Name
|
||||||
|
|
||||||
Write-Host "⏳ (3/4) Pulling remote updates..."
|
Write-Host "⏳ (3/4) Pulling remote updates..."
|
||||||
@ -42,7 +42,7 @@ try {
|
|||||||
if ($lastExitCode -ne "0") { throw "'git submodule update' failed with exit code $lastExitCode" }
|
if ($lastExitCode -ne "0") { throw "'git submodule update' failed with exit code $lastExitCode" }
|
||||||
|
|
||||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ Pulled updates into 📂$pathToRepoName repository in $elapsed sec."
|
"✔️ Pulled remote updates into 📂$pathToRepoName repo in $($elapsed)s."
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user