Skip to content

Instantly share code, notes, and snippets.

View hasalex's full-sized avatar

Alexis Hassler hasalex

View GitHub Profile
@hasalex
hasalex / undertow-http2
Created September 28, 2017 19:26
HTTP, HTTPS, HTTP2 avec Undertow
package fr.sewatech.demo.http2.undertow;
import io.undertow.Undertow;
import io.undertow.UndertowOptions;
import io.undertow.server.HttpServerExchange;
import io.undertow.util.Headers;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import java.security.KeyStore;
@hasalex
hasalex / create-cert.sh
Last active November 4, 2022 15:59
Tomcat 9 configuration, with HTTP/2
# Commun pour le connecteur APR et les connecteurs classiques
openssl req -newkey 2048 -nodes -keyout conf/tomcat.key -x509 -days 365 -out conf/tomcat.crt -config conf/openssl.cnf
# Inutile pour le connecteur APR
openssl pkcs12 -inkey conf/tomcat.key -in conf/tomcat.crt -export -out conf/tomcat.pfx
persons.stream()
.filter(Person::isMale)
.filter(p -> p.isAdult(LocalDate.now()))
.map(p -> p.getFirstName() + " " + p.getLastName())
.collect(Collectors.toList());
dn: dc=sewatech,dc=fr
objectClass: top
objectClass: domain
dc: sewatech
dn: ou=people,dc=sewatech,dc=fr
objectClass: top
objectClass: organizationalUnit
ou: people
# Building WildFly AS 9
version=9.0.2.Final
# Download and prepare the source code
wget https://github.com/wildfly/wildfly/tarball/$version
tar -xvf $version
cd wildfly-*
# Build it !
./build.sh -DskipTests -Dskip-enforce -T1C
@hasalex
hasalex / keybase.md
Created December 7, 2014 20:44
keybase.io

Keybase proof

I hereby claim:

  • I am hasalex on github.
  • I am hasalex (https://keybase.io/hasalex) on keybase.
  • I have a public key whose fingerprint is A9B5 8997 A29D D848 8D7A 2142 A50C 0255 D630 758D

To claim this, I am signing this object:

@hasalex
hasalex / build-eap-6.2.4.sh
Created June 29, 2014 18:11
Build JBoss EAP 6.2.4 from source
wget ftp://ftp.redhat.com/redhat/jbeap/6.2.4/en/source/jboss-eap-6.2.4-src.zip
wget http://maven.repository.redhat.com/techpreview/eap6/6.2.4/jboss-eap-6.2.4-full-maven-repository.zip
wget https://raw.githubusercontent.com/hasalex/eap-build/master/src/settings.xml
unzip jboss-eap-6.2.4-src.zip
unzip jboss-eap-6.2.4-full-maven-repository.zip
cp settings.xml jboss-eap-6.2-src/tools/maven/conf/
cd jboss-eap-6.2-src/
@hasalex
hasalex / ldif-for-tomcat7
Last active August 29, 2015 14:01
LDAP Realm for Tomcat 7 (works towod OpenDJ)
dn: dc=sewatech,dc=fr
objectClass: domain
objectClass: top
dc: sewatech
dn: ou=people,dc=sewatech,dc=fr
objectClass: organizationalUnit
objectClass: top
ou: people
@hasalex
hasalex / gist:7430048
Created November 12, 2013 12:30
Arquillian Maven Resolver
public class Deployments {
public static final String WEBAPP_SRC = "src/main/webapp";
public static WebArchive deploy() {
File[] requiredLibraries = Maven.resolver().loadPomFromFile("pom.xml")
.resolve("com.google.guava:guava", "org.codehaus.jackson:jackson-mapper-asl")
.withTransitivity().asFile();
return ShrinkWrap.create(WebArchive.class)
.addPackages(true, JsonServlet.class.getPackage())
@hasalex
hasalex / ldap-security-domain.cli
Created June 24, 2013 22:13
jboss-cli script for configuring LDAP configuration in WildFly with OpenDJ
batch
/subsystem=security/security-domain=swmsg-xxx:add(cache-type=default)
/subsystem=security/security-domain=swmsg-xxx/authentication=classic:add()
/subsystem=security/security-domain=swmsg-xxx/authentication=classic/login-module=LdapExtended:add(code=LdapExtended, flag=required, module-options={"java.naming.provider.url"=>"ldap://127.0.0.1:1389/","bindDN"=>"cn=Sewatech","bindCredential"=>"aa","baseCtxDN"=>"ou=people,dc=sewatech,dc=fr","baseFilter"=>"(uid={0})","rolesCtxDN"=>"ou=groups,dc=sewatech,dc=fr","roleFilter"=>"(uniqueMember={1})","roleAttributeID"=>"cn"})
run-batch