Skip to content

Instantly share code, notes, and snippets.

@sudot
sudot / Pbkdf2PasswordEncoder.java
Created April 2, 2020 14:41
Password Hashing With PBKDF2 (PBKDF2WithHmacSHA1)
/**
* Password Hashing With PBKDF2 (http://crackstation.net/hashing-security.htm).
* Copyright (c) 2013, Taylor Hornby
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
@sudot
sudot / 电脑不锁屏.html
Created September 2, 2019 03:45
电脑不锁屏
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>I need you still work!</title>
</head>
<body bgcolor="#215E21">
<script type="text/javascript">
function PressKey(){
var objWs = new ActiveXObject("Wscript.Shell");
objWs.SendKeys("{SCROLLLOCK}");
@sudot
sudot / LombokReflections.java
Created November 28, 2018 11:47
LombokReflections
import java.beans.Introspector;
import java.io.Serializable;
import java.lang.invoke.SerializedLambda;
import java.lang.reflect.Method;
import java.util.function.Function;
import java.util.regex.Pattern;
/**
* Lombok反射工具
*
@sudot
sudot / JedisRedisLock.java
Last active March 9, 2022 01:00
使用Redis服务实现的分布式锁
package net.sudot.commons.lock;
import redis.clients.jedis.Jedis;
import java.time.Duration;
import java.util.Collections;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
/**