Skip to content

Instantly share code, notes, and snippets.

View codeachange's full-sized avatar

noname codeachange

View GitHub Profile
@codeachange
codeachange / vmware.md
Created March 10, 2024 04:33 — forked from ayebrian/vmware.md
VMware ESXI 8 / VCSA 8/ vCenter 8 / Workstation 17 8 license key 2024

vCenter Server 8 Standard

Key Tested
4F282-0MLD2-M8869-T89G0-CF240
0F41K-0MJ4H-M88U1-0C3N0-0A214

ESXi 8

Key Tested
4V492-44210-48830-931GK-2PRJ4
package com.base.framework.utils;
import com.google.common.base.Joiner;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
@codeachange
codeachange / windows_ps_wmic.bat
Last active January 31, 2018 03:49
windows dump current process command line to file using wmic
# 获取所有进程的所有信息
wmic /output:d:\\tmp\\proc.csv process
# 获取指定进程的命令行参数和内存大小
wmic /output:d:\\tmp\\proc.csv process where name=\"java.exe\" get commandline,workingsetsize
# Note
# 如果output指定的文件被其他程序打开,会报错:Invalid file name.
@codeachange
codeachange / RateLimiter.java
Created December 29, 2017 06:58
RateLimiter频率限制器令牌桶算法
package com.base.framework.utils;
import com.base.framework.exception.AppException;
import org.springframework.data.redis.core.RedisTemplate;
import java.util.concurrent.TimeUnit;
/**
* 频率限制器
* 令牌桶算法
@codeachange
codeachange / AsyncHttpClientTest.java
Created December 20, 2017 10:49
async http client test
package com.example.test;
import org.asynchttpclient.*;
import java.net.ConnectException;
import java.util.concurrent.TimeoutException;
import static org.asynchttpclient.Dsl.asyncHttpClient;
import static org.asynchttpclient.Dsl.proxyServer;
@codeachange
codeachange / maven_dependency.sh
Created November 29, 2017 08:19
哪个dependency引入了某个jar包?
哪个dependency引入了某个jar包?
mvn dependency:tree -Dverbose -Dincludes=org.apache.httpcomponents:httpclient::
https://stackoverflow.com/a/4600861/2199283
maven assembly pulls wrong dependency?
https://stackoverflow.com/questions/13849854/maven-assembly-pulls-wrong-dependency
@codeachange
codeachange / observable_in_plain_js.js
Last active November 7, 2017 16:56
observable in plain javascript
// =========== observable ================
var observable = Rx.Observable.create(function subscribe(observer) {
// Keep track of the interval resource
var intervalID = setInterval(() => {
observer.next('hi');
}, 1000);
// Provide a way of canceling and disposing the interval resource
return function unsubscribe() {
clearInterval(intervalID);
wget https://dl.eff.org/certbot-auto
chmod a+x ./certbot-auto
./certbot-auto
# cron job
0 0 1 * * /opt/certbot-auto renew >> /var/log/certbot-renew.log
# Reference
# https://certbot.eff.org/docs/install.html#certbot-auto
@codeachange
codeachange / reliable_ssh.md
Last active October 1, 2017 16:06
ssh timeout reliable

To get your configuration working, make these configuration changes on the client:

/etc/ssh/ssh_config

Host *
  ServerAliveInterval 100  

ServerAliveInterval The client will send a null packet to the server every 100 seconds to keep the connection alive

@codeachange
codeachange / kill_a_freeze_ssh.sh
Created September 30, 2017 06:32
kill a freeze ssh session
Type the following key sequence: Enter, ~, .. On US keyboards, the tilde (~) is Shift+`.
SSH Escape Characters
https://linux.die.net/man/1/ssh