Skip to content

Instantly share code, notes, and snippets.

@TomyLobo
TomyLobo / wiremod-logo-adv-dupe.svg
Last active August 29, 2015 14:05
Wiremod SVG Logos
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TomyLobo
TomyLobo / xkcd-1579.graphml
Created September 21, 2015 06:08
XKCD 1579 in yEd format (without the unconnected nodes)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
<!--Created by yFiles for Java 2.9-->
<key for="graphml" id="d0" yfiles.type="resources"/>
<key for="port" id="d1" yfiles.type="portgraphics"/>
<key for="port" id="d2" yfiles.type="portgeometry"/>
<key for="port" id="d3" yfiles.type="portuserdata"/>
<key attr.name="url" attr.type="string" for="node" id="d4"/>
<key attr.name="description" attr.type="string" for="node" id="d5"/>
<key for="node" id="d6" yfiles.type="nodegraphics"/>
@TomyLobo
TomyLobo / patrolturtle.lua
Last active October 4, 2015 13:37
ComputerCraft turtle to patrol a rectangular area delimited by obsidian blocks
shell.run('clear')
print("Please put obsidian in Slot 1 and mark the corners with obsidian.")
print("Go clockwise? (y/N)")
local clockwise = io.read():upper() == "Y"
local obsidian = 1
print("Going "..(clockwise and "clockwise" or "counter-clockwise")..".")
while true do
turtle.select(obsidian)
@TomyLobo
TomyLobo / Gemfile
Last active October 6, 2015 11:56
Puppet catalog to TGF graph format converter
source 'https://rubygems.org'
gem 'tgf', '~> 1.1.0'
@TomyLobo
TomyLobo / functions.lua
Last active December 28, 2015 23:01
Function list for Starbound Server Beta v. Glad Giraffe - Update 3' Revision: 30555b17a491c2a97ab0afbff3b848a1fd937dbd
{
xpcall: <function reg:8>,
jresize: <function reg:8>,
table: {
pack: <function reg:9>,
unpack: <function reg:9>,
sort: <function reg:9>,
concat: <function reg:9>,
move: <function reg:9>,
@TomyLobo
TomyLobo / fix-debian-bug-573482.sh
Last active April 20, 2016 08:23
Workaround for Debian bug #573482
#!/bin/bash
set -e
fixjar=aaafix-debian-bug-573482.jar
pom_xml=org/apache/maven/project/pom-4.0.0.xml
first_component="${pom_xml%%/*}"
cd /usr/share/maven2/lib
@TomyLobo
TomyLobo / functions.lua
Last active May 28, 2016 09:27
HLSW Lua function list
Created using the following code:
local walked = {}
local function rec(prefix, tbl)
if prefix == "package.loaded." or walked[tbl] then return end
walked[tbl] = true
for k, v in pairs(tbl) do
Debug.Print(prefix..k)
if type(v) == 'table' then
rec(prefix..k..'.', v)
end
"GameUI_vote_failed" "Vote Failed."
"GameUI_vote_failed_quorum" "Not enough players voted."
"GameUI_vote_failed_yesno" "Yes votes must exceed No votes."
"GameUI_vote_failed_vote_spam" "You called a vote recently and can not call another for %s1 seconds."
"GameUI_vote_failed_transition_vote" "You cannot call a new vote while other players are still loading."
"GameUI_vote_failed_disabled_issue" "Server has disabled that issue."
"GameUI_vote_failed_map_not_found" "That map does not exist."
"GameUI_vote_failed_map_not_valid" "That map was not found in the server's map cycle."
"GameUI_vote_failed_map_name_required" "You must specify a map name."
"GameUI_vote_failed_recently" "This vote failed recently and can not be called again for %s1 seconds."
@TomyLobo
TomyLobo / build.sh
Last active February 8, 2017 13:18
Script to build tcl/tk on Cygwin without requiring an X server at runtime
#!/bin/bash
# This script downloads and builds tcl/tk and runs a small test case with it to verify that it works without an X server.
# It was tested with 8.6.6 and 8.5.18.
# At its core it's just "cd unix && ./configure --enable-threads --enable-64bit && make"
# I recommend to run this in a separate directory.
#
# Usage: ./build.sh [<version>]
#
# version - The tcl/tk version to use, defaults to 8.6.6.
@TomyLobo
TomyLobo / scan-scsi-hosts.sh
Created January 16, 2018 10:08
How to scan all SCSI hosts
for host in /sys/class/scsi_host/*; do echo "- - -" > "$host"/scan; done