Skip to content

Instantly share code, notes, and snippets.

View yangl's full-sized avatar
🎯
Focusing

YANGLiiN yangl

🎯
Focusing
View GitHub Profile
#! /bin/sh
APP_NAME="SonarQube"
# Location of the pid file.
PIDDIR="${PIDDIR-.}"
# By default, java from the PATH is used, except if SONAR_JAVA_PATH env variable is set
findjava() {
if [ -z "${SONAR_JAVA_PATH}" ]; then
@yangl
yangl / grep_by_file_conent.md
Created October 24, 2024 09:04
按文件内容查找

查找实现IMessageConsumeListener IStringMessageConsumeListener IConsumerListener IByteArrayMessageConsumeListener的java类问题

grep -rl --include=*.java -e "implements * IMessageConsumeListener" -e "implements * IStringMessageConsumeListener" -e "implements * IConsumerListener" -e "implements * IByteArrayMessageConsumeListener" .
@yangl
yangl / mysql_client_server_diff_timezone.md
Last active October 24, 2024 06:49
MySQL客户端与服务端时区不一致问题解决方案

满足如下三点即可:

  1. mysql的jdbc链接确保有配置connectionTimeZone及forceConnectionTimeZoneToSession=true;
  2. springboot启动前配置默认时区及local;
  3. mysql-connector-j驱动使用8.0.33 注:mysql-connector-j驱动8.0.23之前版本有时区bug。
CREATE TABLE `date_time_ts` (
	`long1` BIGINT(20) NULL DEFAULT NULL,
	`string1` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_bin',
@yangl
yangl / templating-maven-plugin.md
Last active January 24, 2024 03:22
动态生成版本号工具

1. 添加依赖

<build>
        <plugins>
            <plugin>
                <groupId>io.github.git-commit-id</groupId>
                <artifactId>git-commit-id-maven-plugin</artifactId>
                <version>7.0.0</version>
                <executions>
                    <execution>
@yangl
yangl / spring-javaformat.md
Last active January 24, 2024 03:22
spring-javaformat
@yangl
yangl / jvm_showSettings.md
Created October 16, 2023 09:26
jvm查看容器内cpu mem
java -XshowSettings:system -version
Operating System Metrics:
    Provider: cgroupv1
    Effective CPU Count: 16
    CPU Period: 100000us
    CPU Quota: 1600000us
@yangl
yangl / init.gradle
Created September 1, 2023 07:16
init.gradle
allprojects {
repositories {
maven {
allowInsecureProtocol = true
url = 'https://maven.aliyun.com/repository/public'
}
def REPOSITORY_URL = 'https://maven.aliyun.com/repository/public/'
//做一些国外不稳定的地址连接的替换
@yangl
yangl / mm2.md
Created August 3, 2023 02:31
mm2消费组位点转换
// 限制:消费组必须是存储在__offset主题中存活的,不然不会生产checkpoint从而导致没法转换!

RemoteClusterUtils.translateOffsets(new MirrorSourceConfig(props).targetAdminConfig("ROLE_ID"), sourceClusterAlias, "消费组ID", Duration.ofSeconds(10));

OffsetSyncStore

OptionalLong translateDownstream(String group, TopicPartition sourceTopicPartition, long upstreamOffset) {
        if (!readToEnd) {
@yangl
yangl / spotless-maven-plugin.xml
Created May 15, 2023 03:02
palantir-java-format is supported by spotless out of the box. https://github.com/palantir/palantir-java-format
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<configuration>
<java>
<palantirJavaFormat>
<!-- Optionally specify a version -->
<version>${palantirJavaFormat.version}</version>
</palantirJavaFormat>
$ go build -a -toolexec $(go env GOPATH)/bin/sqreen-instrumentation-tool my-project

$ GOFLAGS="-a -toolexec $(go env GOPATH)/bin/sqreen-instrumentation-tool"
$ go build my-project