Skip to content

Instantly share code, notes, and snippets.

@myxal
myxal / 00-grow_fixed.sh
Last active January 10, 2022 19:16
addon.d scripts to grow /system after installation (choose 1)
#!/sbin/sh
#
# /system/addon.d/10-resize-system.sh
#
. /tmp/backuptool.functions
case "$1" in
backup)
# Stub
;;
@myxal
myxal / host_net_cleanup.sh
Last active March 7, 2020 14:38
Test 6in4 tunnel within single physical network
#!/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 March 4, 2020 16:15
Worldmigrators, shard linking, in Don't Starve Together
# 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 / ip-route-TODO
Last active March 7, 2020 18:12
IPv6 home gateway firewall rules
# 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 / Code.gs
Created October 24, 2019 06:53
Custom functions for DST - Skin chests
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))
}
}