ls command

ls command ls 默认列出当前目录的内容, ls 是 list 的缩写 ls 命令默认会按照文件名字母序排序 find $PWD | xargs ls -ld ls -lrth # -l 默认按文件名排序 ls -l # 只列出目录 ls -d foo* ls -dl foo* ls -l | grep ^d # 子目录所有文件 ls -lR|grep ^- ls -lR|grep ^-|awk '{print $9}' # 列出重复的行 ls -lR|grep ^-|awk '{print $9}'|sort|uniq -d 参数 -l 除文件名称外,亦将文件型态、权限、拥有者、文件大小等资讯详细列出 -t 选项,将首先按照文件的最后修改时间排序 (时间越新越靠前) ,之后再按字母顺序排 -i 打印出文件的 inode -R 列出所有子目录 -L 当文件是软链接时, 直接显示被链接的文件的信息 -T 结合 -l 可将时间显示为 hh:mi:ss 的形式,但不会按时间排序,因而不会影响默认字母排序 -S 按文件大小排序,越大越靠前 -u 结合 -l 选项可以看到每个文件最后被访问的时间,并且也会按该时间排序 以上影响排序的选项如果结合 -r 选项一起使用,则按相反顺序排列 ...

2022-11-17 · 1 min · 87 words · -

scrum poker, 点数估算

scrum poker Scrum Poker Cards (Agile) Android, iOS https://artarmin.com/embed/#?secret=jkb2vbmib7 scrum poker online, 在线点数估算 https://www.scrumpoker-online.org/en/room/04930078

2022-11-17 · 1 min · 14 words · -

chrome weak up api, keep screen on, 屏幕常亮

chrome weak up api, keep screen on, 屏幕常亮 chrome: enable-experimental-web-platform-features web 页面支持 https 才能使用 wake lock api android: 系统开启开发者模式 chrome 74 chrome://flags/#enable-experimental-web-platform-features Note: Like most other powerful web APIs, the Wake Lock API is only available when served over HTTPS. chrome 79+ Chrome Updates Experimental Wake Lock API Support https://www.infoq.com/news/2019/11/chrome-wakelock-api/#:~:text=The%20Wake%20Lock%20API%20prevents%20some%20aspect%20of,this%20feature%2C%20adding%20promises%20and%20wake%20lock%20types. To use the Wake Lock API, developers need to enable the #enable-experimental-web-platform-features flag in chrome://flags. chrome://flags enable-experimental-web-platform-features keep-screen-on.js export function wakeLock () { if ('wakeLock' in navigator && 'request' in navigator.wakeLock) { console.log('wakeLock supported') try { navigator.wakeLock.request('screen') console.log('Wake Lock is active') } catch (e) { console.error(`${e.name}, ${e.message}`) } } else { console.log('no wakeLock support') } } vue script <script lang="ts"> import HelloWorld from './components/HelloWorld.vue' import { Component, Vue } from 'vue-property-decorator' import { wakeLock } from './assets/keep-screen-on.js' @Component({ components: { HelloWorld } }) export default class App extends Vue { drawer = false foo = '' mounted () { this.$vuetify.theme.dark = true wakeLock() } } </script> demo https://wake-lock-demo.glitch.me/ ...

2022-11-08 · 1 min · 170 words · -

三菱欧蓝德, Outland

