Skip to content

Instantly share code, notes, and snippets.

@myxal
myxal / 00-grow_fixed.sh
Last active Jan 10, 2022
addon.d scripts to grow /system after installation (choose 1)
View 00-grow_fixed.sh
#!/sbin/sh
#
# /system/addon.d/10-resize-system.sh
#
. /tmp/backuptool.functions
case "$1" in
backup)
# Stub
;;
@myxal
myxal / ip-route-TODO
Last active Mar 7, 2020
IPv6 home gateway firewall rules
View ip-route-TODO
# See https://www.cyberciti.biz/tips/how-do-i-drop-or-block-attackers-ip-with-null-routes.html
# - not everything from there actually works (from and to don't work with blackhole)
# ip route add blackhole ::ffff:0:0/96
@myxal
myxal / host_net_cleanup.sh
Last active Mar 7, 2020
Test 6in4 tunnel within single physical network
View host_net_cleanup.sh
#!/bin/bash
ip -6 route del fc00::/7 dev tun0
ip link del dum0
ip tunnel del tun0
sysctl -w net.ipv6.conf.all.forwarding=0
@myxal
myxal / migrators.lua
Created Mar 4, 2020
Worldmigrators, shard linking, in Don't Starve Together
View migrators.lua
# Here you'll find various code snippets for dealing with world migrators.
# Original source, and more info: https://forums.kleientertainment.com/forums/topic/59174-understanding-shards-and-migration-portals/
1) Join a server
(We are in master now, shard_id is 1)
2) c_spawn("cave_entrance")
(Cave entrance will be id 11, automatically, since there were 10 cave entrances by default on generation)
3) Stand near the entrance, as c_find picks the closest thing
4) c_find("cave_entrance_open").components.worldmigrator:SetDestinationWorld(shard_id,true)
(This shard id will be the second slave)
@myxal
myxal / Code.gs
Created Oct 24, 2019
Custom functions for DST - Skin chests
View Code.gs
function MAPSELECT(value, key, selection) {
if (value.length != key.length){
throw("lenghts of value and key must be equal")
}
output = ""
for (i=0;i<value.length;i++) {
if (key.charAt(i) == selection) {
output = output.concat(value.charAt(i))
}
}