Skip to content

Instantly share code, notes, and snippets.

@Montandalar
Montandalar / mt_nosetpassword.lua
Last active April 5, 2024 12:27
Delete the setpassword command for minetest
minetest.unregister_chatcommand("setpassword")
@Montandalar
Montandalar / contentdb_light.userstyle.css
Last active March 4, 2024 07:14
Light theme userstyle for Minetest ContentDB
@charset "UTF-8";
/*!
* Bootswatch v5.3.2 (https://bootswatch.com)
* Theme: flatly
* Copyright 2012-2023 Thomas Park
* Licensed under MIT
* Based on Bootstrap
*/
/*!
* Bootstrap v5.3.2 (https://getbootstrap.com/)
@Montandalar
Montandalar / launch_server1.sh
Created November 28, 2023 03:28
Very rudimentary launcher for multiple shell scripts to keep Minetest servers running
while true; do
minetest --server --config ~/.minetest/1.conf --world ~/.minetest/worlds/world1 --port 30000
sleep 1
done;
# Remove any dependencies from a deb file
# Mostly useful for installing foreign packages. Use at own risk; without
# dependencies your package may break easily.
if [ -z "$1" ]; then
echo "No argument given"
exit 1
fi
debfile="$1"
if [ ! -f "$debfile" ]; then
echo "No such file: $debfile"
@Montandalar
Montandalar / randomcowsay.sh
Last active October 5, 2021 06:52
Create random modern art with fortune and cowsay
#!/bin/sh
cows=$(ls /usr/share/cowsay/cows)
nCows=$(ls -1 /usr/share/cowsay/cows/ | wc -l)
x=$(head -c1 /dev/random | hexdump -e '"%d"')
nChoice=$((($x*$nCows)/255))
choice=$(ls -1 /usr/share/cowsay/cows/ | sed -n ${nChoice}s/.\cow$//p)
fortune | cowsay -f $choice
local BLOCK_SIZE = 4096
-- Internal: Open the file or die
-- External users should catch the error if they wish
local function openordie(filename, mode)
handle, err = io.open(filename, mode)
if err then
error(err)
end
return handle