typora没有details快捷的插入标签功能,对xml这种折叠不行,其他文本还可以

脚本
/home/cs/.local/custom/details.sh
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
   | xdetails_helpdoc(){     cat <<EOF Description:    处理文档,方便粘贴到typora,实现折叠效果 Usage:    xdetails  file eg:   xdetails  /home/cs/data/kvm/default.xml -------------------------------------------------- <details>   <summary>折叠代码块</summary>   <pre><a>xxxx</a><xmp> <network>   <input type='tablet' bus='usb'>     <address type='usb' bus='0' port='1'/>   </input> </network>   </xmp></pre> </details> ------------------------------------------------------ EOF }
 
 
  xdetails_space(){ 	cat >$2<<EOF <details>   <summary>折叠代码块</summary>   <pre><a>xxxx</a><code> EOF      sed  "s/^$/<\/br>/" $1 >>$2
  	cat >>$2<<EOF   </code></pre> </details> EOF
  echo "对${1##*.}文本使用</br>替换标签。。。" 
  }
 
 
  xdetails_xml(){
  	cat >$2<<EOF <details>   <summary>折叠代码块</summary>   <pre><a>xxxx</a><xmp> EOF
    sed  "/^$/d" $1 >>$2
  	cat >>$2<<EOF   </xmp></pre> </details> EOF
  echo "对xml文本使用xmp标签处理。。。"
  }
 
  details(){   target="/tmp/${1##*/}.new"  if [ -f "$1" ]   then       [  "xml" = "${1##*.}" ] || { echo "开始对:${1##*/} 处理。。。" && xdetails_space $1 $target ;}       [  "xml" != "${1##*.}" ] || { echo "开始对:${1##*/} 处理。。。"  && xdetails_xml $1 $target;}       cat $target | xsel -i -b  && echo "已复制到剪贴板中"        echo  "新文件路径:$target"  else        xdetails_helpdoc   fi }
  | 
 
把定义脚本统一放到custom目录
引入
1 2 3 4 5 6 7 8 9 10 11 12 13
   | cs@debian:~/oss/hexo$ cat ~/.bashrc  |grep  -A 25 custom ######### custom start########### CMD(){   url=~/.local/custom/$1   [ -f "$url" ] && source $url }
  if [ -n "$(command -v xsel)" ] ; then   CMD details.sh   alias xdetails='details $@' fi
  ######### custom end###########
   | 
 
使用
刷新,开始使用
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
   | cs@debian:~/oss/hexo$ source ~/.bashrc  cs@debian:~/oss/hexo$ xdetails  Description:    处理文档,方便粘贴到typora,实现折叠效果 Usage:    xdetails  file eg:   xdetails  /home/cs/data/kvm/default.xml -------------------------------------------------- <details>   <summary>折叠代码块</summary>   <pre><a>xxxx</a><xmp> <network>   <input type='tablet' bus='usb'>     <address type='usb' bus='0' port='1'/>   </input> </network>   </xmp></pre> </details> ------------------------------------------------------ cs@debian:~/oss/hexo$ xdetails /home/cs/data/kvm/default.xml 开始对:default.xml 处理。。。 对xml文本使用xmp标签处理。。。 已复制到剪贴板中 新文件路径:/tmp/default.xml.new
   | 
 
  折叠xml
  折叠xml文本typora不显示,网页会正常
  default
  f527b455-06b2-4bd2-87cd-7c4c84ef899d
  
  
  
  
    
      
      
    
  
  
 
  折叠普通文本
  peek一个生成gif软件
cs@debian:~/下载$ sudo dpkg -i /home/cs/下载/peek_1.5.1-1_amd64.deb
[sudo] cs 的密码:
正在选中未选择的软件包 peek。
(正在读取数据库 ... 系统当前共安装有 112082 个文件和目录。)
准备解压 .../下载/peek_1.5.1-1_amd64.deb  ...
正在解压 peek (1.5.1-1) ...
......
正在设置 libcdio-cdda2:amd64 (10.2+2.0.0-1+b2) ...
正在设置 libcdio-paranoia2:amd64 (10.2+2.0.0-1+b2) ...
正在设置 libavdevice58:amd64 (7:4.3.5-0+deb11u1) ...
正在设置 ffmpeg (7:4.3.5-0+deb11u1) ...
正在设置 peek (1.5.1-1) ...
正在处理用于 libc-bin (2.31-13+deb11u5) 的触发器 ...
正在处理用于 man-db (2.9.4-2) 的触发器 ...
  
 
其它
history 显示时间
1 2 3 4
   | # 历史命令执行时间和执行者 echo 'export HISTTIMEFORMAT="%Y-%m-%d:%H-%M-%S:whoami: "' >> ~/.bashrc
  HISTFILESIZE=2000 # 保存历史命令文件大小
   | 
 
执行 source ~/.bashrc 生效即可
iostat
1 2 3
   | Device            r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz     w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz     d/s     dkB/s   drqm/s  %drqm d_await dareq-sz     f/s f_await  aqu-sz  %util nvme0n1          2.43    121.15     1.13  31.85    0.22    49.91    6.86    185.89     6.53  48.78    1.67    27.10    0.00      0.00     0.00   0.00    0.00     0.00    1.02    0.67    0.01   0.76
 
   | 
 
****avgqu-sz: 平均I/O队列长度****。
*await: 平均每次设备I/O操作的等待时间 (毫秒)。*
****svctm: 平均每次设备I/O操作的服务时间 (毫秒)****。
*%util: 一秒中有百分之多少的时间用于 I/O 操作,即被io消耗的cpu百分比*
如果 %util 接近 100%,说明产生的I/O请求太多,
I/O系统已经满负荷,该磁盘可能存在瓶颈。如果 svctm
比较接近 await,说明 I/O 几乎没有等待时间;如果 await
远大于 svctm,说明I/O 队列太长,io响应太慢,则需要进行必要优化。
如果avgqu-sz比较大,也表示有当量io在等待。
crontab
* * * * * command 
分钟(0-59)、小时(0-23)、日期(1-31)、月份(1-12)、星期(0-7) 执行的命令
1 2 3
   | crontab -e
  21 2-4 * 3,6,9,12 2-5 command
   | 
 
https://www.cnblogs.com/yezigege/p/13503795.html
      
     
    
   
  
    
    
    
      点击打赏
      
 
        
        会心一笑