Skip to content

Instantly share code, notes, and snippets.

@cnaude
cnaude / get.pl
Last active August 20, 2016 02:48
Parse output from http://forums.bukkit.org/members/?page=$i and sort by number of likes.
#!/usr/bin/perl
use strict;
for my $i (1..16420) {
system("wget -O data/bf.$i.html 'http://forums.bukkit.org/members/?page=$i'");
sleep 2;
}
@cnaude
cnaude / mc-watcher.pl
Last active December 24, 2015 04:29
Red Hat startup script for Minecraft
#!/usr/bin/perl
use strict;
my $date = localtime(time);
my $log_file = "/home/mc/tekkit/server.log";
my $re = '^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d \[SEVERE\] The server has stopped responding.*?';
print "[$date] Watching $log_file\n";
print "[$date] RE: $re\n";
public static void main(String[] args) {
randomGenerator = new Random();
int c = 4;
int count = 0;
for (int x = 0; x <= 30; x++) {
int r = randomGenerator.nextInt(100);
if (r >= c) {
System.out.println("Drop: " + r);
} else {
@cnaude
cnaude / minecraft
Created November 20, 2016 01:03
minecraft rc script
#!/bin/bash
#
# $Id: minecraft,v 1.9 2011/10/04 04:29:02 cnaude Exp $
#
# /etc/rc.d/minecraft
# PROVIDE: minecraft
# REQUIRE: LOGIN
#Settings
@cnaude
cnaude / accouncer
Last active November 20, 2016 01:13
minecraft irc announcer
#!/bin/bash
#
SVRMSG=$1
USERNAME='mc'
BOT='AardMC'
CHANNEL='#minecraft'
SERVICE='AardMC.jar'
SCREEN='mc'
@cnaude
cnaude / ov.cfg
Created February 27, 2017 12:47
Overviewer Configuration for Aardvark MC
# vim: set filetype=python:
def townFilter(poi):
if poi['id'] == 'Town':
return poi['name']
def signFilter(poi):
if poi['id'] == 'Sign' or poi['id'] == 'minecraft:sign':
if poi['Text1'].startswith('Image:'):
poi['icon'] = "painting_icon.png"
@cnaude
cnaude / chunk_multi.sh
Last active October 9, 2018 14:54
Quick and dirty Chunky time lapse rendering
#!/bin/bash
SPP=150
#WIDTH=950
#HEIGHT=540
WIDTH=1920
HEIGHT=1080
CPULOAD=100
THREADS=3
SCENE=syc_zig
@cnaude
cnaude / install-optifine.sh
Created October 21, 2017 15:40
Install Optifine into MultiMC instance on Linux workstation
#!/bin/bash
MULTIMCDIR=/home/cnaude/Minecraft/MultiMC
if [[ -z "$2" ]]; then
echo "** Usage: $0 [Optifine.jar] [instance]"
exit 1
fi
FILE=$1
if [ ! -e "$FILE" ]; then
@cnaude
cnaude / dungeon.mc
Last active July 16, 2018 10:57
Minecraft Dungeon Commands
# inititalize
/effect @p 15 1000000 2
/playsound record.13 block @a ~ ~ ~
/say @p has entered the Dungeon!
/setblock -262 169 314 chest 5 destroy {Items:[{Count:1,Slot:1,id:iron_sword}]}
/setblock -259 169 311 trapped_chest 3 destroy {Items:[{Count:2,Slot:1,id:rotten_flesh},{Count:4,Slot:3,id:rotten_flesh},{Count:6,Slot:7,id:cooked_fish}]}
/setblock -245 159 315 chest 4 destroy {Items:[{Count:1,Slot:1,id:diamond_sword},{Count:1,Slot:2,id:beetroot_soup},{Count:1,Slot:3,id:beetroot_soup}]}
/setblock -252 174 306 trapped_chest 2 destroy {Items:[{Count:1,Slot:1,id:emerald},{Count:1,Slot:2,id:emerald},{Count:1,Slot:3,id:emerald},{Count:1,Slot:4,id:emerald}]}
/setblock -248 173 296 trapped_chest 5 destroy {Items:[{Count:1,Slot:1,id:iron_axe},{Count:1,Slot:3,id:mushroom_stew},{Count:1,Slot:6,id:mushroom_stew},{Count:1,Slot:5,id:mushroom_stew}]}
/setblock -252 185 298 chest 3 destroy {Items:[{Count:1,Slot:0,id:diamond_block},{Count:1,Slot:9,id:emerald_block},{Count:1,Slot:18,id:gold_block}]}
@cnaude
cnaude / ruby_hash_example.erb
Created June 25, 2018 15:42
example erb hash uiterate
Hello world.
<% node['attrname'].each |key,val| do -%>
KEY: <%= key %>
VAL: <%= val %>
<% end -%>