Skip to content

Instantly share code, notes, and snippets.

View codehz's full-sized avatar
🔮

Neko Hz codehz

🔮
View GitHub Profile
@codehz
codehz / bdsm-system.service
Last active January 28, 2021 03:23
Get BDSM (Bedrock Dedicated Server Manager) (Used for testing)
[Unit]
Description=Bedrock Dedicated Server Manager
Documentation=https://github.com/bdsm-technology/BDSM
After=network.target
[Service]
User=user
Group=user
WorkingDirectory=/path/to/mcpe
ExecStart=/path/to/mcpe/bdsm daemon -profile %i
@codehz
codehz / inst.sh
Last active February 6, 2019 10:53
run StoneServer w/o docker
#!/bin/bash -e
printf "%s\n" "Clean up..."
rm -rf output
printf "%s\n" "Downloading..."
wget -q --show-progress -O stone.zip https://gitlab.com/codehz/StoneServer/builds/artifacts/master/download?job=job_package
printf "%s\n" "Unziping..."
unzip stone.zip > /dev/null
(cd output; tar cBf - . | (cd ..; tar xBf -))
rm -rf output
mkdir -p data
@codehz
codehz / installation.md
Last active September 22, 2019 23:22
StoneServer

codehz/StoneServer
codehz/stoneserver
You can find docker-compose.yml file in the github repo.

This tutorial is written for user that don't want to use Docker (or Archlinux).

Prerequirement

git cmake make or ninja jq curl redis-server

Minecraft 1.9.0.15 x86 apk

#!/usr/bin/env node
const constants = require("./constants.js");
const api = require("stoneapi-js");
const Discord = require('discord.js');
const client = new Discord.Client();
api.init();
api.attach();
const channels = constants.channels;
#!/bin/bash
set -euo pipefail
url_cobblestone="https://hertz.services/docker/codehz/cobblestone/0"
url_bds="https://hertz.services/docker/codehz/bds/0"
url_nsgod="https://hertz.services/github/codehz/nsgod/latest/nsgod"
mkdir -p .cobblestone/{core,game}
tempdir=$(mktemp -d)
echo "[+] created temp directory: ${tempdir}"
#!/bin/bash
rm -rf contents.json
temp=$(mktemp)
trap "rm -rf $temp" EXIT
find -type f | sed 's/^.\//path=/' | parallel jo | jo -a | sed 's/^/content=/' > $temp
echo "version=1" >> $temp
cat $temp | jo -p >> contents.json
declare module 'picogl' {
enum GL {
DEPTH_BUFFER_BIT = 0x00000100,
STENCIL_BUFFER_BIT = 0x00000400,
COLOR_BUFFER_BIT = 0x00004000,
POINTS = 0x0000,
LINES = 0x0001,
LINE_LOOP = 0x0002,
LINE_STRIP = 0x0003,
TRIANGLES = 0x0004,
@codehz
codehz / evilgcc.h
Last active December 22, 2019 02:27
#pragma once
#ifndef __GNUC__
# error This header only works in GCC
#endif
#ifdef __clang__
# ifndef __ccls__
# warning This header may not working in clang
# endif
function(init_user_prop prop)
if(${prop})
set(ENV{_${prop}} "${${prop}}")
else()
set(${prop} "$ENV{_${prop}}" PARENT_SCOPE)
endif()
endfunction()
function(generate_winsdk_vfs_overlay winsdk_include_dir output_path)
set(include_dirs)
#include <chrono>
#include <iostream>
#include <random>
#include <sqlite3.h>
int loadOrSaveDb(sqlite3 *pInMemory, const char *zFilename, bool isSave) {
int rc; /* Function return code */
sqlite3 *pFile; /* Database connection opened on zFilename */
sqlite3_backup *pBackup; /* Backup object used to copy data */