kafka basic, command

kafka basic, command kafka_2.13-3.4.0.tgz scala 版本 2.13 kafka 版本 3.4.0 consumer 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 bin/kafka-console-consumer.sh --topic topic0 --bootstrap-server 127.0.0.1:9092 # 指定 consumer group bin/kafka-console-consumer.sh --topic topic0 --bootstrap-server 127.0.0.1:9092 --group group0 # ssl bin/kafka-console-consumer.sh --topic topic0 --bootstrap-server 127.0.0.1:9092 --consumer.config config.json # auto_offset_reset="earliest" bin/kafka-console-consumer.sh --topic topic0 --from-beginning --bootstrap-server localhost:9092 bin/kafka-console-consumer.sh \ --bootstrap-server kafka.wiloon.com:9092

docker registry

docker registry install registry 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 mkdir -p /data/docker-registry/ # sample, https://docs.docker.com/registry/configuration/ cat > /data/docker-registry/config.yml << EOF version: 0.1 log: fields: service: registry storage: delete: enabled: true blobdescriptor: inmemory filesystem: rootdirectory: /var/lib/registry http: addr:

kde config

kde config 快捷键 功能 key krunner alt+space 快捷键设置 System Settings>shortcuts 多显示器 任务栏 https://superuser.com/questions/905591/kde-taskbar-task-manager-only-on-vga-screen-not-dvi-screen/906725 Right-click on the panel -> Panel Settings then drag the Screen Edge bar to the bottom of the screen to move the panel. Then right click on the panel -> Add Widgets -> Double-click on Task Manager. Then right-click somewhere near the middle of the

compact/extract 压缩/解压

compact/extract 压缩/解压 解压多个文件 1 2 ls *.gz|xargs -t -n1 gunzip gunzip *.gz .rar 1 2 3 4 5 6 # 解压 unrar x foo.rar # 压缩 rar e FileName.rar # 解压 rar a FileName.rar 解压并指定输出目录 1 gunzip -c /data/tmp/foo.tar.gz | tar xf - -C /data/server/bar .7z 1 2 3 4

正则表达式, regex

正则表达式, regex 1 2 3 4 #PCRE # 10.0.0.0/8; 172.0.0.0/12; 192.168.0.0/16 ^[\d|\.|\/|;| ]+$ 元字符 描述 将下一个字符标记为一个特殊字符, 或一个原义字符, 或一个向后引用, 或一个八进制转义符。例如,&l

pve

“pve” 创建安装盘 U盘 wiloon.com/ventoy 1 dd bs=1M conv=fdatasync if=./proxmox-ve_*.iso of=/dev/XYZ 去除 Proxmox 企业源 1 2 3 4 apt update && apt install vim vim /etc/apt/sources.list.d/pve-enterprise.list #deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise 更新源 pve 6.x vi /etc/apt/sources.list 1 2 3 4 5 6 7 8 9 10 11 12 13 #deb http://ftp.debian.org/debian buster main contrib #deb http://ftp.debian.org/debian buster-updates main contrib # security updates

VirtualBox

VirtualBox 剪贴板共享 Settings> General> Advanced> Shared Clipboard: Bidirectional NAT 端口转发 虚拟机> 设置> 网络> 网卡1> 高级> 端口转发> 添加 名称: ssh 协议: TCP 主机I

Archlinux 安装 linux-lts 内核

Archlinux 安装 linux-lts 内核 Archlinux 如果做服务器用的话, 最好安装 LTS 内核, 否则…说不定哪次更新之后, 服务就起不来了, 比如最近遇到的 linux 5.19.1 和 netavark 的兼容问题.

git reset

git reset 1 2 3 4 5 6 7 8 9 10 # reset 最近一次 commit git reset --hard HEAD^ git reset --hard HEAD~1 # reset 最近两次 commit git reset --hard HEAD~2 # reset 到某一个 commit, 退到/进到 指定 commit_id git reset --hard commit_id git reset --soft HEAD^ 进行了错误的提交,

openwrt basic, opkg basic, ipk

openwrt basic, opkg basic, ipk commands 1 2 3 # 更新所有软件,包括 OpenWRT 内核、固件等 opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade wan dns 在 wan 口设置里的“高级设置”选项里去掉"使用端局通