三菱欧蓝德, Outland 机油 机油:矿物质 5000km,半合成 7500km,全合成 8000-10000km,平时行使道路越畅通,机油时效越长, 驾驶沉稳不经常暴力的,全年使用0W-20没问题(强烈推荐),此机油也特别适合北方冬季使用, 时常习惯开快车的建议全年 5W-30, 天天开暴力机车的,建议 5W-40;2,机油格(机油滤清器):每次换机油必须一同更换; 矿物机油 矿物机油以石油提炼的矿物油为基础,然后添加添加剂制造而成。矿物机油最普通,整体性能一般,价格最便宜,主要用于中低端车型,一般车辆每跑5000公里或者半年时间一换,时间和公里数以先到者为准; 全合成机油 全合成机油是化学合成的机油,成本较高,它的高低温性、高速润滑效果非常突出,一般用于中高档车型。涡轮增压车型因为其转速高、扭矩变化大,基本都是推荐使用全合成机油。全合成机油一般每10000公里或者一年一换,相比矿物机油更耐用,更换周期更长。 半合成机油介于矿物油和全合成机油之间,本身由矿物机油和全合成机油以4:6比例混合而成。一般每7500公里或者9个月一换。 时间或者公里数达到后尽快去更换机油,最好是不要超出1000-2000的公里,超过2000公里因为机油润滑保护作用的下降,继续使用将损害发动机。 0W-20, 5W-30 0W 的机油会在 -35℃ 的时候结冰 5W 代表耐外部低温 -30°C 20W 耐低温为 -15°C 前面的数字越小说明机油的低温流动性越好,代表可供使用的环境温度越低,在冷启动时对发动机的保护能力越好,如 5W 代表耐外部低温 -30°C,而 20W 耐低温为 -15°C。W 后面的数字代表机油在 100℃ 时的运动粘度,数值越高说明粘度越高。40 代表 100 摄氏度时运动粘度标准为 12.5mm2/s 到 16.3mm2/s 之间 根据说明书选择。原厂机油一般是厂家根据车辆发动机活塞与缸体间隙来选定,如换用高型号的机油,会使发动机有一定磨损。 根据公里数逐渐增加型号。前10万公里完全可以用20的机油,10 万到 20 万可以选择 30 的机油,20 万以后选择 40 的机油。但如果之前一直使用高型号的机油,建议最好还是不要降低型号。 根据使用地点选择型号。需要根据机油冷启动性能的指标来选择,比如你要是在南方,用5甚至10的绝对没有问题,如果在北部,最好用5甚至0开头的。 机滤 每次换机油的时候一起换; 机油滤芯也叫“机油滤清器”,其上游是机油泵,下游是发动机中需要润滑的各零部件。 轮胎 225 55 R18 胎压 240 kPa 2.4 bar 34.8 psi 三菱欧蓝德乘用车的原厂胎压标准是 2.3-2.5bar 都属于正常范围,最高不要超过3.0,最低不要低于2.1, 高一点没关系,但是低压非常危险。冷车和空车时测量胎压最为准确,如果低压非常低就该检查轮胎是否有漏气现象,不分前后轮,因为乘用车一般不存在承重问题, 胎压过大,会导致,轮胎与地面的基础面降低,可以降低油耗,但是也会影响制动力,胎压过低,会导致,轮胎侧壁直接磨损地面,过快,或过久行驶,导致侧壁破裂,甚至爆胎。 ...

2022-10-28 · 1 min · 111 words · -

ssh command, openssh

ssh command, openssh 端口转发 ssh 不登陆直接执行命令 openssh 9.0 sftp-server options, 参数 -T: 禁止分配伪终端, Disable pseudo-terminal allocation -t 或 -tt: 强制分配伪终端, Force pseudo-terminal allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu servi ces. Multiple -t options force tty allocation, even if ssh has no local tty -f:后台执行ssh指令 -N:不执行远程指令 -L listen-port:host:port 指派本地的 port 到达端机器地址上的 port, 建立本地SSH隧道(本地客户端建立监听端口), 将本地机(客户机)的某个端口转发到远端指定机器的指定端口. -v: verbose -vv: verbose -o: 指定配置选项, 具体参数看 “配置选项” 配置选项 StrictHostKeyChecking=no 忽略主机密钥验证 ssh -vv -T -oKexAlgorithms=ecdh-sha2-nistp521 git@foo.com KexAlgorithms: key exchange algorithm commands # 指定 shell 可以解决 This account is currently not available. sudo -u username -s /bin/bash ssh 不登陆直接执行命令 ssh root@192.168.50.31 "whoami" # 也可以用单引号 ssh root@192.168.50.31 'whoami' 指定私钥, 指定密钥 ssh -i /path/to/id_rsa 测试 ssh -T git@github.com ssh 强制使用密码登录, force ssh client to use only password auth ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no 192.168.50.1 -l root #debian sudo apt-get install openssh-server #archlinux sudo pacman -S openssh sudo /etc/init.d/ssh start|stop|restart ssh IP ssh IP -p 1234 -l root # ssh version ssh -V ubuntu sudo apt install openssh-server sudo systemctl start sshd -A option enables forwarding of the authentication agent connection There is a shortcut to archive this, if we don’t want to create a config file, we have another option, using -A flag with the ssh command. ...

2022-10-20 · 4 min · 765 words · -

lsof command

