Running a Minecraft Server With Docker

Sun Feb 28 2021

Close your eyes for one moment and imagine that everything you host runs in docker containers. You no longer need to battle system dependencies, and configurations are more manageable; it is now easier to backup and transfer your applications.

In my quest to dockerize everything, I am now dockerizing my Minecraft server. Minecraft is a relatively simple application to host since it is just a single Java application that you need to run. To put this in Docker, we need to declare a Java Docker image that launches our Minecraft server.

FROM openjdk:8u232

WORKDIR /root/minecraft

CMD java -Xmx2048M -jar spigot-1.10.jar -o true

Read More »

DIY Video Hosting Server

Mon Feb 15 2021

Two years ago, I created a video streaming server from scratch in Node; looking back, I realized that I must have had way too much free time. I wanted something that I could use to embed videos in websites and aggregate all of my public videos. In the end, I created a lightweight node application with an administration interface, API tokens, and the ability to stream videos. Now, I can embed videos in my blog like this:

Read More »

Running Scala Code in Docker

Sat Feb 13 2021

Alrighty, folks, this blog post is pretty straightforward from the title. We are going to be running Scala code in Docker containers. Specifically, we will be using SBT and docker-compose. SBT is a built tool primarily used by Scala developers, and docker-compose is a tool for defining docker environments.

To start, we need to create a simple Docker container that can build our scala code. From an existing Java JDK container, SBT is straightforward to install from a package manager.

FROM openjdk:8u232


# Install sbt
  mkdir /working/ && \
  cd /working/ && \
  curl -L -o sbt-$SBT_VERSION.deb$SBT_VERSION.deb && \
  dpkg -i sbt-$SBT_VERSION.deb && \
  rm sbt-$SBT_VERSION.deb && \
  apt-get update && \
  apt-get install sbt && \
  cd && \
  rm -r /working/ && \
  sbt sbtVersion

RUN mkdir -p /root/build/project
ADD build.sbt /root/build/
ADD ./project/plugins.sbt /root/build/project
RUN cd /root/build && sbt compile

WORKDIR /root/build

CMD sbt compile run

Read More »

Quadtree Animations with Matplotlib

Mon Feb 08 2021

This post will extend my last post on image quadtrees to create an animation that varies the quadtree splitting threshold. Like all recursively dividing algorithms, as you relax the splitting parameter, more partitions get generated. Although this principle makes intuitive sense, seeing animation tells a fuller story.

This post will be using the matplotlib’s animation functionality and the quadtree code I wrote in my previous post. The following code snippet illustrates a simple animation using matplolib:

import numpy as np
from matplotlib import pyplot as plt
from matplotlib.animation import FuncAnimation

fig = plt.figure()
ax = plt.axes(xlim=(0, 4), ylim=(-2, 2))
line, = ax.plot([], [], lw=3)

def init():
    line.set_data([], [])
    return line,
def animate(i):
    x = np.linspace(0, 4, 1000)
    y = np.sin(2 * np.pi * (x - 0.01 * i))
    line.set_data(x, y)
    return line,

anim = FuncAnimation(fig, animate, init_func=init,
                               frames=200, interval=20, blit=True)'Wave.gif')
Simple Animation
Simple Animation

Read More »

2020 in Review

Thu Dec 31 2020

2020; this year will likely live in infamy due to covid. Reflecting on this year compared to 2019 is very solemn. Not necessarily because I didn’t accomplish anything; I completed more this year than in 2019. But, 2020 lacks so much travel and in-person events that frequently serve as the milestones for my year.

In my 2019 post, I reflect on all the trips that I took, the hackathons I attended, and the places I gave presentations. However, this year I feel like I can sum up everything I did in a single sentence. I graduated from RIT after taking two consecutive semesters of 18 credit hours, I presented my first published paper at a virtual conference, and I started a full-time job as a software engineer.

Read More »