Skip to content

Instantly share code, notes, and snippets.

View sohlich's full-sized avatar
🏠
Working from home

Rado Sohlich sohlich

🏠
Working from home
View GitHub Profile
@sohlich
sohlich / JavaFXTrayIconSample.java
Created December 3, 2016 19:04 — forked from jewelsea/JavaFXTrayIconSample.java
Demonstrate using the System Tray (AWT) to control a JavaFX application.
import javafx.application.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.Label;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.stage.*;
import javax.imageio.ImageIO;
import java.io.IOException;
@sohlich
sohlich / parsers_test.go
Created November 18, 2016 05:32
Golang program argument testing
func TestConfigParse(t *testing.T) {
oldArgs := os.Args
defer func() { os.Args = oldArgs }()
os.Args = []string{"metro",
"-host=localhost",
"-port=30",
"-user=ssh",
"-password=sshpass",
"-list=lst.csv",
"-timeout=25"}
@sohlich
sohlich / sshtunnel.go
Created November 12, 2016 05:04 — forked from iamralch/sshtunnel.go
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"
@sohlich
sohlich / ssl_smtp_example.go
Created September 15, 2016 03:06 — forked from chrisgillis/ssl_smtp_example.go
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@sohlich
sohlich / persistence.xml
Created August 6, 2016 18:30 — forked from mortezaadi/persistence.xml
persistence xml configurations for major databases and jpa providers
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- derby -->
@sohlich
sohlich / shiro.ini
Created August 6, 2016 10:44 — forked from dominicfarr/shiro.ini
example jdbcRealm configured in shiro.ini
[main]
ds = com.mysql.jdbc.Driver
ds.serverName = localhost
ds.user = user
ds.password = password
ds.databaseName = db_name
jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm
jdbcRealm.dataSource = $ds
jdbcRealm.permissionsLookupEnabled = true
^[a-z]{4}:/{2}[a-z]{0,3}\.?[a-z,0-9,\.]{1,}\.?[a-z]{0,}:?[0-9]{0,4}
@sohlich
sohlich / Wildfly: deployment-overlay
Created January 8, 2016 11:56
Wildfly CLI: The deployment overlay command
deployment-overlay add --name=myOverlay --content=/WEB-INF/web.xml=/myFiles/myWeb.xml,/WEB-INF/ejb-jar.xml=/myFiles/myEjbJar.xml --deployments=test.war,*-admin.war --redeploy-affected
@sohlich
sohlich / Makefile.golang
Last active November 6, 2016 05:24 — forked from dnishimura/Makefile.golang
Makefile for Golang projects
BUILDPATH=$(CURDIR)
GO=$(shell which go)
GOBUILD=$(GO) build
GOCLEAN=$(GO) clean
GOGET=$(GO) get
EXENAME=main
export GOPATH=$(CURDIR)
@sohlich
sohlich / jboss-deployment-structure.xml
Last active November 17, 2015 16:41 — forked from akerekes/jboss-deployment-structure.xml
JBoss deployment structure file to disable container provided logging
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclusions>
<module name="org.apache.commons.logging" />
<module name="org.apache.log4j" />
<module name="org.jboss.logging" />
<module name="org.jboss.logging.jul-to-slf4j-stub" />
<module name="org.jboss.logmanager" />
<module name="org.jboss.logmanager.log4j" />
<module name="org.slf4j" />