lsof command lsof means ‘List Open Files’ List all open files on the system or open files for specified PID 查看一个进程打开了哪些文件 #PID: 1098 sudo lsof -p 1098 ## 查看进程打开了哪些端口 # 以上命令返回的数据里 有 TCP 字样的就是 socket, 能看到端口号 install lsof # archlinux pacman -Sy lsof # ubuntu apt-get install -y lsof # centos yum install lsof -y 命令参数 -p <进程ID> 列出指定进程ID所打开的文件 -a 列出打开文件存在的进程 -c <进程名> 列出指定进程所打开的文件 -g 列出GID号进程详情 -d <文件号> 列出占用该文件号的进程 +d <目录> 列出目录下被打开的文件 +D <目录> 递归列出目录下被打开的文件 -n <目录> 列出使用NFS的文件 -i <条件> 列出符合条件的进程。4、6、协议、:端口、 @ip . -u 列出UID号进程详情 -h 显示帮助信息 -v 显示版本信息 查看 tcp 连接的建立时间 # 查看 tcp 连接 ss -nt|grep 50.32 # ESTAB 0 0 192.168.50.228:58048 192.168.50.32:2380 # 端口 :58048 lsof -i:58048 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME etcd 975 root 79u IPv4 8267566 0t0 TCP k8s0:58048->k8s2:2380 (ESTABLISHED) ...

2022-10-12 · 5 min · 855 words · -

docker registry

docker registry install registry # sample, https://docs.docker.com/registry/configuration/ cat > /usr/local/etc/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: :5000 headers: X-Content-Type-Options: [nosniff] health: storagedriver: enabled: true interval: 10s threshold: 3 EOF # https://hub.docker.com/_/registry # docker docker run -d \ --restart=always \ -v /usr/local/etc/docker-registry-config.yml:/etc/docker/registry/config.yml \ -p 5000:5000 \ --name docker-registry \ -v docker-registry:/var/lib/registry \ registry:2.8.3 # podman podman run -d \ -v /usr/local/etc/docker-registry-config.yml:/etc/docker/registry/config.yml \ -p 5000:5000 \ --name registry \ -v docker-registry:/var/lib/registry \ registry:2.8.3 buildah tag de3ebb1b260b registry.wiloon.com/pingd-proxy:v0.0.1 buildah push registry.wiloon.com/pingd-proxy:v0.0.1 podman pull registry.wiloon.com/pingd-proxy:v0.0.1 registry.wiloon.com/pingd-proxy registry.wiloon.com/ping-proxy docker 测试 sudo docker image tag hello-world registry.wiloon.com/myfirstimage sudo docker image ls sudo docker push registry.wiloon.com/myfirstimage sudo docker image rm hello-world sudo docker pull registry.wiloon.com/myfirstimage sudo docker image ls nginx config ...

2022-10-10 · 2 min · 240 words · -

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 panel -> Task Manager Settings -> Only show tasks from the current screen ...

2022-10-02 · 1 min · 141 words · -

正则表达式, regex

正则表达式, regex # PCRE # 10.0.0.0/8; 172.0.0.0/12; 192.168.0.0/16 ^[\d|\.|\/|;| ]+$ 元字符 描述 将下一个字符标记为一个特殊字符, 或一个原义字符, 或一个向后引用, 或一个八进制转义符。例如,“n” 匹配字符 “n”。"\n" 匹配一个换行符。 [中括号] []是定义匹配的字符范围 [xyz] 字符集合。匹配所包含的任意一个字符。例如,"[abc]"可以匹配"plain"中的"a"。 [^xyz] 负值字符集合。匹配未包含的任意字符。例如,"[^abc]"可以匹配"plain"中的"p"。 [a-z] 字符范围。匹配指定范围内的任意字符。例如,"[a-z]"可以匹配"a"到"z"范围内的任意小写字母字符。 [^a-z] 负值字符范围。匹配任何不在指定范围内的任意字符。例如, "[^a-z]"可以匹配任何不在"a"到"z"范围内的任意字符。 [A-Za-z0-9] 数字和26个英文字母组成的字符串 {大括号} {} 一般用来表示匹配的长度, 比如 \s{3} 表示匹配三个空格,\s{1,3} 表示匹配一到三个空格。 PCRE PCRE: Perl-compatible regular expressions ^ 匹配字符串的开始位置 $ 匹配字符串的结束位置 \ 将下一个字符标记为一个特殊字符(File Format Escape)、或一个原义字符(Identity Escape,有 ^$()*+?.[{| 共计12个)、或一个向后引用(backreferences)、或一个八进制转义符。例如,“n”匹配字符“n”。“\n”匹配一个换行符。序列“\”匹配“\”而“(”则匹配“(”。 . 匹配除 \r \n 之外的任何单个字符。要匹配包括 \r \n 在内的任何字符,请使用像 (.|\r|\n) 的模式。 * 匹配前面的子表达式零次或多次。例如,zo能匹配“z”、“zo”以及“zoo”。等价于{0,}。 + 匹配前面的子表达式一次或多次。例如,“zo+“能匹配"zo"以及"zoo”,但不能匹配"z”。+等价于{1,}。 (pattern) 匹配pattern并获取这一匹配的子字符串。该子字符串用于向后引用。所获取的匹配可以从产生的Matches集合得到,在VBScript中使用SubMatches集合,在JScript中则使用$0…$9属性。要匹配圆括号字符,请使用“(”或“)”。可带数量后缀。 ? 匹配前面的子表达式零次或一次。例如,“do(es)?“可以匹配"does"或"does"中的"do”。?等价于{0,1}。 {n} n 是一个非负整数。匹配确定的 n 次。例如,“o{2}“不能匹配"Bob"中的"o”,但是能匹配"food"中的两个o。 {n,} n 是一个非负整数。至少匹配n次。例如,“o{2,}“不能匹配"Bob"中的"o”,但能匹配"foooood"中的所有o。“o{1,}“等价于"o+"。“o{0,}“则等价于"o_"。 {1,3} 匹配一次到三次 linux 测试正则表达式 https://anjia0532.github.io/2017/06/29/nginx-regex-test-way/ ...

