Skip to content

Instantly share code, notes, and snippets.

@DreamTexX
DreamTexX / code.java
Last active September 12, 2022 20:59
[Create Fake Player] #Spigot
// 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++) {
@ttimasdf
ttimasdf / 00-Systemd_service_for_autossh.md
Last active April 9, 2024 19:36 — forked from thomasfr/autossh.service
Systemd service for autossh

Usage

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
@dmjio
dmjio / gist:3831557
Created October 4, 2012 04:56
toLower.c
/*lower:convert c to lowercase; ASCII only*/
int lower(int c)
{
if (c >= 'A' && c <= 'Z')
return c +'a'-'A';
else
return c;
}