Skip to content

Instantly share code, notes, and snippets.

@skwashd
skwashd / README.md
Last active January 15, 2022 15:29
Auto starting minecraft server in a docker container on Ubuntu 16.04

The better way to do this

During a twitter conversation with itzg, he suggested that I use [docker's built in --restart="unless-stopped" runtime flag] (https://gist.github.com/itzg/36e59186f6195a445f1f1fa2b0087ea9). That worked a treat and means I don't need to maintain an extra service.

My old way of doing it

This is only retained for historic record. Don't follow these steps.

If you want to run a minecraft server in a docker container on Ubuntu 16.04 and have it automatically start at boot, follow these steps:

anonymous
anonymous / ds4.cpp
Created December 17, 2015 19:00
example of using libhid to read and write a playstation DS4 controller (wired)
// quick hack job by @mmalex
// thanks to libhid author and @johndrinkwater and https://github.com/chrippa/ds4drv
#include <stdio.h>
#include "hidapi.h" // using http://www.signal11.us/oss/hidapi/
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
#pragma pack(push, 1)
@fpsunflower
fpsunflower / nanoexr.cpp
Last active December 9, 2021 14:42
Tiny OpenEXR output
// c++ -o nanoexr nanoexr.cpp && ./nanoexr /tmp/foo.exr
#include <cstdio>
// writes a tiled OpenEXR file from a float RGB buffer
struct Exr {
FILE* f; enum{TS=64}; ~Exr() { fclose(f); }
void B(unsigned char i) { fputc(i,f); }
void I(unsigned int i) { fwrite(&i,1,4,f); }
void L(unsigned long long i) { fwrite(&i,1,8,f); }
void F(float x) { fwrite(&x,1,4,f); }