Skip to content

Instantly share code, notes, and snippets.

View mikroskeem's full-sized avatar
👻

Mark Vainomaa mikroskeem

👻
View GitHub Profile
@mikroskeem
mikroskeem / Arch Linux btrfs install.md
Last active October 8, 2023 18:27 — forked from artizirk/Arch Linux btrfs install.md
Arch Linux installation on btrfs subvolumes

Arch Linux btrfs install

NOTE: Last update to this gist was on Jun 2, 2018. Most of the things here are out of date (e.g consider using zstd for transparent compression instead of lzo), so do your own research as well. Take care!

0. Prerequisites

  • Plenty of storage - snapshots will take (sort of) a lot of space
  • Latest Arch Linux install iso because those have newer kernels and more bugfixes in btrfs.
  • Have previous experience with installing Arch (like you can install arch with a blind fold).
  • Read everything through
@mikroskeem
mikroskeem / ovpn-writer.sh
Last active July 10, 2016 17:19 — forked from renatolfc/ovpn-writer.sh
Script to generate an OpenVPN client configuration file in the unified format
#!/bin/sh
##
## Note: this generates profile which works with Android OpenVPN Connect
## Usage: ./ovpn-writer.sh SERVER CA_CERT CLIENT_CERT CLIENT_KEY SHARED_SECRET > client.ovpn
##
server=${1?"The server address is required"}
cacert=${2?"The path to the ca certificate file is required"}
client_cert=${3?"The path to the client certificate file is required"}
/*
* Copyright (c) 2017. Starlis LLC / dba Empire Minecraft
*
* This source code is proprietary software and must not be redistributed without Starlis LLC's approval
*
*/
package com.empireminecraft.systems.tasks;
import com.empireminecraft.util.Log;
@mikroskeem
mikroskeem / BaseCommands.kt
Created August 2, 2018 23:39 — forked from aikar/BaseCommands.kt
EMC JDA Discord Bot in Kotlin, with ACF and IDB
import co.aikar.commands.BaseCommand
import co.aikar.commands.JDACommandEvent
import co.aikar.commands.annotation.CommandAlias
import co.aikar.commands.annotation.Dependency
import net.dv8tion.jda.core.JDA
import net.dv8tion.jda.core.entities.Guild
class BaseCommands : BaseCommand() {
@Dependency
@mikroskeem
mikroskeem / git-deployment.md
Created September 17, 2018 06:10 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

func getFlags(desiredHeap int64) string {
asKb := desiredHeap / units.KiB
// the following is specific to OpenJ9 and is based on Aikar's flags:
// https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/
// The equivalent of -XX:G1NewSizePercent/-XX:G1MaxNewSizePercent in OpenJ9's gencon policy is -Xmns/-Xmnx.
// We have to manually compute these values ourselves. By default, the gencon policy assumes 25% of Xms, which is
// simply not sufficient for Minecraft (and Aikar can tell you).
xmns := asKb / 2
@mikroskeem
mikroskeem / ColorUtil.java
Last active November 8, 2023 21:27 — forked from Vexentric/ColorUtil.java
A quick util for getting the closest ChatColor from an RGB value.
package com.vex.random;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
import org.bukkit.ChatColor;
public class ColorUtil {
private static Map<ChatColor, ColorSet> colorMap = new HashMap<>();
@mikroskeem
mikroskeem / systemd_service_hardening.md
Created September 24, 2021 15:30 — forked from ageis/systemd_service_hardening.md
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict