Skip to content

Instantly share code, notes, and snippets.

View Brianetta's full-sized avatar

Brian Ronald Brianetta

  • North East England
View GitHub Profile
@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 / 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 / blk2usb.sh
Created September 18, 2019 02:56
bash script to give USB device information from a node in /dev
#!/bin/bash
# Brian Ronald, 2019
# Tested in Ubuntu 18.04
# Free for all purposes, no warranty at all.
if [ $# -eq 0 ]
then
echo "Usage: $0 <block device node>"
echo "Show the USB device associated with a block device"
exit
@Brianetta
Brianetta / essentials_world_extractor.py
Last active February 9, 2018 23:58
Script for separating worlds in Bukkit Essentials
import os
import yaml
import sys
def worldprefix(world,worldname):
if worldname.startswith(world + "_") or worldname == world:
return True
else:
return False
if len(sys.argv) == 1:

Keybase proof

I hereby claim:

  • I am Brianetta on github.
  • I am brianetta (https://keybase.io/brianetta) on keybase.
  • I have a public key whose fingerprint is FA3D CA2F 38D3 BA69 87E1 D52E C204 FB5C 430A 0BFA

To claim this, I am signing this object:

@Brianetta
Brianetta / command_gen.py
Created December 8, 2014 18:08
Command block command generator for Minecraft vanilla server
# Generator for Minecraft commandblock commands
# List of hostile mobs
hostileMobs=["Zombie","Skeleton","Creeper","Spider","Endermite","Witch","Enderman","Silverfish"]
# Text for when a player sets their spawn point
spawnPointSet='{"text":"","extra":[{"text":"Spawn point set","color":"green"}]}'
# Welcome text
welcomeText='{"text":"Welcome to Brianetta\'s test server","color":"green"}'
@Brianetta
Brianetta / rewrite.pl
Last active December 30, 2015 21:29 — forked from anonymous/rewrite.pl
#!/usr/bin/perl
# Place this file somewhere that Squid can find it, and change access
# so that Squid can read and execute it.
# Include the following line in squid.conf, and un-comment it there. If
# you saved it anywhere other than /etc/squid, change the path to its
# correct location:
#url_rewrite_program /etc/squid/rewrite.pl
@Brianetta
Brianetta / cheatMission.lua
Created November 3, 2012 18:45
New UI cheat menu
local ui = Engine.ui
local CheatList = ui:VBox()
local cheatMission = function (loaded)
local cheats = {
{'Add cash', function () Game.player:AddMoney(100000) end},
{'Refuel (prop tank)', function () Game.player:SetFuelPercent() end},
@Brianetta
Brianetta / power_use_in_ships.md
Created April 3, 2012 23:38
Power use in ships (Pioneer)
@Brianetta
Brianetta / flip_x.tcl
Created March 17, 2012 18:43
Flip Y on the local/bright stars
set fp [open "data/systems/02_local_stars.lua" r]
#set fp [open "data/systems/03_bright_stars.lua" r]
set file_data [read $fp]
close $fp
set localsystems [split $file_data "\n"]
foreach systemdef $localsystems {
if {[lindex [split $systemdef ":"] 0] == "CustomSystem"} {
set parts_1 [split $systemdef ":"]
set parts_2 [split [lindex $parts_1 2] "("]