Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@gdiazs
gdiazs / HttpClient.java
Last active March 10, 2017 14:28
No SSL Verification for apache http client
HttpClient client = HttpClientBuilder.create().setSSLHostnameVerifier(new NoopHostnameVerifier()).build();
@gdiazs
gdiazs / spring-security.xml
Last active December 10, 2018 04:15
spring-security.xml
<b:beans xmlns="http://www.springframework.org/schema/security"
xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">
<http auto-config="true">
<form-login login-page="/faces/signin/login.xhtml"
login-processing-url="/login" default-target-url="/faces/index.xhtml"
authentication-failure-url="/faces/signin/login.xhtml?error=true" />
<b:bean id="userDetailService"
class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean">
<b:property name="jndiName"
value="java:global/ErisEAR/ErisWeb/UserDetailServiceImpl!io.gdiazs.eris.security.services.UserDetailServiceImpl" />
<b:property name="businessInterface"
value="org.springframework.security.core.userdetails.UserDetailsService" />
</b:bean>
@gdiazs
gdiazs / keycloak tome
Last active December 6, 2020 23:10
Keycloak Multiple Files (tomee 8 + microprofile)
import java.io.InputStream;
import java.nio.file.FileSystemNotFoundException;
import org.eclipse.microprofile.config.ConfigProvider;
import org.keycloak.adapters.KeycloakConfigResolver;
import org.keycloak.adapters.KeycloakDeployment;
import org.keycloak.adapters.KeycloakDeploymentBuilder;
import org.keycloak.adapters.spi.HttpFacade.Request;
public class FortbizKeyCloakConfigResolver implements KeycloakConfigResolver {