Skip to content

Instantly share code, notes, and snippets.

@zukka77
zukka77 / cognomi.txt
Last active November 19, 2015 22:44 — forked from pdesterlich/cognomi.txt
lista cognomi italiani
Agostini
Aiello
Albanese
Amato
Antonelli
Arena
Baldi
Barbieri
Barone
Basile
@zukka77
zukka77 / nomi_italiani.txt
Created November 19, 2015 22:38 — forked from pdesterlich/nomi_italiani.txt
lista nomi italiani
abaco
abbondanza
abbondanzia
abbondanzio
abbondazio
abbondia
abbondina
abbondio
abdenago
abdon
@zukka77
zukka77 / CompositeX509KeyManager.java
Created December 19, 2015 01:50 — forked from codyaray/CompositeX509KeyManager.java
A composite KeyManager for doing SSL in Java with multiple keystores. See http://codyaray.com/2013/04/java-ssl-with-multiple-keystores
package com.mycompany.ssl;
import java.net.Socket;
import java.security.Principal;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.util.List;
import javax.annotation.Nullable;
import javax.net.ssl.X509KeyManager;
package com.mycompany.ssl;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.List;
import javax.net.ssl.X509TrustManager;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
@zukka77
zukka77 / UnsafeOkHttpClient.java
Last active January 10, 2016 17:23
Unsafe OkHttpClient
private static OkHttpClient getUnsafeOkHttpClient() throws KeyManagementException, NoSuchAlgorithmException {
// Create a trust manager that does not validate certificate chains
final TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {
}
@Override
@zukka77
zukka77 / CustomSSLSocketFactory.java
Created January 10, 2016 17:29
Custom SSLSocketFactory
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
@zukka77
zukka77 / KeyLengthDetector.java
Created February 25, 2016 20:06 — forked from jehrhardt/KeyLengthDetector.java
Detect the allowed size of AES keys on the JVM. If the size is <= 256, it is limited. To fix it JCE unlimted stregth files are needed.
import javax.crypto.Cipher;
import java.security.NoSuchAlgorithmException;
public class KeyLengthDetector {
public static void main(String[] args) {
int allowedKeyLength = 0;
try {
allowedKeyLength = Cipher.getMaxAllowedKeyLength("AES");
} catch (NoSuchAlgorithmException e) {
frontend ssl
mode tcp
bind 0.0.0.0:443 name frontend-ssl
option tcplog
log global
tcp-request inspect-delay 3s
tcp-request content accept if { req.ssl_hello_type 1 }
use_backend main-ssl if { req.ssl_hello_type 1 }
use_backend ssh if !{ req.ssl_hello_type 1 } { payload(0,7) -m bin 5353482d322e30 }
use_backend openvpn if !{ req.ssl_hello_type 1 } !{ req.len 0 }
port=9999
proxy=myproxy
proxy_port=8080
dest=myserver
dest_port=443
ssh -D $port user@$dest -o "ProxyCommand corkscrew $proxy $proxy_port $dest $dest_port proxy.auth"
#IP
<FilesMatch "\.php$">
SetHandler "proxy:fcgi://localhost:9000"
</FilesMatch>
DirectoryIndex index.html index.php
#UNIX SOCKET
<FilesMatch "\.php$">
SetHandler "proxy:unix:/var/run/php-fpm/php-fpm.sock|fcgi://localhost/"
</FilesMatch>