Skip to content

Instantly share code, notes, and snippets.

@ps2goat
ps2goat / wsl.conf
Last active August 9, 2023 18:40
Fix wsl2 dns issues
[boot]
command="printf \"nameserver 1.1.1.1\n$(cat /etc/resolv.conf)\nnameserver 8.8.8.8\nnameserver 1.0.0.1\n\" > /etc/resolv.conf"
# Where does this go?
# In each WSL2 distribution, add this to your `/etc/wsl.conf` file.
#
# What this does:
# Writes 3 nameservers to your WSL2 distribution, and inserts the dynamic nameserver (the WSL2 -> Windows bridge) from
# /etc/resolv.conf at level 2, and re-writes all that to the same /etc/resolv.conf file.
#
@ps2goat
ps2goat / shrink-ws.css
Created December 5, 2020 20:55
Shrink whitespace for printouts
/* place in a the head tag of html
It will remove all ridiculous page break directions, overflows, and inline-block display types, which cause issues.
Then re-applies hiding to elements that need it. could be better but works /shrug
Originally used on a health site's receipt page that was 3 pages long but should have fit on 1 page at 100% scale.
*/
<style type="text/css">
@media print {
* {
page-break-before: avoid!important;
page-break-after: avoid!important;
# uses the aws iam authenticator to generate a token and store the result in a variable,
# then set the result's value into the clipboard for pasting.
# Replace the values in square brackets (including the brackets) with the correct values.
$x = aws-iam-authenticator token -i [your cluster name] -r [your assumed iam role name] | ConvertFrom-Json; Set-Clipboard -Value ($x.status.token)
@ps2goat
ps2goat / gist:bf06ff3592d6752e433292ec257a1fda
Last active October 11, 2018 19:16
PowerShell script to clean up docker images from a list of images. Use `docker image prune` for the built-in functionality.
docker images | Select-String -Pattern ' (?<sha>\b[a-zA-Z0-9]{12})\b ' | foreach {docker rmi --force $_.Matches.Groups[1].Value}