Skip to content

Instantly share code, notes, and snippets.

网络常用命令

查看局域网冲突ip,以及mac地址

sudo arp-scan --localnet \
| awk 'NR>2 && $1~/^[0-9]+\./ { ip=$1; mac=$2; cnt[ip]++; macs[ip]=(ip in macs)?macs[ip]","mac:mac } END { for(i in cnt) if(cnt[i]>1) printf "%s %d %s\n", i, cnt[i], macs[i] }' \
| sort -k2,2nr
@twelvejie
twelvejie / omarchy.md
Last active September 19, 2025 14:45

omarchy配置

输入法

#安装fcitx5-configtool  fcitx5-rime
sudo pacman -Sy fcitx5-configtool  fcitx5-rime rime-luna-pinyin

添加中文输入

  1. 命令行运行 fcitx5-config-qt

cgroups

检查cgroups

参考资料:安装 配置

grep -i cgroup /proc/mounts

安装

sudo yum install libcgroup

mydumper 常用命令

源文档

导出数据

mydumper -h 11.22.33.44 -u root -P3307 -p pAssw0rd -B myschema -t 4 -o myschema_dump/

导入数据

myloader -h <cluster_dns_endpoint> -u master -p pAssw0rd -P 3307 -B myschema -t 4 -d myschema_dump

从 mysql 导出到 pg

# vim my.load
LOAD DATABASE
         FROM      mysql://root:[email protected]:3307/demo_db?useSSL=false
         INTO      postgresql://postgres:123123@@[email protected]:5432/postgres?demo_db
with prefetch rows = 500
WITH include drop, create tables, create indexes, workers = 1, concurrency = 1
;
# 运行

常用(需要先安装fisher)

prompts
  1. tide
# 安装
fisher install IlanCosman/tide@v6
# 配置
tide configure

所有常用插件

常用语句

进程连接
  1. 查看表是否在使用 如果查询结果为空。则证明表没有在使用
show open tables where in_use > 0 ;
  1. 显示用户正在运行的进程 除了 root 用户能看到所有正在运行的进程外,其他用户都只能看到自己正在运行的线程,看不到其它用户正在运行的进程。
show processlist;

数据相关工具

数据库模型建模工具
  1. pdmaner, 蓝奏云下载
数据库连接
  1. dbeaver(推荐,可以连接很多数据库)
  2. navicate (可以比对数据库结构)
  3. DbVisualizer (还没咋使用)
  4. heidisql (小巧,只有win,linux可以使用)
  5. Jailer (方便查数据,以及数据之间的关系,需要事先自定义)

ssh端口转发 转发的端口:localhost:需要转发的端口

ssh -L  8086:localhost:8086 [email protected]

iptable端口转发 所有经过63306的流量转发到 192.168.1.2:3306

iptables -t nat -A PREROUTING -p tcp --dport 63306 -j DNAT --to-destination 192.168.1.2:3306

socat端口转发 所有经过81的流量转发到 127.0.0.1:80 应该可以用iptable实现