Skip to content

Instantly share code, notes, and snippets.

View Brianetta's full-sized avatar

Brian Ronald Brianetta

View GitHub Profile
@Brianetta
Brianetta / leave_teams.sh
Last active November 29, 2019 12:03
Leave all Keybase teams not listed in the file `kbteams.txt`
#!/bin/bash
TEAMS=kbteams.txt
for unwanted_team in $(
keybase team list-memberships | cut -f 1 -d ' ' | tail -n +2 | grep -v -f <(awk '{print "^" $0 "$"}' $TEAMS)
)
do
echo Leaving team $unwanted_team
keybase team leave $unwanted_team
@Brianetta
Brianetta / FixDropPods.ps1
Last active July 10, 2023 18:39
Fix drop pods not showing up in Space Engineers
$ErrorActionPreference = "Stop"
try {
$SaveFolder = ((Get-ChildItem $ENV:APPDATA\SpaceEngineers\Saves | Where-Object -Property Name -NE 1234567891011 | Get-ChildItem -Directory | Out-GridView -PassThru -Title "Please select a save game")[0]).FullName
[xml]$Sandbox = Get-Content "$SaveFolder\Sandbox.sbc" -Encoding UTF8
$BackupName="Sandbox_Backup_$(Get-Date -Format "yyyy-MM-dd_hh-mm-ss").sbc"
Write-Host "Fixing container in saved game: $($Sandbox.MyObjectBuilder_Checkpoint.SessionName)"
Write-Host "Renaming current Sandbox.sbc file to Sandbox_Backup_$(Get-Date -Format "yyyy-MM-dd_hh:mm:ss").sbc"
Rename-Item "$SaveFolder\Sandbox.sbc" "$SaveFolder\$BackupName"
$Sandbox.MyObjectBuilder_Checkpoint.SessionComponents.MyObjectBuilder_SessionComponent.PlayerData.PlayerContainerData | ForEach-Object -Process {$_.Active="true"}
$Sandbox.Save("$SaveFolder\Sandbox.sbc")
@Brianetta
Brianetta / mkd2_rider_ubuntu.sh
Last active November 26, 2025 15:14
Commands used to get MDK2 runing on Ubuntu 24.04
#!/bin/bash
# NO CHECKING, NO WARRANTY.
# Don't run this blindly, that would be moronic. Check nuget package versions and Steam paths.
# Also, don't check in any of the changes to Git. Malware will glare at you.
# Install Rider and .NET
sudo snap install rider --classic
sudo add-apt-repository ppa:dotnet/backports
sudo apt-get update && sudo apt-get install -y dotnet-sdk-9.0
# I didn't do this, but Mdk.CheckDotNet did look like it would need it. Weird.
@Brianetta
Brianetta / Convert-EconomyShipSales.ps1
Last active June 20, 2026 23:28
Convert the prefab information that define ships for sale in Space Engineers to player-buildable blueprints
param (
[Parameter(ParameterSetName='Preset')][string]$BlueprintFolder,
[Parameter(ParameterSetName='Preset')][ValidateSet('Gray','Red','Green','Blue','Yellow','DarkWhite','Black',
'LightGray','LightRed','LightGreen','LightBlue','LightYellow','White','LightBlack','Brown',
'Cyan','Magenta','LightCyan','LightMagenta','InternationalOrange')][string]$Color,
[Parameter(ParameterSetName='Preset')][Alias('Ships')][string[]]$Ship
)
$ColorPreset = @{
Gray = '<ColorMaskHSV x="0" y="-0.8" z="0" />';
@Brianetta
Brianetta / Deploy-ToolbarLookup.ps1
Last active June 20, 2026 23:28
Produce HTML analysis of toolbars and event controllers in blueprint
param (
[Parameter()][string]$OutputFolder
)
if ($null -eq $OutputFolder -or $OutputFolder.Length -eq 0) {
$OutputFolder = Join-Path $env:USERPROFILE -ChildPath "SE Blueprint References"
Write-Warning "Using default folder: $OutputFolder"
}
$SteamPath = Get-ItemProperty HKCU:\Software\Valve\Steam | Select-Object -ExpandProperty SteamPath