Skip to content

Instantly share code, notes, and snippets.

cheapie@tim:~$ wget http://craig/Archive/OSes/Linux/ubuntu-15.04-desktop-amd64.iso
--2016-09-21 13:12:49-- http://craig/Archive/OSes/Linux/ubuntu-15.04-desktop-amd64.iso
Resolving craig (craig)... fd00:dead:beef::1, 10.0.0.2
Connecting to craig (craig)|fd00:dead:beef::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1150844928 (1.1G) [application/x-iso9660-image]
Saving to: 'ubuntu-15.04-desktop-amd64.iso'
ubuntu-15.04-desktop-amd64.iso 100%[==================================================================================================================================================================>] 1.07G 109MB/s in 10s
@cheapie
cheapie / signdamage
Created March 7, 2017 17:59
Letter to the Iowa DOT
I'm not sure how many of these are maintained by you, but these are the signs I saw damaged after last night's storm in the Davenport/Walcott area on I-80:
* "MINIMUM 40" sign missing from pole west of exit 295 (Brady Street), westbound side. The pole is still standing.
* "SPEED LIMIT 65" sign missing from pole west of exit 292 (Northwest Blvd.), westbound side. The pole is still standing.
* Both poles broken that were holding some kind of informational sign west of exit 292, eastbound side (directly across from the previous item). The sign is on the ground, folded over backwards.
* Two poles broken that were holding "SPEED LIMIT 70 MINIMUM 40" sign assemblies west of exit 290 (to I-280), westbound side. There is now no signage for this speed limit change. The signs are on the ground nearby.
* Unknown sign missing from poles east of exit 290 (Walcott), eastbound side. I can't remember what sign was there.
* Advisory speed limit sign ("EXIT 45 MPH") sign bent at an angle on the westbound offramp at exit 290.
This intersection has been like this for a few years. The detector loops for the 53rd Street left turn lanes are located about 3 cars back from the stop bar. In a normal program, that would mean that the green turn arrow would only come up if there were 3 or more cars waiting in the turn lane. Due to the heavy amount of trucks and other industrial vehicles turning left there to go south on Tremont, we changed the loop from presence (where a car had to be on the loop to activate it) to locking (a car passing over the loop activated it). This results in the arrow coming on for just one vehicle. The negative side of doing this is if a car goes over the loop after the arrow is off, the controller has locked the call in and thinks there is someone waiting to turn left. If that driver turns left before Tremont gets a green and nobody comes into the left turn lane before the green goes back to 53rd, then the arrow comes on for nobody. I am seriously considering changing this back to 3rd car back detection bec
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local thismod = {}
_G[modname] = thismod
local singleplayer = minetest.is_singleplayer() -- Caching is OK since you can't open a game to
-- multiplayer unless you restart it.
if not minetest.setting_get(modname .. '.enable_singleplayer') and singleplayer then
core.log('action', modname .. ": Not adding auth handler because of singleplayer game")
@cheapie
cheapie / new
Created March 11, 2017 06:49
Technic clear_networks()
local function clear_networks(pos)
local node = minetest.get_node(pos)
local meta = minetest.get_meta(pos)
local placed = node.name ~= "air"
local positions = check_connections(pos)
if #positions < 1 then return end
local dead_end = #positions == 1
for _,connected_pos in pairs(positions) do
local net = technic.cables[minetest.hash_node_position(connected_pos)]
if net and technic.networks[net] then
2017-03-15 18:13:22: ERROR[Server]: Failed to parse json data * Line 1, Column 1
2017-03-15 18:13:22: ERROR[Server]: Syntax error: value, object or array expected.
2017-03-15 18:13:22: ERROR[Server]: data: ""
2017-03-15 18:13:22: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback item_OnPlace(): ....minetest/games/minetest_game/mods/default/functions.lua:565: attempt to index a nil value
2017-03-15 18:13:22: ERROR[Main]: stack traceback:
2017-03-15 18:13:22: ERROR[Main]: ....minetest/games/minetest_game/mods/default/functions.lua:565: in function 'can_interact_with_node'
2017-03-15 18:13:22: ERROR[Main]: ...pie/.minetest/games/minetest_game/mods/default/nodes.lua:1791: in function 'on_rightclick'
2017-03-15 18:13:22: ERROR[Main]: ...pie/.minetest/games/minetest_game/mods/default/tools.lua:435: in function <...pie/.minetest/games/minetest_game/mods/default/tools.lua:429>
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.9.0-2-amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor: QUANTUM
Product: QM39100TD-SW
Revision: N1B0
User Capacity: 9,105,023,488 bytes [9.10 GB]
Logical block size: 512 bytes
Rotation Rate: 7200 rpm
/lua local node = minetest.get_node({x=-159,y=5,z=790});local meta = minetest.get_meta({x=-159,y=5,z=790});if node.name == "technic:concrete" and meta:get_int("locked") ~= 1 then meta:set_int("locked",1);digiline:receptor_send({x=-154,y=18,z=781}, digiline.rules.default, "lcd", "Span | Opening");digiline:receptor_send({x=-155,y=11,z=753}, digiline.rules.default, "light", "YELLOW");digiline:receptor_send({x=-157,y=11,z=810}, digiline.rules.default, "light", "YELLOW");minetest.after(3,function() digiline:receptor_send({x=-155,y=11,z=753}, digiline.rules.default, "light", "RED");digiline:receptor_send({x=-157,y=11,z=810}, digiline.rules.default, "light", "RED") end);minetest.after(6,function() digiline:receptor_send({x=-155,y=11,z=753},digiline.rules.default, "gate", "down");digiline:receptor_send({x=-157,y=11,z=810},digiline.rules.default, "gate", "down") end);minetest.after(10,function(meta) meta:set_int("locked",0);digiline:receptor_send({x=-154,y=18,z=781}, digiline.rules.default, "lcd", "Span | Open");for x
cheapie@tim:~$ lua
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
> print(string.match("<singleplayer> test","^<(%g*)> (.*)$"))
nil
>
cheapie@tim:~$ luajit
LuaJIT 2.0.4 -- Copyright (C) 2005-2015 Mike Pall. http://luajit.org/
JIT: ON CMOV SSE2 SSE3 SSE4.1 AMD fold cse dce fwd dse narrow loop abc sink fuse
> print(string.match("<singleplayer> test","^<(%g*)> (.*)$"))
singleplayer test
###############################################################################################################
##### ProFi, a lua profiler. This profile was generated on: Fri Apr 7 02:38:08 2017
##### ProFi is created by Luke Perkin 2012 under the MIT Licence, www.locofilm.co.uk
##### Version 1.3. Get the most recent version at this gist: https://gist.github.com/2838755
###############################################################################################################
| TOTAL TIME = 84.511329
| FILE : FUNCTION : LINE : TIME : RELATIVE : CALLED |
| /usr/local/share/minetest/builtin/game/register.lu: anonymous : 392 : 19.300 : 22.84% : 13 |
| ...ldmods/dreambuilder_modpack/mesecons/actionqueu: execute : 91 : 12.942 : 15.31% : 221 |