https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

| /** | |
| * Utility class to read encrypted PEM files and generate a | |
| * SSL Socket Factory based on the provided certificates. | |
| * The original code is by Sharon Asher (link below). I have modified | |
| * it to use a newer version of the BouncyCastle Library (v1.52) | |
| * | |
| * Reference - https://gist.github.com/sharonbn/4104301" | |
| */ | |
| import org.bouncycastle.cert.X509CertificateHolder; |
| # Assuming an Ubuntu Docker image | |
| $ docker run -it <image> /bin/bash |
| #!/bin/bash | |
| # Author: Erik Kristensen | |
| # Email: erik@erikkristensen.com | |
| # License: MIT | |
| # Nagios Usage: check_nrpe!check_docker_container!_container_id_ | |
| # Usage: ./check_docker_container.sh _container_id_ | |
| # | |
| # Depending on your docker configuration, root might be required. If your nrpe user has rights | |
| # to talk to the docker daemon, then root is not required. This is why root privileges are not |
| <profiles> | |
| <profile> | |
| <id>windows_profile</id> | |
| <activation> | |
| <os> | |
| <family>Windows</family> | |
| </os> | |
| </activation> | |
| <properties> | |
| <toolsjar>${java.home}/../lib/tools.jar</toolsjar> |
| Monitoring using Java 7: http://java.dzone.com/news/how-watch-file-system-changes | |
| =============//========== | |
| In this article I am going to show you how to write a simple file monitor. So even though Java 7 comes with a low-level API to watch for file system changes, fow now we will be using using the Commons IO library from the Apache Foundation, mainly the org.apache.commons.io.monitor package. | |
| The first step will be to define the location that we are going to monitor. For this I’ve created a temporary folder of my desktop, and defined a String constant pointing to that newly created location: | |
| The first step will be to define the location that we are going to monitor. For this I’ve created a temporary folder of my desktop, and defined a String constant pointing to that newly created location: | |
| public static final String FOLDER = |
keytool -genkeypair -keyalg RSA -keysize 2048 -validity 365 -alias ca -dname "CN=ca,O=HMS,S=SE" -keystore ca.jks -storepass password
keytool -exportcert -rfc -alias ca -keystore ca.jks -storepass password > ca.pem
cat ca.pem | keytool -importcert -alias ca -noprompt -keystore trust.jks -storepass password
| // Copyright (c) 2012 Sutoiku, Inc. (MIT License) | |
| // Some algorithms have been ported from Apache OpenOffice: | |
| /************************************************************** | |
| * | |
| * Licensed to the Apache Software Foundation (ASF) under one | |
| * or more contributor license agreements. See the NOTICE file | |
| * distributed with this work for additional information | |
| * regarding copyright ownership. The ASF licenses this file |
| -server | |
| -Xms2048m | |
| -Xmx2048m | |
| -XX:NewSize=512m | |
| -XX:MaxNewSize=512m | |
| -XX:PermSize=512m | |
| -XX:MaxPermSize=512m | |
| -XX:+UseParNewGC | |
| -XX:ParallelGCThreads=4 | |
| -XX:MaxTenuringThreshold=1 |
| function readFile(file) { | |
| var reader = new FileReader(); | |
| var deferred = $.Deferred(); | |
| reader.onload = function(event) { | |
| deferred.resolve(event.target.result); | |
| }; | |
| reader.onerror = function() { | |
| deferred.reject(this); |