SMTP test driver using JavaMail version 1.5.2.
# SSL/TLS port: 465
# Otherwise: 587
smtp.host=smtp.mail.yahoo.com
smtp.port=465
smtp.useSsl=true| package org.test; | |
| public class Utils | |
| { | |
| private Utils() {} | |
| /** | |
| * Determines whether or not the given string is null or contains an empty | |
| * value. | |
| * @param s |
| package org.gkh.net; | |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.InputStreamReader; | |
| import java.io.OutputStream; | |
| import java.io.PrintWriter; | |
| import java.util.logging.Logger; |
| I liked this one the best: http://www.minecraftforum.net/topic/74402-setup-linux-daemon/. | |
| 1) Get the code snippet below into a file in /etc/init.d/. This will be referenced as FILENAME henceforth. I used: | |
| /etc/init.d/minecraft-server: | |
| minecraft-server | |
| #! /bin/sh | |
| # | |
| # network Bring up/down networking |
| Create a list of users based on logins | |
| grep "logged in with entity id" server.log | cut -f4 -d" " | sort -u > users.txt | |
| Get connection information: | |
| Date/Time, Name, and IP Address | |
| grep logged server.log | cut -f1,2,4,5 -d" " | |
| Get disconnect information: | |
| Date/Time, Name | |
| grep disconnect server.log | cut -f1,2,4 -d" " |
| package org.gkh.test; | |
| /* | |
| * Utility class for converting to and from hexadecimal. | |
| */ | |
| public class HexUtil { | |
| private static final int SEG_SIZE = 16; | |
| private static final char[] hexDigits = { |
| package org.gkh.test; | |
| /* | |
| * Prior to JDK 1.7, you had to use an approximation to evaluate strings in a | |
| * switch statement. See the following links. | |
| * http://www.xefer.com/2006/12/switchonstring | |
| * http://stackoverflow.com/questions/338206/switch-statement-with-strings-in-java | |
| * http://docs.oracle.com/javase/7/docs/technotes/guides/language/strings-switch.html | |
| */ | |
| public class StringSwitch { |
| package org.gkh.test; | |
| import java.nio.file.Path; | |
| import java.util.concurrent.ArrayBlockingQueue; | |
| import java.util.concurrent.BlockingQueue; | |
| /** | |
| * This is a demonstration Producer/Consumer that queues and dequeues new file | |
| * items as they are created in the directory we are watching. | |
| * |
| package org.gkh.test; | |
| import java.io.BufferedInputStream; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.IOException; | |
| import java.util.LinkedHashSet; | |
| import java.util.List; | |
| import java.util.Set; |
| package com.netiq; | |
| import java.awt.Desktop; | |
| import java.awt.Desktop.Action; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.UnsupportedEncodingException; | |
| import java.net.URI; | |
| import java.net.URLEncoder; | |
| import java.util.Properties; |