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 / installkernel
Created July 13, 2012 18:43
installkernel - preserve vmlinuz-
#!/bin/bash
. /etc/lunar/config
preserve()
{
if [ -f $1 ] ; then
mv -f $1 $1.old
fi
}
[Unit]
Description=dhcpd
After=network.target
[Service]
ExecStart=/usr/sbin/dhcpd -q eth0 -f
Restart=always
RestartSec=60
[Install]
@sofar
sofar / gist:4709791
Created February 4, 2013 21:16
fix systemd build?
diff --git a/Makefile.am b/Makefile.am
index f3ab908..08d773d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1846,7 +1846,8 @@ libudev_la_LDFLAGS = \
-Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
libudev_la_LIBADD = \
- libsystemd-shared.la
+ libsystemd-shared.la \
try {
TownyWorld tw = TownyUniverse.getWorld(world.getName());
TownBlock tb = tw.getTownBlock(new Coord(xx, zz));
if (tb.hasTown())
return true;
} catch (NotRegisteredException e) {
e.printStackTrace();
}
List<String> StringList = getConfig().getStringList("list");
StringList.add("stringvalue");
getConfig().set("list", StringList);
saveConfig();
Kerbal Space Program - 0.90.0.0 (LinuxPlayer) Steam BETA
OS: Linux 3.6 Lunar Linux 1.6.5-nubs-alpha 32bit
CPU: Intel(R) Core(TM) i7 CPU X 990 @ 3.47GHz (12)
RAM: 5994
GPU: GeForce 9800 GT/PCIe/SSE2 (1024MB)
SM: 30 (OpenGL 3.3 [3.3.0 NVIDIA 304.60])
RT Formats: ARGB32, Depth, ARGBHalf, RGB565, ARGB4444, ARGB1555, Default, DefaultHDR, ARGBFloat, RGFloat, RGHalf, RFloat, RHalf, R8
@sofar
sofar / gist:255eda1a109ec3ed4911
Created January 5, 2015 23:47
KSP autosave your persistent.sfs into a git tree
#!/bin/sh
# how to use:
#
# - packages required: inotify-tools, git
# - change SAVENAME into the name of your savegame (folder name)
# - cd into your savegame folder, and execute:
# git init
# git add * */* */*/*
# git commit -a --message "Initial Checkin."
@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
@sofar
sofar / init.lua
Created June 21, 2015 21:21
estimate size of _G table elements in minetest
local s = ""
local function dd(ss)
s = s .. ss
end
-- alt version2, handles cycles, functions, booleans, etc
-- - abuse to http://richard.warburton.it
-- output almost identical to print(table.show(t)) below.
function print_r (t, name, indent)
diff --git a/src/mods.cpp b/src/mods.cpp
index f5174ac..a8874fa 100644
--- a/src/mods.cpp
+++ b/src/mods.cpp
@@ -85,15 +85,12 @@ void parseModContents(ModSpec &spec)
}
}
-std::map<std::string, ModSpec> getModsInPath(std::string path, bool part_of_modpack, const std::string &worldpath)
+std::map<std::string, ModSpec> getModsInPath(std::string path, bool part_of_modpack, const Settings &worldmt_settings)