2022-09-15 · 3 min · 601 words · -

VirtualBox

VirtualBox 显存 使用 4k 显示器的时候如果 virtualbox 显存设置的太小, 会导致黑屏. 剪贴板共享 Settings> General> Advanced> Shared Clipboard: Bidirectional NAT 端口转发 虚拟机> 设置> 网络> 网卡1> 高级> 端口转发> 添加 名称: ssh 协议: TCP 主机IP/host ip: 0.0.0.0 主机端口: 22 子系统IP: 10.0.2.15 子系统端口: 22 archlinux guest 在 virtual box 内安装的 archlinux, 需要安装 virtualbox-guest-utils, 可以获得更流畅的图形界面, 如 virtual 的无缝模式。 # for VirtualBox Guest utilities with X support sudo pacman -S virtualbox-guest-utils # for VirtualBox Guest utilities without X support sudo pacman -S virtualbox-guest-utils-nox # 启用 vboxservice, 否则无缝模式(seamless mode)的选项会是灰色的不可用状态 sudo systemctl --now enable vboxservice.service 剪贴板共享默认是关闭的, 在这里打开: Settings > General > Advanced > Shared Clipboard ...

2022-08-25 · 2 min · 347 words · -

openwrt basic, opkg basic, ipk

openwrt basic, opkg basic, ipk commands # 查看 openwrt 版本 cat /etc/openwrt_release # 更新所有软件,包括 OpenWRT 内核、固件等 opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade wan dns 在 wan 口设置里的“高级设置”选项里去掉"使用端局通告的DNS服务器"的勾选就可以使用自定义的DNS服务器 ssh port vim /etc/init.d/dropbear validate_section_dropbear > port ssh public key vim /etc/dropbear/authorized_keys dns 配置 查看本机的 DNS 配置: $ cat /etc/resolv.conf search lan nameserver 127.0.0.1 发现使用的是本机 DNS 服务器,即 dnsmasq。 查看 dnsmasq 配置: $ cat /etc/dnsmasq.conf 手动指定上游 dns vi /etc/dnsmasq.conf server=223.5.5.5 server=223.6.6.6 openwrt 改IP vi /etc/config/network opwnert init opkg install coreutils-nohup opkg install ipset opkg remove dnsmasq opkg install dnsmasq-full openwrt cron /etc/init.d/cron start /etc/init.d/cron enable crontab -e crontab -l x86, firmware download https://downloads.openwrt.org/releases/19.07.6/targets/x86/ ...

2022-08-11 · 3 min · 483 words · -

resolv.conf, systemd-resolved, DNS

resolv.conf, systemd-resolved, DNS # 查看版本 systemd-resolve --version # 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 测试 域名解析 resolvectl query goproxy.cn resolvectl query baidu.com resolvectl query google.com 配置 vim /etc/systemd/resolved.conf [Resolve] # DNS: 上游的 dns 服务器, 可以配置多条, 用空格分隔 DNS=192.168.50.1 # FallbackDNS: 一个空格分隔的 IPv4 与 IPv6 地址列表。用作系统的替补 DNS 服务器。此选项所设置的 DNS 服务器仅在实在找不到可用 DNS 的情况下才会被使用。 FallbackDNS=223.5.5.5 223.6.6.6 114.114.114.114 #Domains= #LLMNR=yes #MulticastDNS=yes #DNSSEC=allow-downgrade #DNSOverTLS=no #Cache=yes #DNSStubListener=yes #ReadEtcHosts=yes # 重启服务 systemctl restart systemd-resolved # check systemd-resolved status resolvectl status # 确认状态 systemd-resolve --status link ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf archlinux ...

