Skip to content

Instantly share code, notes, and snippets.

View interma's full-sized avatar
🟢
⚫🔵

Hongxu Ma interma

🟢
⚫🔵
View GitHub Profile
@bmaupin
bmaupin / UnlimitedJCEPolicyJDK8-RHEL.sh
Last active November 4, 2022 02:57
Install jce_policy-8.zip on RHEL/CentOS 6/7
# See here for JDK 7: https://gist.github.com/bmaupin/4396be4bb29c5ad440b6
# See here for test to make sure this works: https://gist.github.com/evaryont/6786915
if grep -q -i "release 6" /etc/*release; then
jce_primary_link_dir=/usr/lib/jvm/jre-1.8.0-oracle.x86_64/lib/security
elif grep -q -i "release 7" /etc/*release; then
jce_primary_link_dir=/usr/lib/jvm/jce-1.8.0-oracle
fi
wget \
@Mak0
Mak0 / System Design.md
Created April 20, 2016 04:22 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@patshaughnessy
patshaughnessy / gist:70519495343412504686
Last active April 28, 2024 01:19
How to Debug Postgres using LLDB on a Mac
This note explains how to build Postgres from source and setup to debug it using LLDB on a Mac. I used this technique to research this article:
http://patshaughnessy.net/2014/10/13/following-a-select-statement-through-postgres-internals
1. Shut down existing postgres if necessary - you don’t want to mess up your existing DB or work :)
$ ps aux | grep postgres
pat 456 0.0 0.0 2503812 828 ?? Ss Sun10AM 0:11.59 postgres: stats collector process
pat 455 0.0 0.0 2649692 2536 ?? Ss Sun10AM 0:05.00 postgres: autovacuum launcher process
pat 454 0.0 0.0 2640476 304 ?? Ss Sun10AM 0:00.74 postgres: wal writer process
pat 453 0.0 0.0 2640476 336 ?? Ss Sun10AM 0:00.76 postgres: writer process
@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) {