- 博客(240)
- 资源 (1)
- 收藏
- 关注
原创 logback 问题 ch.qos.logback.core.joran.spi.JoranException: Parser configuration error occurred
【代码】logback 问题 ch.qos.logback.core.joran.spi.JoranException: Parser configuration error occurred。
2023-10-12 17:06:12
1212
原创 /var/lib/docker/containers 日志清理
清理 /var/lib/docker/containers 日志注意 /var/lib/docker/ 为默认的 Docker RootDir#!/usr/bin/env bashsearch_dir=/var/lib/docker/containersfor entry in "$search_dir"/*do #echo $entry/$(basename $entry)-json.log > $entry/$(basename $entry)-json.logdone
2022-05-22 23:13:01
600
原创 docker build cache 清理
docker system df 查看root@ip-172-30-69-134 ~]# docker system dfTYPE TOTAL ACTIVE SIZE RECLAIMABLEImages 41 1 10.66GB 10.63GB (99%)Containers 1 1 0B 0BLocal Volumes 13
2022-04-15 21:06:06
3128
原创 gitlab 配置企业微信邮箱发送邮件
官网 dochttps://docs.gitlab.com/omnibus/settings/smtp.html#qq-exmail配置gitlab_rails['smtp_enable'] = truegitlab_rails['smtp_address'] = "smtp.exmail.qq.com"gitlab_rails['smtp_port'] = 465gitlab_rails['smtp_user_name'] = "xxxx@xx.com"gitlab_rails['sm
2022-03-15 14:17:43
1521
原创 bash: ./admin-domain: No such file or directory
问题背景docker中构建出来的 golang 二进制可执行文件,无法运行的问题。最后一个构建阶段用的是 FROM debian:stable-slim。问题root@26f0f39f2cf1:/app# lsadmin-domainroot@26f0f39f2cf1:/app# ./admin-domain bash: ./admin-domain: No such file or directoryroot@26f0f39f2cf1:/app# ldd admin-domain
2022-02-08 11:58:39
612
原创 aws-cli major version 判断
使用了两个版本的 cli 需要特别处理AWS_CLI_MAJOR_VERSION=$(aws --version 2>&1 | cut -d " " -f1 | cut -d "/" -f2 | cut -d "." -f1)if [ "$AWS_CLI_MAJOR_VERSION" = "1" ]; then echo "aws-cli verion is 1" $(aws ecr get-login --no-include-email --region cn-nor
2022-01-28 14:07:44
489
原创 macOS terminal 配置重置
backup~/Library/Preferences/com.apple.Terminal.plistremove com.apple.Terminal.plistReferenceshttps://superuser.com/questions/427154/reset-mac-os-x-terminal-to-default/448679
2022-01-05 10:29:10
1824
1
原创 docker-compose volumes Mounts 类型
"Mounts": [ { "Type": "bind", "Source": "/Users/x/GolandProjects/oss-investigation/seaweedfs/seaweedfs/docker/config.json", "Destination": "/etc/seaweedfs/s3.json", "Mode...
2021-12-01 16:24:14
1646
原创 mint20 终端安装 vscode
APT 相关APT RepoAn APT repository is a network server or a local directory containing deb packages and metadata files that are readable by the APT tools.一个存放 deb package 和 metadata 的地方。APT sources/etc/apt/sources.list file#deb cdrom:[Linux Mint 20 _U
2021-10-31 12:58:46
402
原创 bash string 转数字
使用 bc 命令bashv1=1.2.3v2='"1.2.3"' # v1 和 v2 是不相等的echo v1 is $v1echo v2 is $v2v3=$(echo $v2 | bc) # v2 转为数字echo v3 is $v3if [ $v1 == $v3 ]; then echo "equal"fi
2021-10-29 17:39:02
415
原创 docker mongodb backup and restore
container name: mongobackup# 使用 mongodump 备份sudo docker exec -i mongo /usr/bin/mongodump --db db_name --out /dump# 复制出来sudo docker cp mongo:/dump /mongo/dumprestore# 复制到容器中sudo docker cp /mongo/dump mongo:/dump# 使用 mongorestore 恢复sudo docker e.
2021-10-20 13:44:06
192
转载 How to fix docker: Got permission denied while trying to connect to the Docker daemon socket
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json: dial unix /var/run/docker.sock: connect: permission denied解决方法chmod 666 /var/run/docke
2021-09-17 14:44:44
151
原创 self-hosted github-runner ssh 登录其他主机
应用场景:自己搭建的 github runner,要使用这个 runner 去控制另一台机器,去做事情。准备把部署 github runner 的这台机器的 ssh public key 复制到要 ssh 登录到的目标机器部署 github runner 的这台机器的 ssh private key 添加到 github 的 secerts 里,在 actions 里要使用这个 private keyjobs: # This workflow contains a single job.
2021-09-01 19:55:57
409
转载 docker stop all containers
docker kill $(docker ps -q)停止所有 容器docker ps(list containers)[root@ip-172-30-69-214 test]# docker ps --helpUsage: docker ps [OPTIONS]List containersOptions: -a, --all Show all containers (default shows just running) # 不论状态,默认只是运行中的
2021-08-18 15:04:35
1726
原创 github Support for password authentication was removed on August 13, 2021.
问题描述remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.不再支持
2021-08-16 13:23:45
499
转载 U盘安装WIN10时显示 windows无法安装到这个磁盘 选中的磁盘采用GPT分区形式
安装时把 MBR 分区转为 GPT 分区参考链接:U盘安装WIN10时显示 windows无法安装到这个磁盘 选中的磁盘采用GPT分区形式
2021-08-07 10:51:22
2657
原创 gitlab + sonarqube OAuth2 流程梳理
References1. https://docs.sonarqube.org/latest/analysis/gitlab-integration/
2021-08-02 13:48:25
864
原创 mysql-innodb-index-page 图解
ReferencesMySQL 是怎样运行的:从根儿上理解 MySQL InnoDB数据页结构
2021-07-16 16:52:04
281
原创 CPU 占用过高,如何排查?
测试代码死循环,一直打印数字package com.example.demo;public class CPUHigh { public static void main(String[] args) { long count = 0; while (true){ System.out.println(count++); } }}排查步骤top 查看,哪一个进程 CPU 使用高%Cpu(s): 1
2021-06-25 09:38:30
332
原创 java.lang.OutOfMemoryError 类型
java.lang.OutOfMemoryError: java heap spaceheap 空间不足,对象分配在 heap 上。话说,为啥对象要分配在 heap 上,因为对象的大小在 compile-time 是无法确定的。不像基本的数据类型,如 int 是 4Bytes,这些在 compile-time 就可以确定要多少空间,分配在 stack 上。大对象分配vm options: -Xms8m -Xmx8mpackage com.example.demo;public cla
2021-06-24 11:16:59
156
原创 java-String 为什么设计成不可变?
Referencehttps://www.baeldung.com/java-immutable-objecthttps://www.baeldung.com/java-string-immutablehttps://www.artima.com/articles/james-gosling-on-java-may-2001#part13https://www.baeldung.com/java-string-pool
2021-06-15 13:55:21
1082
1
原创 sql-date_sub() 查询近三个月的数据
好记性不如烂笔头DATE_SUB(date, INTERVAL value interval) 函数select * from t_user where time > DATE_SUB(CURDATE(), INTERVAL 3 MONTH) --三月date = curdate()interval value = 3interval = month. 时间段Referencesdate_sub 函数...
2021-06-07 20:42:33
3099
原创 Flexible Array Members in a structure in C
Flexible Array Member(FAM)Flexible Array Member(FAM) is a feature introduced in the C99 standard of the C programming language.For the structures in C programming language from C99 standard onwards, we can declare an array without a dimension and whose
2021-05-31 16:10:50
252
原创 ip addr 结果表示啥?
ip addr[root@s101 net]# ip addr1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferr
2021-05-31 14:21:35
235
原创 VLAN 分割广播域(分组思想)
VLAN 是干啥的?Virtual Local Area Networks, or VLANs, segregate traffic within a network. VLANs keep traffic from different networks separated when traversing shared links and devices within a topology. This process, also known as VLAN tagging, is invaluable
2021-05-27 20:39:31
531
原创 使用条件运算符优化代码
分析环境x86-64 gcc 5.4条件运算符之前一直认为 条件运算符(?) 属于语法糖。其实并不是。代码分析c 语言int max(int x, int y){ return x > y ? x : y;}int max2(int x, int y){ if(x > y) return x; else return y;}C 和汇编代码对照由上图可见:max 中 ? 条件运算符编译后是顺
2021-05-17 17:03:31
105
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人