Skip to content

Instantly share code, notes, and snippets.

@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) {
@joshlong
joshlong / gist:10964238
Created April 17, 2014 08:23
Register this EmbeddedServletContainerCustomizer @bean in a Spring Boot application to customize the embedded Tomcat instance. In particular, this sets up SSL support for the container. I quite like this because it uses Java 8 lambas to nice effect. No finals, no anonymous inner classes. it just... works.
@Bean
EmbeddedServletContainerCustomizer containerCustomizer(
@Value("${keystore.file}") Resource keystoreFile,
@Value("${keystore.pass}") String keystorePass) throws Exception {
String absoluteKeystoreFile = keystoreFile.getFile().getAbsolutePath();
return (ConfigurableEmbeddedServletContainer container) -> {
if (container instanceof TomcatEmbeddedServletContainerFactory) {
@kyledrake
kyledrake / ferengi-plan.txt
Last active October 3, 2024 15:12
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@magnetikonline
magnetikonline / README.md
Last active October 31, 2024 17:00
Bash string manipulation cheatsheet.

Bash string manipulation cheatsheet

Assignment
Assign value to variable if variable is not already set, value is returned.

Combine with a : no-op to discard/ignore return value.
${variable="value"}
: ${variable="value"}
@thomasdarimont
thomasdarimont / LoginStatsRecordingRequiredActionProvider.java
Last active April 6, 2021 10:02
Keycloak RequiredAction for recording user information on login
package de.tdlabs.idm.keycloak.ext.authentication;
import static java.time.LocalDateTime.now;
import static java.util.Arrays.asList;
import java.util.List;
import org.jboss.logging.Logger;
import org.keycloak.Config.Scope;
import org.keycloak.authentication.RequiredActionContext;
@joaomoreno
joaomoreno / README.md
Last active February 1, 2024 22:19
VS Code Insiders Updater for Linux

VS Code Insiders Updater for Linux

This script will download and replace ~/Applications/VSCode-linux-x64 with the latest VS Code Insiders.

gif

Install

  1. Install jq: https://stedolan.github.io/jq/download/
  2. Place update-code somewhere in your PATH

Klipper on the BIQU BX

So you want to run Klipper on your BIQU BX? Well too bad it's not supported.... but I do have some good news. I have a preliminary branch ready to submit to Klipper to support the BIQU BX. Here's what you need to know in order to get started.

NOTE: If you have a V3 board, click here

_**UPDATE: The Biqu BX is now supported in mainstream klipper!

NOTE: CAN will not work on this board due to a hardware mis-configuration

NOTE: I2C is not quite working yet!