Skip to content

Instantly share code, notes, and snippets.

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

Luan Kevin Ferreira luankevinferreira

🏠
Working from home
View GitHub Profile
@luankevinferreira
luankevinferreira / StoreClientProviderTest.java
Created November 8, 2017 15:07
Example of environments mock
package br.com.senior.usuarios.wso2;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
@luankevinferreira
luankevinferreira / generate-key.bat
Created March 28, 2017 17:37
Generate self-signed certificate java
keytool -genkey -keyalg RSA -alias selfsigned -keystore testkey.jks -storepass password -validity 360 -keysize 2048
@luankevinferreira
luankevinferreira / SSLUtilities.java
Created March 28, 2017 16:54
Disable SSL verifications
import java.security.GeneralSecurityException;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
/**
* This class provide various static methods that relax X509 certificate and
@luankevinferreira
luankevinferreira / share-folder-virtualbox-automaticaly.md
Last active July 4, 2017 17:05
Share folder between Windows and Linux with VitualBox automaticaly
  1. Create a folder on Windows PC
  2. Add the folder in Shared Folders settings on VirtualBox and set to Auto-mount
  3. Install virtual-guest-utils your VM Linux sudo apt install virtualbox-guest-utils
  4. Add your VM Linux user to the vboxsf group sudo usermod -G vboxsf -a <username>
  5. The shared folder is in the path /media/sf_<foldername>
@luankevinferreira
luankevinferreira / UploadFile.java
Last active April 13, 2024 22:54
Upload a file using HTTP put in Java
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
@luankevinferreira
luankevinferreira / nginx-jackrabbit.conf
Created November 17, 2016 10:43
Nginx configuration to Jackrabbit CORS
...
server {
listen 80 default deferred;
# jackrabbit (webdav)
location /repository/default/perm {
deny all;
}
location /repository {