Skip to content

Instantly share code, notes, and snippets.

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
MOFI450 Homeassistant configuration.yaml sensors
View configuration.yaml
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
View gist:32acfe7ed67c99b580ca2aba9dcba45c
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 -----------------------------
View gist:2b0601766d9209c56aacad1e418ccdfa
# 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
View gist:281ba09a8c09b723e491d849f2365e7b
$ 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
View gist:113c9be7256a37ef1d3e2c328ea5b322
#!/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")
View gist:c0a2f83368fccc52aee7b2add031b79f
"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
@sofar
sofar / list-modules-in-org-by-ssh-url.sh
Created Jun 29, 2017
lists git projects in organization by ssh url
View list-modules-in-org-by-ssh-url.sh
#!/bin/bash
ORG="$1"
while true; do
((PAGE++))
URL="https://api.github.com/users/$ORG/repos?per_page=20"
if [ $PAGE -gt 1 ]; then
URL="$URL&page=$PAGE"
fi
View gist:d5536194976103c4e5a8119597420028
diff --git a/src/game.cpp b/src/game.cpp
index daf2eb6b..edf80cfc 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -3999,14 +3999,10 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
*/
if (clouds) {
v3f player_position = player->getPosition();
- if (sky->getCloudsVisible()) {
- clouds->setVisible(true);
@sofar
sofar / pahole.c
Created Apr 21, 2017
all of mt's struct holes
View pahole.c
struct _IO_FILE {
int _flags; /* 0 4 */
/* XXX 4 bytes hole, try to pack */
char * _IO_read_ptr; /* 8 8 */
char * _IO_read_end; /* 16 8 */
char * _IO_read_base; /* 24 8 */
char * _IO_write_base; /* 32 8 */
char * _IO_write_ptr; /* 40 8 */
View gist:84581763b923658bcef7a928fbad0b98
diff --git a/src/map.cpp b/src/map.cpp
index f8bbee18..749cf8bb 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -44,6 +44,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "database.h"
#include "database-dummy.h"
#include "database-sqlite3.h"
+#include "script/serverscripting.h"
#include <deque>