|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
|
| $castFile = Join-Path $PSScriptRoot "..\avr_cold_boot_$timestamp.cast"
|
| $logFile = Join-Path $PSScriptRoot "..\avr_cold_boot_$timestamp.log"
|
| $script = Join-Path $PSScriptRoot "avr_cold_boot_demo.py"
|
|
|
|
|
| $castFile = [System.IO.Path]::GetFullPath($castFile)
|
| $logFile = [System.IO.Path]::GetFullPath($logFile)
|
| $script = [System.IO.Path]::GetFullPath($script)
|
|
|
| Write-Host ""
|
| Write-Host " ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" -ForegroundColor Cyan
|
| Write-Host " β SOV-KERNEL-MONSTER Β· AVR Cold Boot Recorder β" -ForegroundColor Cyan
|
| Write-Host " ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" -ForegroundColor Cyan
|
| Write-Host ""
|
| Write-Host " Recording to:" -ForegroundColor Yellow
|
| Write-Host " $castFile" -ForegroundColor White
|
| Write-Host " $logFile" -ForegroundColor White
|
| Write-Host ""
|
| Write-Host " Press ENTER to start recording..." -ForegroundColor Green
|
| $null = Read-Host
|
|
|
|
|
|
|
|
|
| $header = @{
|
| version = 2
|
| width = 180
|
| height = 50
|
| timestamp = [int][double]::Parse((Get-Date -UFormat %s))
|
| title = "SOV-KERNEL-MONSTER AVR Cold Boot β Ahmad Ali Parr 2026"
|
| env = @{ TERM = "xterm-256color"; SHELL = "pwsh" }
|
| } | ConvertTo-Json -Compress
|
|
|
|
|
| $startTime = [System.Diagnostics.Stopwatch]::StartNew()
|
| $events = [System.Collections.Generic.List[string]]::new()
|
|
|
|
|
| $psi = New-Object System.Diagnostics.ProcessStartInfo
|
| $psi.FileName = "python"
|
| $psi.Arguments = "`"$script`""
|
| $psi.RedirectStandardOutput = $true
|
| $psi.RedirectStandardError = $true
|
| $psi.UseShellExecute = $false
|
| $psi.StandardOutputEncoding = [System.Text.Encoding]::UTF8
|
|
|
| $proc = New-Object System.Diagnostics.Process
|
| $proc.StartInfo = $psi
|
|
|
|
|
| $logLines = [System.Collections.Generic.List[string]]::new()
|
|
|
| $outputHandler = {
|
| param($sender, $e)
|
| if ($null -ne $e.Data) {
|
| $elapsed = $startTime.Elapsed.TotalSeconds
|
| $line = $e.Data + "`n"
|
|
|
| $ev = "[{0:F6}, `"o`", {1}]" -f $elapsed, ($line | ConvertTo-Json -Compress)
|
| $events.Add($ev)
|
| $logLines.Add($e.Data)
|
| Write-Host $e.Data
|
| }
|
| }
|
|
|
| $proc.add_OutputDataReceived($outputHandler)
|
| $proc.Start() | Out-Null
|
| $proc.BeginOutputReadLine()
|
| $proc.WaitForExit()
|
|
|
| $startTime.Stop()
|
|
|
|
|
| $castLines = [System.Collections.Generic.List[string]]::new()
|
| $castLines.Add($header)
|
| foreach ($ev in $events) { $castLines.Add($ev) }
|
| [System.IO.File]::WriteAllLines($castFile, $castLines, [System.Text.Encoding]::UTF8)
|
|
|
|
|
| [System.IO.File]::WriteAllLines($logFile, $logLines, [System.Text.Encoding]::UTF8)
|
|
|
| Write-Host ""
|
| Write-Host " ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" -ForegroundColor Green
|
| Write-Host " β RECORDING COMPLETE β" -ForegroundColor Green
|
| Write-Host " ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" -ForegroundColor Green
|
| Write-Host ""
|
| Write-Host " .cast : $castFile" -ForegroundColor Cyan
|
| Write-Host " .log : $logFile" -ForegroundColor Cyan
|
| Write-Host ""
|
| Write-Host " To replay (if asciinema installed):" -ForegroundColor Yellow
|
| Write-Host " asciinema play `"$castFile`"" -ForegroundColor White
|
| Write-Host ""
|
| Write-Host " To share: upload .cast to https://asciinema.org/docs/self-hosting" -ForegroundColor DIM
|
| Write-Host ""
|
|
|