PANTONE 19-4052 Classic Blue: Instilling calm, confidence, and connection, this enduring blue hue highlights our desire for a dependable and stable foundation on which to build as we cross the threshold into a new era. 💡
Category: разно|всячина
misc
Powershell 3.0: Save posters from TMDb
очень простой листинг для сохранения постеров (на входе — имя файла, скачивание через Invoke-WebRequest, нужен api_key)
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,Position=0,ValueFromPipeline=$true,HelpMessage="Provide a full path to movie files")] | |
[alias("p")] | |
[ValidateScript({ $_.Replace("[", "“[").Replace("]", "“]"); Test-Path -Path $_ -PathType 'Container'})] | |
[System.String]$path, | |
[Parameter(Position=1,ValueFromPipeline=$true)] | |
[alias("api")] | |
[int]$apikey = "098f6bcd4621d373cade4e832627b4f6" # Get your own! https://developers.themoviedb.org/3/getting-started/authentication | |
) | |
Add-Type -AssemblyName System.Web | |
Get-ChildItem -Path $path -Force | ?{!$_.PSIsContainer -and $_.Name -match "\.(avi|mkv|mp4|xvid)$"} | Select -First 10 | %{ | |
$dir = $_.Directory.Fullname | |
$imdburi = "https://api.themoviedb.org/3/search/movie?query={0}&language=ru-RU&api_key={1}" -f [System.Web.HttpUtility]::UrlEncode([System.IO.Path]::GetFileNameWithoutExtension($_.Name)), $apikey | |
$movie = Invoke-WebRequest -Uri $imdburi | |
(ConvertFrom-Json $movie.Content).results | Select -First 1 | %{ | |
#$r = Invoke-WebRequest -Uri ("https://api.themoviedb.org/3/movie/{0}/images?api_key={1}" -f $_.id, $apikey) | |
#$images = (ConvertFrom-Json $r).backdrops | |
$filename = "{0} – {1} ({2}){3}" -f $_.original_title, $_.title, ([datetime]::Parse($_.release_date)).Year, [System.IO.Path]::GetExtension($_.poster_path) | |
$filename = $filename -replace ":",' – ' -replace ' {2}', ' ' | |
$filename = ([char[]]$filename | ?{[IO.Path]::GetinvalidFileNameChars() -notcontains $_ }) -join '' | |
Invoke-WebRequest -Uri ("https://image.tmdb.org/t/p/w640"+$_.poster_path) -OutFile "$dir\$filename" | |
} | |
} |
The workaround for VMware Workstation and Hyper-V are not compatible
Решение проблем VMware
VMware Workstation and Hyper-V are not compatible. Remove the Hyper-V role from the system before running VMware Workstation.
в консоли от Administrator + перезагрузка:
bcdedit /set hypervisorlaunchtype off
включить обратно:
bcdedit /set hypervisorlaunchtype auto
Windows 10 does not reconnect to mapped network drives
Netlogon service doesn’t affect.
Solution:
as Startup script:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -NonInteractive -NoLogo -File C:\Users\Vady\Documents\ReconnectNetworkDrivesAtStartup.ps1
Oneliner to Create Task via PowerShell 3.0+ (Grant Elevated Privileges):
$PS1file = '{0}\ReconnectNetworkDrivesAtStartup.ps1' -f [Environment]::GetFolderPath("MyDocuments");Invoke-WebRequest -Uri 'https://gist.github.com/anderssonjohan/8d3f958f29b4ae5c7802/raw' -OutFile $PS1file;Register-ScheduledTask -TaskName 'ReconnectNetworkDrivesAtStartup' -Description 'http://stackoverflow.com/a/29373760' -Trigger (New-ScheduledTaskTrigger -AtLogOn -User "$env:USERDOMAIN\$env:USERNAME") -Action (New-ScheduledTaskAction -Execute "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -Argument "-WindowStyle Hidden -NonInteractive -NoLogo -File $PS1file")
PS. For Win7/8 via app: MapDrive.exe (.NET Framework 2.0)
Strip out the ID3v1 tags from MP3’s (Powershell)
Избавляемся от тегов Id3v1 в mp3:
Search and update lyrics for MP3 Id3v2 tags (Powershell)
Добавляем тексты песен в теги mp3 (парсим wikia.com/metrolyrics.com)
todo: использовать API Wikia, MusixMatch (limit ≤30%)
Adobe Acrobat Fix: Error applying transforms. Verify that the specified transform paths are valid (MSI)
Fix for «Ошибка при применении преобразований. Проверьте правильность путей указанных преобразований» while install/update/uninstall adobe acrobat’s msi:
reg export HKLM\SOFTWARE\Classes\Installer\Products\68AB67CA3301FFFF7706000000000060 "%TEMP%\acrobat.reg"
reg add HKLM\SOFTWARE\Classes\Installer\Products\68AB67CA3301FFFF7706000000000060 /v Transforms /t REG_EXPAND_SZ /d "" /f
© Continue reading Adobe Acrobat Fix: Error applying transforms. Verify that the specified transform paths are valid (MSI)
Decrypting TP-Link’s configuration file (config.bin)
openssl enc -d -des-ecb -nopad -K 478DA50BF9E3D2CF -in config.bin
©Matteo Croce
Remove «Windows 7/8 Reserve your FREE upgrade to Windows 10 now» notification
C:\Windows\System32\wusa.exe /uninstall /kb:3035583 /quiet /norestart /log
C:\Windows\System32\wusa.exe /uninstall /kb:2952664 /quiet /norestart /log
C:\Windows\System32\wusa.exe /uninstall /kb:3021917 /quiet /norestart /log
C:\Windows\System32\wusa.exe /uninstall /kb:2976978 /quiet /log /warnrestart:600
Continue reading Remove «Windows 7/8 Reserve your FREE upgrade to Windows 10 now» notification
Dirty [un]installer of Visual Studio Code
После удаления редактора Code остается в контекстном меню лишнее:
— приходиться удалять руками! Continue reading Dirty [un]installer of Visual Studio Code