Skip to content

Instantly share code, notes, and snippets.

View Brianetta's full-sized avatar

Brian Ronald Brianetta

View GitHub Profile
@Brianetta
Brianetta / OutOfFuel.lua
Created February 25, 2012 00:56
Replacement fuel warning script
local onShipFuelChanged = function (ship, state)
if ship:IsPlayer() then
Game.player:SetFuelPercent()
else
if state == "EMPTY" then
print(('{label} ({type}) out of fuel'):interp({label=ship.label,type=ship.shipType}))
end
end
end

Sent: Monday, 05 March, 2012 at 9:45 pm by Brianetta

Benamucki wrote:Hi Brian,

by adding a "break" in those loops you no longer get the minimum and therefore fair price, the calculation of "due" is also broken. These features were actually the intention of the script.

@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] "("]
@Brianetta
Brianetta / power_use_in_ships.md
Created April 3, 2012 23:38
Power use in ships (Pioneer)
@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 / 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 / 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"}'

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 / 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:
@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