A Newly Created Marshyonline Systems Admin Portal had been released this week. The portal contains manny inhouse scripts, such as Tracert and ping that are run from the linux server the portal is hosted from.
MemStats – Bukkit Plugin
Just a quick plugin I wrote for bukkit, to display total RAM used, and max RAM available
Paste the downloaded jar in the plugins DIR and use the /ram command to show RAM stats.
Download Jar Here
You may do as you like this code, but credit must be given if part or all of the code is used.
Sauce Code:
package net.marshyonline.MemUsage; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.command.*; import java.text.DecimalFormat; import java.util.logging.Logger; import org.bukkit.ChatColor; public class MemUsage extends JavaPlugin { //Version number private static final int version = 2; //Caculations private static final long K = 1024; private static final long M = K * K; private static final long G = M * K; private static final long T = G * K; public static String Convert(final long value){ final long[] dividers = new long[] { T, G, M, K, 1 }; final String[] units = new String[] { "TB", "GB", "MB", "KB", "B" }; if(value < 1) throw new IllegalArgumentException("Invalid file size: " + value); String result = null; for(int i = 0; i < dividers.length; i++){ final long divider = dividers[i]; if(value >= divider){ result = format(value, divider, units[i]); break; } } return result; } private static String format(final long value, final long divider, final String unit){ final double result = divider > 1 ? (double) value / (double) divider : (double) value; return new DecimalFormat("#,##0.#").format(result) + " " + unit; } //Ram Stuff public static Runtime runtime = Runtime.getRuntime(); public static long memoryfree = runtime.freeMemory(); public static long memorytotal = runtime.totalMemory(); public static long memorymax = runtime.maxMemory(); public static long highload = memoryfree+memorytotal; Logger log = Logger.getLogger("Minecraft"); //onEnable and onDisable public void onEnable(){ //new LoginListener(this); log.info("MemUsage V" + version + ", has been enabled!"); log.info("MemUsage Plugin by Marshyonline"); log.info("INFO: Total server RAM =" + Convert(memorytotal)); } public void onDisable(){ log.info("MemUsage V" + version + ", has shutdown!"); log.info("MemUsage Plugin by Marshyonline"); } public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){ if(cmd.getName().equalsIgnoreCase("ram")){ sender.sendMessage (ChatColor.GREEN + "Memory in use: " + Convert(memoryfree+memorytotal) + "/" + Convert(memorymax)); return true; } return false; } }
Projects
Ive started adding some of my projects to the projects page.
;)
Just go the internet back on at my house, so I decided to make a proper home page :D
Check back for stuff that I might post :P


