Skip to content

Instantly share code, notes, and snippets.

View inertia186's full-sized avatar
🏠
Working from home

Anthony Martin inertia186

🏠
Working from home
View GitHub Profile
## Cleanly recovers from a crash event.
IFS=$'\n'
MC="/Users/steve/Minecraft"
LOG="$MC/logs/latest.log"
ALERT="$MC/scripts/alert-admin.sh"
error="$2"
if [ -n "$error" ]; then
path="`echo "$error" | cut -f 8 -d " "`"
#!/bin/bash
export LANG="en_US.UTF-8"
MC=/Users/steve/Minecraft
# Many of these options are explaiend here:
# http://stas-blogspot.blogspot.com/2011/07/most-complete-list-of-xx-options-for.html
# http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
# http://blog.ragozin.info/2011/09/hotspot-jvm-garbage-collection-options.html
#!/bin/bash
## A small wrapper around the mcrcon binary.
##
## See: https://forums.bukkit.org/threads/admin-rcon-mcrcon-remote-connection-client-for-minecraft-servers.70910/
MC="/path/to/server"
RCON_EXEC="$MC/scripts/gits/mcrcon-code/mcrcon"
RCON_HOST="127.0.0.1"
RCON_PORT=25577
@inertia186
inertia186 / btc-e-no-chat.js
Last active December 15, 2015 17:49
This is a greasemonkey script that will hide the chat window on BTC-e (http://www.btc-e.com/).
// ==UserScript==
// @name btc-e-no-chat
// @namespace https://gist.github.com/inertia186/5298810
// @version 0.1
// @description Hide the chat window on BTC-e.
// @match *://btc-e.com/*
// ==/UserScript==
/**
* Don't like the vulgarities and idiocy in the BTC-e chat (aka troll box)
@inertia186
inertia186 / planet-minecraft.sh
Created March 20, 2013 23:18
[Minecraft, SMP] Planet Minecraft
#!/bin/bash
MC="/Users/steve/Minecraft"
LOG="$MC/server.log"
MESSAGE="We are not falling for it. This is not the server you are looking for. Move along."
for player in `tail -50 $LOG | grep -i "i'm\|im\|i am" | grep -i from | grep -i planet | grep -i minecraft | cut -f 4 -d " " | cut -f 2 -d \< | cut -f 1 -d \> | sort | uniq`
do
if [ -n "`tail -100000 $LOG | grep "Kicked $player from the game: '$MESSAGE'"`" ]; then
@inertia186
inertia186 / slap.sh
Last active December 15, 2015 05:29
[Minecraft, SMP] Here's how the staff can invoke the mc-slap.rb script I posted previously. As always, this assumes you run the Minecraft server in a screen session named "minecraft".
#!/bin/bash
MC="/Users/steve/Minecraft"
RUBY="/Users/steve/.rvm/rubies/ruby-1.9.3-p374/bin/ruby"
if [ -z "$1" ]; then
echo $0 \[target\]
fi
target=$1
@inertia186
inertia186 / minecraft-ddos-Block-IPs.txt
Last active December 15, 2015 05:19
If you're setting up a pf (packet filter) firewall, here's the Minecraft specific DDoS threats file we currently use.
70.71.153.43
111.197.56.176
111.197.63.35
114.250.244.70
203.171.233.243
221.219.250.74
65.125.155.90
85.227.160.171
204.14.77.46
174.134.89.68
@inertia186
inertia186 / mc-slap.gemspec
Last active December 14, 2015 00:59
Minecraft themed slap script.
Gem::Specification.new do |s|
s.name = 'mc-slap'
s.version = '0.0.1'
s.platform = Gem::Platform::RUBY
s.author = 'Anthony Martin'
s.email = '[email protected]'
s.summary = 'Minecraft Slap'
s.description = 'Minecraft themed slap script.'
s.files = ['mc-slap.rb']
@inertia186
inertia186 / mc-announce-ban.sh
Created February 18, 2013 06:27
[Minecraft, SMP] This script will announce that a player will be banned for a particular reason, then bans them after 15 seconds.
cmd="say $1 will be banned in 15 seconds. Reason: $2"
bash -c "screen -p 0 -S minecraft -X eval 'stuff \"$cmd\"\015'"
sleep 15
cmd="ban $1 $2"
bash -c "screen -p 0 -S minecraft -X eval 'stuff \"$cmd\"\015'"