Skip to content

Instantly share code, notes, and snippets.

@Skinner927
Skinner927 / _Minecraft_Server_Readme.md
Last active April 8, 2024 04:22
Minecraft Server Setup

Minecraft Server Setup

This is for Ubuntu 18.04 / Systemd

Install deps

sudo apt-get install -y screen wget rdiff-backup openjdk-11-jre-headless

Create a minecraft service user

@Skinner927
Skinner927 / mc_death_location.txt
Last active January 25, 2019 23:00
Minecraft Command Block Death Location
All these block should feed into eachother. Meaning the first block should points at the second, and so on.
Repeat | Unconditional | Always active
execute as @a[nbt={Health:0.0f}] store result score @s lastpos_x run data get entity @s Pos[0]
Chain | Conditional | Always active
execute as @a[nbt={Health:0.0f}] store result score @s lastpos_y run data get entity @s Pos[1]
Chain | Conditional | Always active
execute as @a[nbt={Health:0.0f}] store result score @s lastpos_z run data get entity @s Pos[2]
19 ### Kernel module `br_netfilter`
20 - `sudo vim /etc/modules` and add `br_netfilter` to the end.
21 - `sudo modprope br_netfilter`
22 - `sudo vim /etc/sysctl.conf` and add the following lines:
23 ```
24 net.bridge.bridge-nf-call-arptables = 1
25 net.bridge.bridge-nf-call-ip6tables = 1
26 net.bridge.bridge-nf-call-iptables = 1
27 ```
28
@Skinner927
Skinner927 / imap_delete_emails.py
Last active April 30, 2019 20:55
Delete all emails from email inboxes via IMAP
#!/usr/bin/env python3
import imaplib
import sys
from itertools import chain
server = 'imap.mail.yahoo.com'
port = 993
username = '[email protected]'
password = 'hunter2'
@Skinner927
Skinner927 / vuex_cheat_sheet.md
Last active January 27, 2023 11:56
Vuex Cheat Sheet

Vuex Cheat Sheet

new Vuex.Store({
  modules: {
    counter: {
      state: {
        count: 0,
      },
      getters: {
        square(state) {
@Skinner927
Skinner927 / classproperty.py
Last active October 12, 2020 23:01
Properties for Python Classes. Supports get and set.
"""
To use simply copy ClassPropertyMeta and classproperty into your project
"""
class ClassPropertyMeta(type):
def __setattr__(self, key, value):
obj = self.__dict__.get(key, None)
if type(obj) is classproperty:
return obj.__set__(self, value)
@Skinner927
Skinner927 / ipy.sh
Last active May 29, 2020 23:24
iPython without being installed locally with different version global python
# This is a roundabout way to start ipython from inside a virtualenv without it being installed
# in that virtualenv. The only caveot is that the "global" python must have ipython installed.
# What this function does that's different than simply calling the global ipython is it ensures to
# call the ipython that is installed for the same major.minor python version as in the virtualenv.
# This is most useful if you use pyenv for example as global python3 could be 3.7 and local
# virtualenv python3 is 3.6.
# This is designed to be dropped into your shell profile (~/.bashrc|~/.zshrc)
unset ipy_lookup
declare -A ipy_lookup
@Skinner927
Skinner927 / cmder.xml
Created December 5, 2019 03:20
cmder config
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2019-12-04 22:20:26" build="180626">
<value name="Language" type="string" data="en"/>
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{WSL::zsh}"/>
<value name="StartFarFolders" type="hex" data="00"/>
@Skinner927
Skinner927 / mirror.sh
Created July 6, 2022 15:27
Mirror/clone repo for offline mirror
#!/bin/sh
# Derived from:
# https://www.edwardthomson.com/blog/mirroring_git_repositories.html
# Mirrors repo and zips it up for easy transport to offline network
set -eufo pipefail
if [ "$#" -ne 1 ]; then
echo "usage: $0 source_repo_url" >&2
@Skinner927
Skinner927 / git-mirror.sh
Last active August 31, 2022 19:00
Mirror entire git repo -- all branches, tags, and notes
#!/bin/sh
# Mirrors an entire repo with al tags and branches.
# Based off this article.
# https://www.edwardthomson.com/blog/mirroring_git_repositories.html
set -eufo pipefail
if [ "$#" -lt 1 ]; then
echo "usage: $0 SOURCE_REPO_URL [PACKAGED_NAME]" >&2
exit 1