Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -euo pipefail
# This script will allow you to easily use https://runeapps.org/clue on Linux. Ideally you would use
# the alt1 toolkit directly, but it's very much windows only and no support for anything else seems planned.
# the actual apps however are plain webapps, the only thing the 'toolkit' is really doing is recording the screen
# and passing it directly to those webapps. This script will partly do the same by taking a screenshot upon execution
# and passing it to the clue webapp
#
@schoentoon
schoentoon / ignore.cpp
Created May 25, 2014 12:45
Updated ignore.cpp module so it can actually compile under znc 1.4 (I did not test this, but it should work yell at me in comments if it doesn't work please)
/*
* Copyright (C) 2004-2009 See the AUTHORS file for details.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*
* Made by Mini
*/
@schoentoon
schoentoon / gist:83718670df08f86c0222
Created May 18, 2014 13:35
Pretty much the same as https://gist.github.com/schoentoon/6176047 but this will run forever and run with inotify itself
#!/usr/bin/python
from nbt import * # https://github.com/twoolie/NBT
import json
def generate():
nbtfile = nbt.NBTFile("/path/to/scoreboard.dat", 'rb')
deaths=dict()
for tag in nbtfile["data"]["PlayerScores"]:
if str(tag["Objective"]) == "Deaths": #Assuming the objective keeping track of the deaths is called "deaths"
deaths[str(tag["Name"])] = int(str(tag["Score"]))
@schoentoon
schoentoon / gist:7216533
Created October 29, 2013 15:13
Simple python script to print the weather/day state of a minecraft world for https://github.com/schoentoon/Minecraft-Overviewer
#!/usr/bin/python
print "Content-Type: application/json"
print
from nbt import * # https://github.com/twoolie/NBT
import json
nbtfile = nbt.NBTFile("/complete/path/to/world/data/scoreboard.dat", 'rb')
day = (int(str(nbtfile["Data"]["DayTime"])) % 24000) < 12000
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
if (argc == 1) {
fprintf(stderr, "USAGE: %s [options]\n", argv[0]);
return 1;
}
srand(time(NULL));
@schoentoon
schoentoon / gist:6176047
Last active December 20, 2015 18:29
Simple python script to receive death counts of a minecraft server in json
#!/usr/bin/python
print "Content-Type: application/json"
print
from nbt import * # https://github.com/twoolie/NBT
import json
nbtfile = nbt.NBTFile("/complete/path/to/world/data/scoreboard.dat", 'rb')
deaths=dict()
for tag in nbtfile["data"]["PlayerScores"]:
@schoentoon
schoentoon / inotify.c
Last active February 27, 2024 22:13
Simple example of how to use inotify with libevent. Compile with gcc -o inotify inotify.c -levent
#include <stdio.h>
#include <event.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <sys/inotify.h>
static void displayInotifyEvent(struct inotify_event *i)
{
printf(" wd =%2d; ", i->wd);
@schoentoon
schoentoon / MainActivity.java
Created January 13, 2013 23:40
Simple documentation for the Mac2Vendor broadcast Interface
package com.example.mac2vendortest;
import android.os.Bundle;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.widget.TextView;
@schoentoon
schoentoon / muteradio
Created July 28, 2012 17:58
Radio in screen
#!/bin/bash
screen -DRR -p 0 -S radio -X eval 'stuff \"m\"'