rem

.co

Gentoo: Running a Minecraft 1.8 Server

| Comments

Running a dedicated Minecraft server can be a challenging job. You have to find a balance between performance and usability using “server software” that doesn’t seem to be designed to provide for long running, resilient services.

Being a first-time Minecraft server operator I had to tackle various challenges in order to come up with a way to provide a stable and reliable service to my players. The following article is a recollection of the things I implemented and scripts I wrote in order to run a Minecraft 1.8 server. The scripts mentioned are specific to Gentoo Linux, but could also be used on most other Linux flavours, albeit with some modifications to match that platform’s init.d scripts.

Git: Moving a Repository to a New Server

| Comments

The quick, easy and complete way:

  1. Clone the repo you want to move or skip this step if you already have one set up:

     git clone git@oldreposerver:repo/name <insert dir>
     cd <insert dir>
    
  2. Make sure your repo has all the latest news from its current origin:

     git fetch --all 
    
  3. Add the new origin as a temporary remote whilst keeping the old one for now:

Fixing ‘Error Opening Terminal: Screen-256color.’

| Comments

If you’re using tmux or screen as a wrapper for your terminal sessions (such as when using the Text Triumvirate), chances are that you are presented with the following error when you invoke a command that uses 256 color mode (such as multitail or htop):

Error opening terminal: screen-256color.

I don’t know if this is the recommended solution, but it’s a pretty quick fix and seems to work on multiple distributions:

1
2
cd /usr/share/terminfo/
cp x/xterm-256color s/screen-256color

OnApp: Using PHP to Launch a VNC Connection

| Comments

If you’re an OnApp user you probably know you can make a VNC connection to your VM’s using the Control Panel. This uses a java applet in your browser as the VNC client.

Wouldn’t it be nice to use your own VNC client (like Remotix) instead?

In fact, you can, but OnApp spawns a VNC server on a (somewhat) random port and a new random VNC password for each sessions which you’ll have to figure out before setting up your connection.

According to the OnApp Helpdesk you can use these calls to get the required information:

1
2
GET /virtual_machines/:virtual_machine_id/console.xml
GET /virtual_machines/:virtual_machine_id/console.json

As I’m lazy I didn’t want to do this manually every time, so I devised a little PHP script that can aid in finding the right information:

SELinux: Allowing SSH Public Key Authentication

| Comments

The issue

I experienced a seemingly weird issue with a freshly installed CentOS server today.

SSH Public key authentication was correctly set up; The sshd_config was properly configured and a ~/.ssh/authorized_keys was present with the correct rights and verified correct contents (as the file was yanked from another, working, server with scp).

All attempts to connect to the machine using key authentication silently failed however.

Ubuntu: Automatically Selecting a Fast Mirror

| Comments

Letting Ubuntu pick the apt-get mirror closest to you is pretty easy.

Just add these mirror directives to the top of /etc/apt/sources.list and you’re good to go:

1
2
3
4
deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse