this gist is part of this series
This fixes issues i bugged with the thunderbolt / thunderbolt-net maintainers (i will take everyones thanks now, lol)
- install lldpctl with
apt install lldpd
this gist is part of this series
This fixes issues i bugged with the thunderbolt / thunderbolt-net maintainers (i will take everyones thanks now, lol)
apt install lldpd
<# | |
.SYNOPSIS | |
Fast conversion of Microsoft Stream VTT subtitle file to SRT format. | |
.DESCRIPTION | |
Uses select-string instead of get-content to improve speed 2 magnitudes. | |
.PARAMETER Path | |
Specifies the path to the VTT text file (mandatory). | |
.PARAMETER OutFile | |
Specifies the path to the output SRT text file (defaults to input file with .srt). | |
.EXAMPLE |
I've been recommending people use NerdFonts in their terminals for a while, but using the extra characters ends up being rather a pain. I have to look up characters in their web cheat-sheet, and then I either end up with a whole bunch of "$([char]0xf1ed)$([char]0xf00d)"
in my profile scripts, which is impossible to read, or I have to translate the hex to decimal so I can type the ALT
codes in my editor...
So today I fixed it, using PANSIES (the PowerShell ANSI Escape Sequences module).
In PANSIES output (i.e. via the Write-Host, or by using New-Text
in a string), you can embed named entities like in html. But unlike HTML, Pansies entities are extensible. So I wrote a little script to re-use the css names for the nerd-font characters and generate entities.
# escape=` | |
ARG fromTag=latest | |
ARG WindowsServerCoreRepo=mcr.microsoft.com/windows/servercore | |
# Use server core as an installer container to extract PowerShell, | |
# As this is a multi-stage build, this stage will eventually be thrown away | |
FROM ${WindowsServerCoreRepo}:${fromTag} AS installer-env | |
ARG PS_VERSION=6.2.0 | |
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/PowerShell-${PS_VERSION}-win-x64.zip |
function Sleep-Progress($seconds) | |
{ | |
<# | |
.SYNOPSIS | |
Function to Start-Sleep with a progress bar | |
.DESCRIPTION | |
Runs the 'Start-Sleep' command using the with a progress bar. Time is passed to the function in seconds as an argument. | |
.NOTES |
Caution
Due to the subject of this Gist there are a lot of spam/scam comments. I try to remove them all as soon as possible. I don't recommend you to click on any link in the comments
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus
[no Search()] nuget.exe list | |
[no Search()] nuget.exe list -allversions | |
[no Search(), no IsAbsoluteLatestVersion] nuget.exe list | |
[no Search(), no IsAbsoluteLatestVersion] nuget.exe list -allversions | |
GET /api/v2/Packages HTTP/1.1 | |
GET /api/v2/Packages?$skip=100 HTTP/1.1 | |
[no Search()] nuget.exe list -allversions -prerelease | |
[no Search(), no IsAbsoluteLatestVersion] nuget.exe list -allversions -prerelease | |
GET /api/v2/Packages()?$orderby=Id&$skip=0&$top=30 HTTP/1.1 |
# It might work in 4, but I'm not testing there. Lower you'll have to tweak code | |
#requires -Version 5.0 | |
param( | |
# Your Live ID for MSDN login | |
[Parameter(Mandatory)] | |
[PSCredential] | |
[System.Management.Automation.CredentialAttribute()] | |
$Credential, | |
# Pick a browser to use. Defaults to Firefox (which doesn't seem to require an external Driver file) |
My preferred code style is 2-space K&R. This is intended to provide a justification for this style.
K&R style has the following properties:
<# | |
.Synopsis | |
Converts a PowerShell object to a Markdown table. | |
.EXAMPLE | |
$data | ConvertTo-Markdown | |
.EXAMPLE | |
ConvertTo-Markdown($data) | |
#> | |
Function ConvertTo-Markdown { | |
[CmdletBinding()] |