- Log in as root (default configured)
- Run
apt-get update && apt-get dist-upgrade
- Create a user named
minecraft
withadduser minecraft
, and skip everything except the password - Run
usermod -a -G sudo minecraft
- Log off, and log back in with the
minecraft
account - Run
sudo passwd -dl root
- Disable root login via SSH by running
sudo sed -i -e "s/PermitRootLogin yes/PermitRootLogin no/g" /etc/ssh/sshd_config && sudo service ssh restart
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
public boolean isForwarded(Player player) { | |
UUID uuid = player.getUniqueId(); | |
UUID generatedId = UUID.nameUUIDFromBytes(("OfflinePlayer:" | |
+ player.getName()).getBytes(Charsets.UTF_8)); | |
return !uuid.equals(generatedId); | |
} |
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
import datetime | |
import threading | |
from flask import Flask | |
from collections import OrderedDict | |
import json | |
import hashlib | |
import os | |
import markdown | |
class Entry(): |
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
#!/usr/bin/env python | |
"""Checks the status (availability, logged-in players) on a Minecraft server. | |
Example: | |
$ %(prog)s host [port] | |
available, 3/5 online: mf, dignity, viking | |
or | |
>>> McServer('my.mcserver.com').Update().player_names_sample |
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
import com.google.common.collect.BiMap; | |
import com.google.common.collect.ImmutableBiMap; | |
public class RomanNumerals { | |
private static final BiMap<String, Integer> ROMAN_INT_MAP = new ImmutableBiMap.Builder<String, Integer>() | |
.put("i", 1) | |
.put("ii", 2) | |
.put("iii", 3) | |
.put("iv", 4) | |
.put("v", 5) |
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
import mcstatus, time, threading | |
from bottle import route, run, response, hook | |
server = mcstatus.McServer('hub.thechunk.net', 25565) | |
def schedule_update(): | |
threading.Timer(1, schedule_update).start() | |
threading.Thread(target=lambda: server.Update()).start() | |
@hook('after_request') |
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
import java.util.*; | |
public class ItemDistribution<T> { | |
private Map<T, Integer> registered = new HashMap<>(); | |
private static Random random = new Random(); | |
int max = 0; | |
public void insert(T item, int weight) { | |
registered.put(item, registered.containsKey(item) ? | |
registered.get(item) + weight : weight); |
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
import org.json.simple.JSONArray; | |
import org.json.simple.parser.JSONParser; | |
import org.json.simple.parser.ParseException; | |
import java.io.IOException; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.util.*; | |
public class NameFetcher { |
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
Alblaka removes compatibility between Too Many Items and BuildCraft by request of Direwolf20 | |
SpaceToad plays OpenPeripheral on Twitch | |
MachineMuse confirms that OpenBlocks should be less like Chisel | |
kirindave threatens to complain about Shukaro until they remove Natura from Resonant Rise | |
nallar adds compatibility between ExtraBiomesXL and VoxelMap by request of kakermix | |
Sengir denies OpenPeripheral is faster than RedPower 3 | |
MamiyaOtaru steals code from Highlands | |
Alblaka decides to base their entire modpack on Pixelmon | |
Vswe says PowerCrystals did not steal 5 lines of code from RealSketch | |
RWTema tweets tgame14 stole 5 lines of code from Reika |
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
private static Map<String, String> bukkitToNMS = ImmutableMap.<String, String>builder() | |
.put("horse", "EntityHorse") | |
.put("mushroom_cow", "MushroomCow") | |
.put("magma_cube", "LavaSlime") | |
.put("snowman", "SnowMan") | |
.put("silverfish", "Silverfish") | |
.put("cave_spider", "CaveSpider") | |
.put("iron_golem", "VillagerGolem") | |
.put("ender_dragon", "EnderDragon") | |
.put("pig_zombie", "PigZombie") |