resolv.conf, systemd-resolved, DNS

resolv.conf, systemd-resolved, DNS 1 2 3 4 5 6 7 8 9 10 11 # check systemd-resolved status resolvectl status resolvectl restart # disable dns on 53 port vim /etc/systemd/resolved.conf #switch off binding to port 53 DNSStubListener=no # disable LLMNR LLMNR=false https://cloud-atlas.readthedocs.io/zh_CN/latest/linux/redhat_linux/systemd/systemd_resolved.html 测试 域名解析 1 2 resolvectl query baidu.com resolvectl query google.com 配置 1 2 3 4 5 6 7 8 9 10 11 12

wireguard

wireguard wireguard default port: 51820 install archlinux archlinux 新版本的内核已经集成了 wireguard,不需要单独安装. load kernel module at boot 1 2 3 4 vim /etc/modules-load.d/wireguard.conf # load wireguard module at boot wireguard 1 2 3 4 5 6 pacman -Syu # 安装 wireguard 管理工

xfce

xfce disable taskbar items grouping Right click on the taskbar, select Panel -> Panel Preferences Select the Items tab , select Window Buttons in the list, click the Edit button on the right side Change Window grouping to Never xfce 快捷键 1 ctrl+F1 #切换工作区 列出已经配置的快捷键 1 xfconf-query -c xfce4-keyboard-shortcuts -l -v|grep thunar 修改

systemd timer, 定时任务

systemd timer, 定时任务 1 2 3 # 查看 timer systemctl list-timers systemctl list-timers --all 创建一个服务 1 vim /etc/systemd/system/foo.service 1 2 3 4 5 6 7 [Unit] Description=foo service [Service] ExecStart=/path/to/foo.sh [Install] WantedBy=multi-user.target 再创建一个对应的 timer, /etc/systemd/system/foo.timer 1 vim /etc/systemd/system/foo.timer 1 2 3 4 5 6 7 8 9 10 11 [Unit] Description=foo timer [Timer] #

fcitx

fcitx 繁体简体转换快捷键 addon 里找 繁体简体转换,修改快捷键 配置文件 1 vim ~/.config/fcitx/config 在线造词 (词组最长为10个汉字) 在中文输入方式下按 CTRL+8, 则利用将刚刚输入的内容造

DataGrip

DataGrip console 中使用变量 1 2 3 4 select * from public.actor where actor.actor_id < ${a} 导出建表语句 打开DataGrip、找到目标表 选中之后右键点击SQL Scripts→SQL Generator. 就可以看到建

android 自动充电

android 自动充电 Chanify 消息推送工具 https://github.com/chanify/chanify-ios/blob/main/README-zh_CN.md 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 # sample podman run -it \ -v /my/data:/root/.chanify \ wizjin/chanify:latest \ serve --name=<node name> --endpoint=http://<address>:<port> # podman podman run -it \ -d --name chanify \ -p 30080:80 \ -v chanify-data:/root/.chanify \ wizjin/chanify:latest \ serve --name=chanify0

磁盘扩容, PVE, Archlinux

磁盘扩容 PVE ext4 virtualbox ext4 disk resize PVE archlinux xfs disk resize 虚拟机关机 在 PVE 控制台给虚拟机磁盘扩容:Hardware> Hard Disk> Disk Action> resize: 填写新增的容量 启动虚拟机 SSH 登录之后 sudo fdisk

ssh-agent, ssh agent, ssh forward

ssh-agent, ssh agent, ssh forward ssh agent forward A > B > C 主机 A:运行 ssh-agent,并且已经加载私钥 主机 B:跳板机 主机 C: 目标机,已经配置好公钥,并且运行 sshd 检查主机 A ssh-agent

bitwarden

bitwarden auto fill chrome extension> bitwarden> settings> option> autofill> enable auto-fill on page load podman server 1 2 3 podman pull vaultwarden/server:1.28.1-alpine podman run -d --name bitwarden -v bitwarden-data:/data/ -p 8000:80 vaultwarden/server:1.28.1-alpine docker run -d --name bitwarden --restart=always -v bitwarden-data:/data/ -p 8000:80 vaultwarden/server:1.28.1-alpine 测试一下,直接用浏览器访问 80 端口应该能看到 bitwarden 的登录页面