如何判断平台是x86还是arm

case $(uname -m) in
    x86_64)  echo x86;;
    aarch64) echo arm;;
esac

又水一篇

ref

  • 上面的代码片改自这里 https://stackoverflow.com/questions/48678152/how-to-detect-386-amd64-arm-or-arm64-os-architecture-via-shell-bash
  • uname -m详细版本 https://stackoverflow.com/questions/45125516/possible-values-for-uname-m/45125525#45125525
  • uname -s检测系统是win还是mac linux写法类似。
  • uname 介绍https://gohom.win/2015/06/12/uname-shell/

contacts

Read More

使用perl模块 graph easy 画图

graph-easy

两种装法

  • 从命令行安装(我没有网,没试过)
cpan install Graph::Easy
或者
perl -MCPAN -e shell
install Graph::Easy
  • 编译源码 下载地址 解压进入目录下

    perl Makefile.PL make make test make install

graph-easy文件在bin目录下,拷贝到usr/bin或者使用路径访问都可以

[hot data limit\n data cold out] ->
[consumed cold data enqueue\n pipe event write] -> 
[pipe event noticed,\n read and dequeue ]-> 
[thread pool add job\n do queuejob asyc]

生成图像

+—————-+ +—————————-+ +———————+ +———————+ | hot data limit | | consumed cold data enqueue | | pipe event noticed, | | thread pool add job | | data cold out | –> | pipe event write | –> | read and dequeue | –> | do queuejob asyc | +—————-+ +—————————-+ +———————+ +———————+

还算省事儿,有机会读读代码实现。(又挖坑)


Read More


读斯通纳

追求绝对自我的人生体验,居然不落寞,很精彩,这是很难想象的,本宅男生活远没有这么精彩

另外听说凯西阿弗莱克要演这个的影视版,消息起码有五六年了,好莱坞宁愿拍犬之力这种大便也不愿意拍失败者。失败者是真滴无聊。就像我

Read More

使用ssh访问 virtualbox,端口转发

使用ssh访问 virtualbox,端口转发

前提环境 ubuntu 1804

安装并开启sshd

apt install openssh-server

service start sshd

设置端口转发

使用ssh -p 12345 root@localhost 访问即可


到此为止下面是牢骚

本来WSL都能搞定大部分场景,但是会把环境搞乱,虽说重装wsl也不麻烦

决定用docker来做实验环境,但发现业界都转k8s了?

不过docker确实很好用,准备用一用,但是wsl仅在hyper-v条件下才支持docker server daemon,基于这个条件,可以server命令启动,也可以安装docker for windows来导入,连接有很多就不列举了

有个issue 解释了半天也没说(或者我没看明白)不用hyper-v能不能用docker,所以只能搞虚拟机,还要在开个窗口麻烦,所以搞个转发wsl访问


Read More

Little Dump

layout: post title: 一些二进制分析工具记录 categories: tools tags: []

[toc]

Read More

Little Cmd

layout: post title: 常用快捷键/命令行/系统设定 categories: tools tags: [linux, macos, windows, vscode, vim, shell, docker]

[toc]

Read More

^