Skip to content

Instantly share code, notes, and snippets.

View sofar's full-sized avatar
🤦‍♂️
I'm drowning in the absence of time.

sofar

🤦‍♂️
I'm drowning in the absence of time.
View GitHub Profile
@sofar
sofar / configuration.yaml
Created May 24, 2019 05:46
MOFI450 Homeassistant configuration.yaml sensors
sensor:
- platform: snmp
host: 192.168.10.1
version: 2c
baseoid: .1.3.6.1.2.1.2.2.1.8.8
name: MOFI4500
accept_errors: true
- platform: snmp
host: 192.168.10.1
diff --git a/src/client/sky.cpp b/src/client/sky.cpp
index 0ab7398f2..b19c89618 100644
--- a/src/client/sky.cpp
+++ b/src/client/sky.cpp
@@ -103,9 +103,6 @@ Sky::Sky(s32 id, RenderingEngine *rendering_engine, ITextureSource *tsrc, IShade
m_directional_colored_fog = g_settings->getBool("directional_colored_fog");
- if (g_settings->getBool("enable_dynamic_shadows"))
- m_sky_body_orbit_tilt = g_settings->getFloat("shadow_sky_body_orbit_tilt", -60.0f, 60.0f);
@sofar
sofar / init.lua
Created May 28, 2016 01:10
Track player movement mini mod (Copyright MIT - Auke Kok)
--[[
(C) 2016 Auke Kok <sofar@foo-projects.org>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject
--[[
Timer - a high precision, saveable timer class
Copyright (C) 2017 - Auke Kok <sofar@foo-projects.org
"timer" is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1
@sofar
sofar / gist:41d1e70893f16d457ff1
Created June 21, 2015 20:50
init.lua - dump lua global table with table element size estimate
minetest.register_chatcommand("dump", {
params = "",
description = "Dump all objects in the global table",
func = function()
print("_G has "..#_G.." elements")
for k,v in pairs(_G) do
if k~="_G" then
if type(v)=="string" or type(v)=="number" then
print("G["..k.."]="..v)
elseif type(v)=="table" then
From a10fcdc092f1ded2099adb21800914b82798b722 Mon Sep 17 00:00:00 2001
From: Auke Kok <sofar@foo-projects.org>
Date: Mon, 11 Mar 2019 22:06:29 -0700
Subject: [PATCH] Replace .x player model with 5.0.0- compatible b3d model
This fixes the offset. It is a size-optimized version of the
Minetest Game model.
---
mods/default/models/character.b3d | Bin 0 -> 73433 bytes
mods/default/models/character.x | 7457 -----------------------------
@sofar
sofar / gist:2b0601766d9209c56aacad1e418ccdfa
Created February 21, 2018 03:32
swupd search bin/sudo
# swupd search bin/sudo
Searching for 'bin/sudo'
Bundle os-cloudguest (7 Mb)
/usr/bin/sudo
/usr/bin/sudoedit
/usr/bin/sudoreplay
Bundle os-cloudguest-aws (8 Mb)
/usr/bin/sudo
$ time ~/git/mtmapprune/mtmapprune ebl.sqlite -4890 200 7700 -15383 -100 1200
2018/02/11 12:35:53 Collecting blocks
2018/02/11 12:36:39 Deleting blocks
2018/02/11 13:49:03 Vaccuuming database. This can take a long time, please do not interrupt this process
Removed 8419241 of 9721259 blocks (limits: [-15383, -100, 1200]-[-4890, 200, 7700])
real 74m22.140s
user 5m18.357s
sys 2m19.500s
#!/bin/bash
# https://github.com/Ceryn/img
# Call with '-s' to target only a selection of the screen.
clientid='GETYOUROWNCLIENTID'
img=$(mktemp '/tmp/img-XXXXXX.png')
import $img >/dev/null 2>&1 || exit
res=$(curl -sH "Authorization: Client-ID $clientid" -F "image=@$img" "https://api.imgur.com/3/upload")
"lag": 0.024888960644602776
"lag": 0.03364704176783562
"lag": 0.049855031073093414
"lag": 0.04992730915546417
"lag": 0.05001838877797127
"lag": 0.05019672214984894
"lag": 0.05049749091267586
"lag": 0.05049918591976166
"lag": 0.05099736899137497
"lag": 0.05136791989207268