Improve/Repair Scanned Images Using ImageMagick
This is the command:
magick "img-01.tiff" -strip -kuwahara "1.5" -modulate "100,90" -level "6,92%,0.75" -quality 80 "img-01.jpg"-strip- remove any metadata-kuwahara "1.5"- apply smoothing algorithm
This is the command:
magick "img-01.tiff" -strip -kuwahara "1.5" -modulate "100,90" -level "6,92%,0.75" -quality 80 "img-01.jpg"-strip - remove any metadata-kuwahara "1.5" - apply smoothing algorithmLines starting with # mean the commands have to be executed by root user under Linux shell (WSL distro).
All other commands have to be executed under Windows-PowerShell as Administrator.
New-VHD support.vhdx -SizeBytes 25GB -Dynamic -BlockSizeBytes 1MB
Write-Output "\\.\PhysicalDrive$((Mount-VHD -Path support.vhdx -PassThru | Get-Disk).Number)"| import sys | |
| from pathlib import Path | |
| from zipfile import ZipFile, ZIP_DEFLATED, ZIP_STORED | |
| def main(): | |
| usage = f'{sys.argv[0]} source_dir [destination_file]' | |
| if len(sys.argv) > 1: | |
| src = Path(sys.argv[1]) | |
| dst = Path(sys.argv[2]) if len(sys.argv) > 2 else Path(src.name + ".epub") | |
| validate(src, dst) |
| <?php | |
| /* | |
| * Simple directory listing for a web server (lighttpd). | |
| * | |
| * Author: Sebastian Pająk | |
| * Version: 0.0.1 | |
| * License: MIT | |
| * | |
| * Setup: |
Make epub archive using 7zip command line utility in PowerShell.
$source = ".\ebook"
$epub = ".\ebook.epub"
$source = (Resolve-Path $source -ErrorAction Stop).Path
Move-Item "${source}\mimetype" ".mimetype" -ErrorAction Stop
Remove-Item "$epub" -ErrorAction Ignore
& 7za a -mx0 "$epub" ".mimetype"| import sys | |
| from pathlib import Path | |
| import importlib | |
| import runpy | |
| def require(file, name=None): | |
| if name is None: | |
| name = Path(file).stem | |
| anonymous = lambda cls: cls(name, str(Path(__file__).parent / file)) | |
| @anonymous |
| #!/bin/bash | |
| cpu=$(</sys/class/thermal/thermal_zone0/temp) | |
| cpu=$(printf %.1f "${cpu}e-3") | |
| gpu=$(vcgencmd measure_temp) | |
| gpu=${gpu:5:-2} | |
| echo "CPU: ${cpu} °C" | |
| echo "GPU: ${gpu} °C" |
| # Disable random IPv6 addresses (but keep temporary addresses), | |
| # and use SLAAC address as a preferred IPv6 address in Windows 10 | |
| # ------------------------------------------------------------------------------ | |
| # UseTemporaryAddresses | |
| # | |
| # Always. The computer always generates temporary addresses by using random numbers. | |
| # Counter. The computer generates temporary addresses by using the interface identifier. | |
| # You typically use this identifier for test purposes. | |
| # Disabled. The computer does not use temporary addresses. |
| param( | |
| [String] $png | |
| ) | |
| $root = Split-Path "$png" -Parent | |
| $name = Split-Path "$png" -LeafBase | |
| $icon = Join-Path $root ($name + ".ico") | |
| & magick "$png" -strip -background none ` | |
| -gravity center -extent "%[fx:max(w,h)]x%[fx:max(w,h)]" ` |
| [CmdletBinding(DefaultParameterSetName = "Default")] | |
| param( | |
| [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)] | |
| [Alias("i", "Path", "Source")] | |
| [String] $SourceDirectory, | |
| [Parameter(Mandatory=$true, ParameterSetName="DestinationAlongSource")] | |
| [Alias("ds", "os")] | |
| [Switch] $DestinationAlongSource, |