我想通过nc+bash创建一个tcp server, nc负责收发数据,bash负责处理数据,如何将nc和ba …
作者存档:phpor
bash 之 printf
bash 获取所有pid
1 |
for d in /proc/*;do [[ $d =~ /proc/[0-9]+ ]] && echo ${d#/proc/};done |
ls 可以list /proc …
count words in bash without wc
如何计算字符串中单词的数量,但是不使用wc? eg: [crayon-67f51fb8716bf8357221 …
cfree ( free in container)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#!/bin/bash CGROUP_DIR=/sys/fs/cgroup/memory UNLIMITTED=9223372036854771712 read mem_total <$CGROUP_DIR/memory.limit_in_bytes read mem_used <$CGROUP_DIR/memory.usage_in_bytes mem_free=$((mem_total - mem_used)) read mem_swap_total <$CGROUP_DIR/memory.memsw.limit_in_bytes read mem_swap_used <$CGROUP_DIR/memory.memsw.usage_in_bytes swap_total=$((mem_swap_total - mem_total)) swap_used=$((mem_swap_used - mem_used)) swap_free=$((swap_total - swap_used)) if [[ $mem_total = "9223372036854771712" ]];then /usr/bin/free -h && exit fi printf "%20s%20s%20s\n" total used free printf "Mem:%16s%20s%20s\n" $((mem_total/1024/1024))M $((mem_used/1024/1024))M $((mem_free/1024/1024))M printf "Swap:%15s%20s%20s\n" $((swap_total/1024/1024))M $((swap_used/1024/1024))M $((swap_free/1024/1024))M |
cfdisk – 基于 cursed的图形版磁盘分区工具
cfdisk is a curses-based program for partitioning any h …
阿里云oss 之 ossfs
缘起 阿里云OSS比云硬盘要便宜很多,而且阿里云提供一个叫做ossfs的工具,可以将OSS挂载成本地文件系统, …
Docker 的插件式设计 – 奋斗1984 – 博客园
https://www.cnblogs.com/zhengah/p/5889340.html socat做Un …
Powershell之GUI
Hello world: 解说: 先加载程序集 New-Object ShowDialog 参考: https …
关于Mysql 索引
索引滥用 表索引情况如下: 我们发现,buss_no 开头的索引就有三个,从名字上 …