2022-08-03 · 1 min · 139 words · -

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 快捷键 ctrl+F1 #切换工作区 列出已经配置的快捷键 xfconf-query -c xfce4-keyboard-shortcuts -l -v|grep thunar 修改 Applications> Settings> keyboard> application shortcuts passwordless login, xfce 免密码登录 https://wiki.archlinux.org/title/LightDM#Enabling_interactive_passwordless_login https://github.com/sgerrand/xfce4-terminal-colors-solarized /home/user0/.config/xfce4/terminal/terminalrc colorCursor=#93a1a1 ColorForeground=#839496 ColorBackground=#002b36 ColorPalette=#073642;#dc322f;#859900;#b58900;#268bd2;#d33682;#2aa198;#eee8d5;#002b36;#cb4b16;#586e75;#657b83;#839496;#6c71c4;#93a1a1;#fdf6e3 https://ethanschoonover.com/solarized/ https://github.com/altercation/solarized archlinux 登录后启动xfce4 https://wiki.archlinux.org/index.php/xinitrc ...

2022-07-12 · 1 min · 102 words · -

DataGrip

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

2022-07-03 · 1 min · 17 words · -

android 自动充电

android 自动充电 Chanify 消息推送工具 https://github.com/chanify/chanify-ios/blob/main/README-zh_CN.md # 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 --endpoint=https://chanify.wiloon.com # docker docker run -it -d \ --name chanify \ --restart=always \ -p 30080:80 \ -v chanify-data:/root/.chanify \ wizjin/chanify:latest \ serve --name=chanify0 --endpoint=https://chanify.wiloon.com 启动服务配置好 nginx 之后, 在浏览器访问 https://chanify.wiloon.com, 能看到 endpoint 的二维码, 用 iOS chanify 客户端扫二维码添加节点. 切换到频道, 在频道上左滑查看 token 用自建的服务器发消息 curl --form-string "text=hello" "http://chanify.wiloon.com/v1/sender/<token>" curl "http://chanify.wiloon.com/v1/sender/<token>/msg0" 礼信通4芯数据传输 USB 定时开关遥控制器延长线智能 WIFI 电源数据 https://item.taobao.com/item.htm?spm=a1z09.2.0.0.3b462e8dwgAuy1&id=675291964059&_u=m2lc6g03a41 ...

2022-06-22 · 1 min · 166 words · -

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 是否已经在运行 ps -ef | grep ssh-agent 主机 A ssh-agent 已经加载了密钥 ssh-add -l 主机 A 允许入站连接上的 SSH 代理转发, 将 AllowAgentForwarding 的值设置为 yes,表示允许进行代理转发, openssh 中 AllowAgentForwarding 默认值即为yes,所以,如果配置没有修改过,保持默认即可。 vim /etc/ssh/sshd_config AllowAgentForwarding yes 主机 A ssh 配置 ForwardAgent yes vim ~/.ssh/config #content host * ForwardAgent yes 主机 B 不需要运行 ssh-agent, 也不需要配置 ssh 的 ForwardAgent yes, 主机 B 在使用 ssh agent forward 连接 主机 C 成功之后,会创建 环境变量 $SSH_AUTH_SOCK ...

2022-06-07 · 4 min · 661 words · -

socat

socat socat 测试端口连通性, test a remote port is reachable with socat # test tcp port socat /dev/null TCP:192.168.1.15:22 socat - tcp4:192.168.1.15:22,connect-timeout=3 # test udp port # https://serverfault.com/questions/416205/testing-udp-port-connectivity # set up a server listening on UDP port 1234 socat UDP-RECV:1234 STDOUT # or socat STDIO UDP-LISTEN:1234 # test udp port socat - UDP:localhost:1234 http server, 加载本地 .html 文件 echo "foo">foo.html socat -v -v TCP-LISTEN:8000,crlf,reuseaddr,fork SYSTEM:"echo HTTP/1.0 200; echo Content-Type\: text/plain; echo; cat foo.html" https://stackoverflow.com/questions/29739901/socat-fake-http-server-use-a-file-as-server-response ...

