Skip to content

Instantly share code, notes, and snippets.

@Tyderion
Tyderion / init-mounts.sh
Last active December 22, 2015 22:38
Mount disks and then mount the folders for the nfs shares and remount them readonly. Checks if target nfs folder is mounted already.
#!/bin/bash
### BEGIN INIT INFO
# Provides: archiemount
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Should-Start:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Mount my partitions in /var/nfs/ for use in nfs sharing
for i=5,0,-1 do
print("waiting to start... " .. i)
sleep(1)
end
shell.run("order")
local modemside = "right"
local dirt = "dirt"
local registered = false
local master = 0
function checkModem()
if (not rednet.isOpen(modemside)) then rednet.open(modemside) end
end
@Tyderion
Tyderion / order.lua
Last active December 21, 2015 11:19
rednet.open("back")
local master = 0
term.clear()
local commandkeys = {
keys.leftCtrl,
keys.rightControl,
keys.leftShift,
keys.rightShift,
keys.leftAlt,
keys.rightAlt
@Tyderion
Tyderion / slave.lua
Last active December 21, 2015 11:19
rednet.open("top")
config = {
}
registered = false
master = 0
pulseLengthInSec ={
["stack"] = 1.65,
["single-redstone"] = 6
}
rednet.open("right")
slaves = {}
rednet.broadcast("newmaster")
function dbjson(thing)
print(json.encodePretty(thing))
end
function compileResourceList()
@Tyderion
Tyderion / relay.lua
Last active December 21, 2015 11:18
modemside = "right"
master = 0
function checkModem()
if (not rednet.isOpen(modemside)) then rednet.open(modemside) end
end
function detectMaster()
checkModem()
print("looking for master")
if (master > 0 ) then return end
@Tyderion
Tyderion / cpm.lua
Last active December 21, 2015 10:59
Computercraf package Manager
-- Main Program taken from Computercraft mod
local upload_argument_name = "publish"
local install_argument_name = "install"
local update_argument_name = "update"
local list_argument_name = "list"
local program_name = fs.getName(shell.getRunningProgram()) -- "cpm"
local saveFileName = "listOfPrograms"
@Tyderion
Tyderion / Direction.lua
Created August 7, 2013 09:16
Directions for turtlebot within minecraft.
-- Directions
local Direction = {}
Direction.left = "left"
Direction.right = "right"
Direction.forward = "forward"
Direction.back = "back"
Direction.up = "up"
Direction.down = "down"
Direction.isValid = function(direction)
local dir = string.lower(direction)