Skip to content

Instantly share code, notes, and snippets.

View Inkimar's full-sized avatar

Ing Erl Inkimar

  • Stockholm
  • 13:13 (UTC -12:00)
View GitHub Profile
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 / command-add-datasource.cli
Last active May 2, 2016 14:47
Adding a mysql-datasource to wildfly 8.x , you need to download the mysql java connector
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 September 14, 2016 12:35
test 2 lists, no regard to order - using hamcrest
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<>();
#!/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 September 27, 2016 14:48
wildfly 8.1, update standalone.xml with 'max-header-size="974247881" '
<!-- 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>
@Inkimar
Inkimar / gist:0cecaf0164fb33a24f15fcd7a8a1d13a
Created October 26, 2016 13:17
inlcude an environment-file in : i.e Makefile and ... shell-script
in Makefile
#!make
include .env2
in bash-script
#!/bin/bash
source .env2
@Inkimar
Inkimar / gist:72b8664abd3086bdf48d270c148f1c2d
Last active October 28, 2016 12:04
erase all docker images and containers
#!/bin/bash
# Delete all containers
docker rm -f $(docker ps -a -q)
# Delete all images
docker rmi -f $(docker images -q)
remove one image:
docker rmi dina/media:v0.4
check
@Inkimar
Inkimar / gist:d8fe774cb320886e299975916c91613e
Last active October 28, 2016 12:08
wildfly, show datasources
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:586b25b082d62a10181b5ceb6271dce9
Last active October 28, 2016 13:24
Fetch docker image and inspect the image
ex.
docker pull dina/media:v0.4
docker run --rm -it dina/media:v0.4 bash
docker run -it -p 9990:9990 dina/media:v0.4
remove one image:
docker rmi dina/media:v0.4
remove a single container ( whith id = beec50b40e9cf67cddd7cf38557f60510d22d2d90182932dfd56974da5075b27 )
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/liquibase_demo
username=demo
password=demo
verbose=true
dropFirst=false