Skip to content

Instantly share code, notes, and snippets.

View akunzai's full-sized avatar

Charley Wu akunzai

  • Taipei,Taiwan
  • 18:43 (UTC +08:00)
  • X @akunzai
View GitHub Profile
@jehrhardt
jehrhardt / KeyLengthDetector.java
Created March 15, 2013 06:23
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) {
@4ndrej
4ndrej / SSLPoke.java
Last active October 20, 2025 16:48
Test of java SSL / keystore / cert setup. Check the comment #1 for howto.
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
@fumiyas
fumiyas / openldap-2.4.31-slappasswd-moduleload.patch
Created May 31, 2012 04:26
OpenLDAP: [PATCH] slappasswd: Add support loading a dynamically loadable
From 9cb4cb040e77372ea892bba81136d2741a6707bb Mon Sep 17 00:00:00 2001
From: SATOH Fumiyasu <[email protected]>
Date: Thu, 31 May 2012 13:13:41 +0900
Subject: [PATCH] slappasswd: Add support loading a dynamically loadable
module
Add "-o module-path=<pathspec>" and "-o module-load=<filename>"
options to load a dynamically loadable password hash module
(e.g., slapd-sha2).
---
@ngs
ngs / GitHub 2.css
Created May 11, 2012 02:55
New GitHub CSS for Mou.app
body {
font-size: 14px;
line-height: 1.6;
background-color: white;
font: 13.34px helvetica,arial,freesans,clean,sans-serif;
*font-size: small;
color: black;
}
table {
@jchadwick
jchadwick / JsonMessageFormatter.cs
Created April 20, 2012 18:47
MSMQ Message JSON Formatter
using System;
using System.IO;
using System.Messaging;
using System.Text;
using Newtonsoft.Json;
public class JsonMessageFormatter : IMessageFormatter
{
private static readonly JsonSerializerSettings DefaultSerializerSettings =
new JsonSerializerSettings {