curl -sSL https://gist.githubusercontent.com/ttimasdf/ef739670ac5d627981c5695adf4c8f98/raw/autossh@host1 | \
sudo tee /etc/default/autossh@example
curl -sSL https://gist.githubusercontent.com/ttimasdf/ef739670ac5d627981c5695adf4c8f98/raw/autossh@.service | \
sudo tee /etc/systemd/system/autossh@.service
sudo useradd -g nogroup -s /bin/false -m tunnel
sudo -u tunnel mkdir -p ~tunnel/.ssh # and copy your private key here
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// These two lines should be outside the npc spawn function for caching | |
HashMap<String, String> skins = new HashMap<>(); | |
HashMap<String, String> signatures = new HashMap<>(); | |
// This code was written inside an command, thats why (Player) commandSender | |
Player player = (Player) commandSender; | |
MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer(); | |
WorldServer world = ((CraftWorld) player.getWorld()).getHandle(); | |
Location loc = player.getLocation(); | |
for (int x = loc.getBlockX() - 16; x < loc.getBlockX() + 16; x++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*lower:convert c to lowercase; ASCII only*/ | |
int lower(int c) | |
{ | |
if (c >= 'A' && c <= 'Z') | |
return c +'a'-'A'; | |
else | |
return c; | |
} |