Download the youtube-dl binary:
wget -q https://github.com/rg3/youtube-dl/releases/download/2017.10.20/youtube-dl
chmod +x youtube-dl
./youtube-dl --versionDownload the playlist metadata, prefering audio:
| # converts/escapes a string to a command line argument. | |
| function ConvertTo-CommandLineArgument { | |
| # Normally, an Windows application (.NET applications too) parses | |
| # their command line using the CommandLineToArgvW function. Which has | |
| # some peculiar rules. | |
| # See http://msdn.microsoft.com/en-us/library/bb776391(VS.85).aspx | |
| # | |
| # TODO how about backslashes? there seems to be a weird interaction | |
| # between backslahses and double quotes... | |
| process { |
| # dump all the windows trusted roots into a ca file. | |
| $pems = New-Object System.Text.StringBuilder | |
| Get-ChildItem Cert:\LocalMachine\Root | ForEach-Object { | |
| # $_ is-a System.Security.Cryptography.X509Certificates.X509Certificate2 | |
| Write-Host "Exporting the $($_.Issuer) certificate..." | |
| [void]$pems.AppendLine('-----BEGIN CERTIFICATE-----') | |
| [void]$pems.AppendLine( | |
| [Convert]::ToBase64String( | |
| $_.Export('Cert'), | |
| 'InsertLineBreaks')); |
Download the youtube-dl binary:
wget -q https://github.com/rg3/youtube-dl/releases/download/2017.10.20/youtube-dl
chmod +x youtube-dl
./youtube-dl --versionDownload the playlist metadata, prefering audio:
| Set-StrictMode -Version Latest | |
| $ErrorActionPreference = 'Stop' | |
| trap { | |
| Write-Output "ERROR: $_" | |
| Write-Output (($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1') | |
| Write-Output (($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1') | |
| Exit 1 | |
| } | |
| Add-Type @' |
| # whoami for Nano Server. | |
| Set-StrictMode -Version Latest | |
| $ErrorActionPreference = 'Stop' | |
| trap { | |
| Write-Output "ERROR: $_" | |
| Write-Output (($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1') | |
| Write-Output (($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1') |
| Set-StrictMode -Version Latest | |
| $ErrorActionPreference = 'Stop' | |
| trap { | |
| Write-Output "ERROR: $_" | |
| Write-Output (($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1') | |
| Exit 1 | |
| } |
| # | |
| # install git. | |
| apt-get install -y git-core | |
| # | |
| # install the Android Sdk. |
| choco install -y notepadplusplus.install | |
| # replace notepad with notepad++. | |
| # see http://sbs.seandaniel.com/2009/03/replacing-windows-applications-safe-way.html | |
| [IO.File]::WriteAllText( | |
| 'C:\Program Files\Notepad++\launch.js', | |
| @' | |
| var cmd = '"C:\\Program Files\\Notepad++\\notepad++.exe"'; | |
| for (var n = 1; n < WSH.Arguments.Length; ++n) { | |
| cmd += ' "' + WSH.Arguments.Item(n) + '"'; // TODO do proper escaping. |
| #!/bin/bash | |
| # see http://www.syslinux.org/wiki/index.php?title=Filesystem | |
| # see https://wiki.archlinux.org/index.php/syslinux | |
| # NB on Arch Linux install with pacman -S dosfstools. | |
| set -eux | |
| disk_file=disk.img | |
| disk_device=/dev/nbd0 | |
| disk_partition_device=/dev/nbd0p1 |
| # exclude the VirtualBox network interfaces from the Windows Firewall. | |
| Set-NetFirewallProfile -DisabledInterfaceAliases (Get-NetAdapter ` | |
| | Where-Object {$_.Virtual} ` | |
| | Where-Object {$_.DriverFileName -like 'VBox*.sys'} ` | |
| | ForEach-Object { $_.InterfaceAlias }) |