Skip to content

Instantly share code, notes, and snippets.

View Connection to Estonian SPM
private void populateEESpeciesProfileModule() {
eeSpmLookup = new HashMap<>();
/* ee term | spm term */
eeSpmLookup.put("General Description", "General description");
//eeSpmLookup.put("Ecology", "")
//eeSpmLookup.put("Phylogeny", "")
eeSpmLookup.put("Distribution", "Distribution");
eeSpmLookup.put("DiagnosticDescription", "Diagnostic description");
eeSpmLookup.put("Morphology", "Morphology");
@Inkimar
Inkimar / wildfly8.1- standalone
Last active May 12, 2021
jboss-cli setting a datasource
View wildfly8.1- standalone
Testing with 5.1.38 ( mysql-connector-java-5.1.38-bin.jar 5.1.38 )
~log in to admin~
$./bin/jboss-cli.sh --connect
~before you start, take a snapshot of the configuration :~
~snapshot is saved in -> /wildfly/standalone/configuration/standalone_xml_history/snapshot~
[domain@localhost:9999 /] :take-snapshot()
@Inkimar
Inkimar / command-add-datasource.cli
Last active May 2, 2016
Adding a mysql-datasource to wildfly 8.x , you need to download the mysql java connector
View command-add-datasource.cli
deploy customization/mysql-connector-java-5.1.38-bin.jar
data-source add --name=MediaDS \
--jndi-name=java:/MediaDS \
--driver-name=mysql-connector-java-5.1.38-bin.jar_com.mysql.jdbc.Driver_5_1 \
--connection-url=jdbc:mysql://dbmedia:3306/media?useUnicode=true&amp;characterEncoding=UTF-8 \
--user-name=xxxx \
--password=xxxx \
--check-valid-connection-sql="SELECT 1" \
--background-validation=true \
--background-validation-millis=60000 \
@Inkimar
Inkimar / gist:54f85bebad3b8695a5cdf35c58b43d01
Created Sep 14, 2016
test 2 lists, no regard to order - using hamcrest
View gist:54f85bebad3b8695a5cdf35c58b43d01
import static org.hamcrest.Matchers.containsInAnyOrder;
/**
* http://pragmaticqa.co.uk/blog/2012/10/comparing-lists-with-hamcrest/
*/
@Test
public void TEST_HAMCREST_listTestsWithoutOrder() {
List<String> list1 = new ArrayList<>();
List<String> list2 = new ArrayList<>();
@Inkimar
Inkimar / gist:5d10083c12052c17afbf56553ec43b96
Created Sep 14, 2016
building a publishing a relese with travis-ci
View gist:5d10083c12052c17afbf56553ec43b96
Github and Travis
#prereq for travis installation:
1. install travis-cli
1.1 ruby --version
-> gives 2.3
(1.2 sudo apt-get install pkg-config)
1.2 sudo apt-get install build-essential
sudo apt-get install libffi-dev
#install travis
View gist:ad5dd185b8d8605a5c85d331d53ee4b7
#!/usr/bin/groovy
def name='World'; println "change file names"
String oldFilename = "old.txt"
String newFilename = "new.txt"
new File(oldFilename).renameTo(new File(newFilename))
@Inkimar
Inkimar / standalone-snippet.xml
Created Sep 27, 2016
wildfly 8.1, update standalone.xml with 'max-header-size="974247881" '
View standalone-snippet.xml
<!-- able to uploead 9.0 MB file-->
<subsystem xmlns="urn:jboss:domain:undertow:1.2">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" max-header-size="974247881"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
View gist:d8fe774cb320886e299975916c91613e
example :
log-in
~/$WILDFLY_HOME/bin $ ./jboss-cli.sh --connect
[standalone@localhost:9990 /] /subsystem=datasources:read-resource
{
"outcome" => "success",
"result" => {
"data-source" => {
"ExampleDS" => undefined,
"MediaDS" => undefined
@Inkimar
Inkimar / gist:ff8dcccbb462dcff137f85986ed7b708
Created Oct 26, 2016
wildfly : increasing size of files to be uploaded
View gist:ff8dcccbb462dcff137f85986ed7b708
/subsystem=undertow/server=default-server/http-listener=default/:write-attribute(name=max-post-size,value=1048576000)
@Inkimar
Inkimar / gist:0cecaf0164fb33a24f15fcd7a8a1d13a
Created Oct 26, 2016
inlcude an environment-file in : i.e Makefile and ... shell-script
View gist:0cecaf0164fb33a24f15fcd7a8a1d13a
in Makefile
#!make
include .env2
in bash-script
#!/bin/bash
source .env2