Skip to content

Instantly share code, notes, and snippets.

View paulwarwicker's full-sized avatar

Paul Warwicker paulwarwicker

  • Cambridge UK
  • 09:58 (UTC +01:00)
View GitHub Profile
@paulwarwicker
paulwarwicker / gist:98a9095bd0915d0ea6f6322f72b13689
Created January 25, 2026 16:02
Secure password definition in Powershell
$securePass = Read-Host -AsSecureString -Prompt "Enter sudo password"
$securePass | .\script.ps1
[CmdletBinding()]
param(
[Parameter(ValueFromPipeline = $true)]
[System.Security.SecureString]$PipedPassword
@paulwarwicker
paulwarwicker / gist:6b003804b07059f6c97e380b20e87285
Created January 25, 2026 14:43
Display non-ascii characters in filenames
(Get-ChildItem -Force $pwd).name |
ForEach-Object {
$chars = $_.ToCharArray() | ForEach-Object { [int]$_ }
"'$_' → $($chars -join ',')"
}
@paulwarwicker
paulwarwicker / gist:5911cbb46bcd389f47b61d37717de7b4
Created January 25, 2026 13:10
List all WSL ext4.VHDX files
Get-ChildItem "$env:LOCALAPPDATA\Packages" -Recurse -Filter ext4.vhdx -ErrorAction SilentlyContinue | Select-Object FullName
@paulwarwicker
paulwarwicker / readme.md
Created November 12, 2018 10:54 — forked from maxivak/readme.md
Chef. How to run scripts (recipes)

Run Chef scripts locally

There are several options to run recipes:

  • using chef-client with -z option
  • using chef-apply
  • using chef-solo

Before running Chef recipes on the machine, it should be prepared:

@paulwarwicker
paulwarwicker / gist:283f8883f79c60221c100fe0cad65ea8
Created July 4, 2018 18:03
Delete all failed builds in Jenkins
// Run from Jenkins Script Console
Jenkins.instance.getAllItems().each { it.builds.findAll { it.result == Result.FAILURE}.each { println(it); it.delete() } }