- Originally adapteed from Scott Hanselman's excellent guide.
- Updated in 2021-08 for oh-my-posh v3.
- Uses a theme based on Paradox theme
- Short folder names, special icons for Registry, Home, etc
- Different prompt icon when running as admin
- Shows last exit code
- Timing info for long-running commands
- Git status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Sign .exe files using signtool.exe. | |
(c) 2014 Greg MacLellan, Licensed under MIT http://opensource.org/licenses/MIT | |
Features: | |
* Hides password from being displayed in build output | |
* Retries against multiple timestamp servers if the server returns an invalid response (fairly common) | |
Usage: |
This is an ESPHome configuration for an ESP32 that monitors a sump pump pit, using the ESP32 capacitive touch sensors, with a level being reported to Home Assistant.
The ESP32 is mounted on a piece of PVC pipe, with wires extending down to different lengths. I used a length of old ethernet cable I had sitting around.
There's also a wire at the bottom connected to the ground pin, and this gives more reliable touch sensor values. The USB32 is powered from USB.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESPAsyncWebServer.h> | |
#include <AsyncElegantOTA.h> | |
// Port to listen on | |
#define WEBSERVER_PORT 80 | |
AsyncWebServer server(WEBSERVER_PORT); | |
void initWiFi() { | |
WiFi.mode(WIFI_STA); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MyExtensions | |
{ | |
// Write custom extension methods here. They will be available to all queries. | |
/// <summary>Dump a string using wrapping</summary> | |
public static string DumpWrapped(this string value, string title = null, int width = 120) | |
{ | |
string.Join("\n", value.Select((x, i) => i) | |
.Where(i => i % width == 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cleanups up the .nuget\packages directory | |
# * Keeps anything added within 120 days | |
# * Keeps the most recently used of every package | |
$maxAge = (Get-Date).AddDays(-120); | |
$deleted = 0; | |
$deletedMb = 0; | |
Get-ChildItem -Directory -Path ([IO.Path]::Combine($HOME, ".nuget", "packages")) | ForEach-Object { | |
Get-ChildItem -Directory -Path $_.Fullname | Sort-Object -Property LastWriteTime -Descending | ForEach-Object {$i=0} { | |
$sizeMb = [Math]::Round((Get-ChildItem -Path $_.FullName -Recurse | Measure-Object -Sum Length).Sum / 1MB, 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sampleTime = 2; # timespan to use for CPU% | |
$cmds = @{}; Get-CimInstance Win32_Process | %{ $cmds[$_.ProcessId.ToString()] = $_.CommandLine; }; | |
$cpu1 = @{}; Get-Process | %{ $cpu1[$_.Id.ToString()] = $_.CPU } | |
start-sleep -seconds $sampleTime | |
Get-Process | select ` | |
Id, ` | |
Name, ` | |
@{Name="CPU";Expression={ (($_.CPU-$cpu1[$_.Id.ToString()]) / $sampleTime / [System.Environment]::ProcessorCount / 100) }}, ` | |
WorkingSet64, ` | |
@{Name="CommandLine";Expression={$cmds[$_.Id.ToString()]}} ` |
- Powershell 7
- Windows Terminal
- Rename computer:
Rename-Computer -NewName "Server044" -Restart
- Scoop
scoop install sudo
- Run Reclaim windows 10 script
- More Scoop apps:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
screen mode id:i:2 | |
span monitors:i:1 | |
use multimon:i:1 | |
selectedmonitors:s:1,2 | |
pinconnectionbar:i:0 |
NewerOlder