Skip to content

Instantly share code, notes, and snippets.

View uphy's full-sized avatar
💭
I may be slow to respond.

Yuhi Ishikura uphy

💭
I may be slow to respond.
View GitHub Profile
@uphy
uphy / mkdocs.yml
Created April 10, 2017 10:52
mkdocs.yml
site_name: My Docs
site_description: hogehoge
site_author: uphy
copyright: my copyright
dev_addr: 0.0.0.0:8000
theme: readthedocs
markdown_extensions:
- footnotes
pages:
@uphy
uphy / logstash-free.conf
Created March 9, 2017 12:39
logstash - free command
input {
exec {
command => "free -b"
interval => 10
}
}
filter {
grok {
match => {
"message" => ".*?Mem:\s*?%{NUMBER:total}\s*?%{NUMBER:used}\s*?%{NUMBER:free}\s*?%{NUMBER:shared}\s*?%{NUMBER:buffers}\s*?%{NUMBER:cached}\s*?\-/\+ buffers/cache:\s*?%{NUMBER:actual.used}\s*?%{NUMBER:actual.free}\s*?Swap:\s*?%{NUMBER:swap.total}\s*?%{NUMBER:swap.used}\s*?%{NUMBER:swap.free}.*"
package jp.uphy.wso2apim;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.List;
import javax.net.ssl.HttpsURLConnection;
import org.apache.commons.httpclient.Header;
import org.wso2.carbon.endpoint.stub.types.EndpointAdminEndpointAdminException;
import org.wso2.carbon.registry.info.stub.RegistryExceptionException;
import org.wso2.carbon.registry.resource.stub.ResourceAdminServiceExceptionException;
import org.wso2.carbon.registry.resource.stub.ResourceAdminServiceStub;
import org.wso2.carbon.rest.api.stub.RestApiAdminAPIException;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Base64;
import org.wso2.am.admin.clients.registry.ResourceAdminServiceClient;
import org.wso2.carbon.endpoint.stub.types.EndpointAdminEndpointAdminException;
import org.wso2.carbon.registry.info.stub.RegistryExceptionException;
import org.wso2.carbon.registry.resource.stub.ResourceAdminServiceExceptionException;
import org.wso2.carbon.rest.api.stub.RestApiAdminAPIException;
import java.rmi.RemoteException;
public class ResourceAdminServiceClientSample {
@uphy
uphy / JavaFXDialog.java
Created January 4, 2017 06:25
How to develop KNIME node with JavaFX
package it.pkg;
import java.awt.BorderLayout;
import java.util.concurrent.Callable;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicReference;
import javax.swing.JPanel;
import org.knime.core.node.InvalidSettingsException;
@uphy
uphy / ClassLoaderAndObjectIOTest.java
Created December 15, 2013 03:21
How to read objects which are loaded dynamically.
package dct;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamClass;
import java.net.URL;
@uphy
uphy / KeyBindingUtils.java
Last active October 14, 2015 13:23
Basic Emacs Keybindings with JavaFX
/**
* Copyright (C) 2015 uphy.jp
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
@uphy
uphy / example-prms-jmatx.java
Created January 21, 2012 02:32
Example of prms and jmatx combination.
/**
* 関数を注入するテストを行います。
*
* @throws Exception テスト失敗
*/
@SuppressWarnings("boxing")
@Test
public void testInvocableWithInitialValue() throws Exception {
class A {
@uphy
uphy / ProgressIndicatorPaneExample.java
Last active August 29, 2015 14:03
Add progress indicator feature to any JavaFX scene.While displaying progress indicator, it blocks all mouse events from user.
/**
* Copyright (C) 2014 uphy.jp
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software