2022-04-19 · 3 min · 533 words · -

iproute2 > 路由表, routing table, ip route

iproute2 > 路由表, routing table, ip route commands ip route # 简写, Abbreviations # route: ro, r. # show: list, sh, ls, l. ip route ls tab all ip route Usage: ip route { list | flush } SELECTOR := 表示声明并定义 { xxx | xxx } 表示多选 - 必选 [] 表示可选 SPEC 应该是 specification 的缩写 NH 应该是 next hop 的缩写 PREFIX 就是地址加掩码的格式, 比如 0.0.0.0/0 PREFIX 有个 default 的特殊表示, 等同于 0.0.0.0/0, 也就是默认路由 路由表 linux 系统路由表可以自定义从 1-252 个路由表, 操作系统维护了 4 个路由表: ...

2022-02-11 · 14 min · 2819 words · -

tcpcopy, 流量复制

tcpcopy, 流量复制 公有云环境 https://github.com/session-replay-tools/tcpcopy/issues/336 云环境下,安全策略可能会干扰测试的进行 采用如下步骤可以规避麻烦: 测试机器和 intercept 部署到一台机器 tcpcopy端 -c 参数采用 tcpcopy 所在的线上机器ip地址 在线上机器设置iptables黑洞来过滤掉测试服务器的响应包 iptables -I INPUT -p tcp --sport 测试服务的端口 -j DROP -s 测试服务所在机器的ip地址 千万要注意在测试服务器不要设置路由了,否则会受到干扰 环境 测试用的 tcp 服务 tcp-echo-server 线上服务器, online source server, xxx.xxx.20.50 2000 端口提供服务 (tcp-echo-server) 测试服务器, 目标服务器, target server, xxx.xxx.20.45, 192.168.50.102 3000 端口提供服务 (tcp-echo-server), 不能跟 online server 用同一个端口 辅助服务器, assistant server, xxx.xxx.20.45, intercept 跟测试服务部署到同一个机器, 不使用单独的服务器 线上服务器安装 tcpcopy git clone https://github.com/session-replay-tools/tcpcopy.git cd tcpcopy ./configure --single make make install ls /usr/local/tcpcopy 辅助服务器 (intercept) 安装 git clone https://github.com/session-replay-tools/intercept.git cd intercept ./configure --single make make install ls /usr/local/intercept 实时复制流量 测试服务器 192.168.50.102 测试服务器不添加路由规则. ...

2022-02-11 · 3 min · 630 words · -

chrome command

chrome command # linux 启动浏览器并打开 URL google-chrome-beta gmail.com google-chrome-beta http://localhost:8080 https://stackoverflow.com/questions/28162697/how-can-i-open-google-chrome-from-the-terminal-with-the-url-localhost3000 Chrome 有很多的特性在界面菜单中是没有体现的,你可以通过 chrome:// 命令来访问。本文介绍 12 个非常有用的 chrome:// 命令: chrome://flags 可用来启用或者关闭某些 chrome 的体验特性 chrome://dns 该命令将显示浏览器预抓取的主机名列表 chrome://downloads 该命令同时也可以从菜单中的下载来访问,其快捷键是 Ctrl + J chrome://extensions 该命令等同于菜单 - 工具 - 扩展 chrome://bookmarks 改名了等同于菜单-书签-书签管理器,快捷键 Ctrl+Shift+O chrome://history 该命令可从菜单-历史直接访问,快捷键 Ctrl+H chrome://memory 该命令将重定向到 “chrome://memory-redirect/”. 它将显示浏览器使用内存的情况,以及系统中运行的其他浏览器,包括 firefox。同时还显示浏览器进程的详细信息。 chrome://net-internals 该命令显示网络相关信息,用来捕获浏览器生成的网络事件,可导出数据,可查看DNS主机解析缓存。 其中一个很重要的功能就是"测试",如果你无法访问某个网址,那么可以使用 “chrome://net-internals” -> 点击"Tests" tab -> 输入网址,并点击开始测试,Chrome 将报告具体的问题所在。 chrome://quota-internals 该命令用来显示浏览器所使用磁盘空间配额的情况。 chrome://sessions 该命令用来显示当前运行的浏览器的会话信息数以及详细列表 chrome://settings 该命令可通过菜单-选项直接访问,可用来控制浏览器各项设置值 chrome://sync-internals 用来显示 chrome 的同步状态 最后,如果你想查看 chrome 所有的命令,可使用 chrome://about/ ...

2022-01-22 · 1 min · 77 words · -