![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux
mrhao61
这个作者很懒,什么都没留下…
展开
-
c语 json cJSON安装
git clone https://github.com/DaveGamble/cJSON.gitcd cJSON/mkdir buildcd build/cmake ..makesudo make installsudo vim /etc/ld.so.conf在第二行加上/usr/local/lib保存执行命令/sbin/ldconfig最简单的例子:#include <stdio.h>#include <cjson/cJSON.h>cJS原创 2020-07-05 14:24:07 · 634 阅读 · 0 评论 -
vimrc ma6174 Taglist ctags 安装配置
1…vimrc http://files.cnblogs.com/ma6174/vimrc.zip下载后解压到~2.Taglist插件安装wget http://www.vim.org/scripts/download_script.php?src_id=19574 -O abc.zip && unzip -o -d ./ abc.zip && mv doc/taglist.txt /usr/share/vim/vim[0-9][0-9]/doc/ &&a原创 2020-06-06 19:56:13 · 289 阅读 · 0 评论 -
linux ftp命令 基本使用
搭建好ftp服务器后如何使用。sudo apt-get install ftp连接后支持ls,mkdir ,cd 命令1.连接ftp [ip]输入用户名输入密码2.上传文件put [远程文件] [本地文件] 3.下载文件get [本地文件] [远程文件]4.结束断开byeMDELETE [文件名,支持*匹配]...原创 2020-05-02 16:51:22 · 556 阅读 · 0 评论 -
linux shell 恶意进程检测 时间 进程名 pid 用户 cpu占用 内存占用
#!/bin/basheval `ps -aux --sort=-%cpu -h | awk -v num=0 \ '{if($3 < 50){exit} else{num++; printf("cpupid["num"]=%d", $2)}} \ END {printf("cpunum=%d", num)}'`eval `ps -aux --sort=-%mem -h | a...原创 2020-05-02 16:02:13 · 502 阅读 · 0 评论 -
linux shell系统运行概况 时间 主机名 os版本 内核版本 运行时间 平均负载 磁盘总量 磁盘百分比 内存大小 内存百分比 cpu温度报警级别 内存报警级别 CPU报警级别
#!/bin/bashTime=`date +"%Y-%m-%d__%H:%M:%S"`HostName=`hostname`OsType=`cat /etc/issue.net | tr " " "_"`KernelVersion=`uname -r`LoadAvg=`cut -d " " -f 1-3 /proc/loadavg`UpTime=`uptime -p | tr -s ...原创 2020-05-02 16:00:22 · 200 阅读 · 0 评论 -
deepin15.11 GTX1060 扩展显示屏 双屏显示 双显卡安装 没有NV-PRIME方案
1.安装系统时,不能使用独显,所以安装了nvidia官网上的驱动。能在笔记本上正常显示。2.插入hdmi线,没有反应。通过查找网上的资料,说是切换显卡的方案到NV-prime可是我没有。去deepin用户qq群问了一下。需要装闭源驱动。#1.安装NVIDIA闭源驱动,在终端输入下面这句(由于之前装了nvidia官网.run,installer-clean的时候跳过了)sudo apt-g...原创 2020-05-02 14:04:36 · 2179 阅读 · 1 评论 -
deepin 开机报错 打不开图形桌面 startx失败 xorg文件修改
遇到事情不要慌,先看看csdn上的解决方案一、开不开机一般是系统配置文件被修改,恢复一般可以重新开机。修改系统配置文件前最好先备份 cp一份这种问题直接用recovery系统或者u盘系统进入文件夹修改,恢复文件即可。二、打不开图形化桌面1.xorg文件配置被修改恢复配置文件即可cp /etc/X11/目录下的orginal的一个文件 xorg.conf 一般自己备份的这个文件,即...原创 2020-05-02 12:25:01 · 1824 阅读 · 0 评论 -
2020爬取美赛数学成绩
爬取美赛数学成绩1.下载所有pdffor ((i=2002742; i<=2003139; i++))do echo $i wget http://www.comap-math.com/mcm/2020Certs/$i.pdfdone安装convertsudo apt-get install imagemagick安装tesseractsud...原创 2020-05-01 15:43:56 · 406 阅读 · 0 评论 -
ubuntu 服务器 安装 docker
阿里云 6 sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common 7 sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg ...原创 2020-05-01 11:45:01 · 508 阅读 · 1 评论 -
linux shell 用户统计 时间 用户总数 近期活跃用户 具有root权限的用户 当前在线用户 登录ip tty
linux shell 用户统计 时间 用户总数 近期活跃用户 具有root权限的用户 当前在线用户 登录ip ttyTime=`date "+%Y-%m-%d__%H:%M:%S"`eval $(awk -F: -v sum=0 '{if ($3 >= 1000 && $3 != 65534) {sum+=1; printf("All["sum"]=%s;", $1)...原创 2020-04-25 20:22:30 · 544 阅读 · 0 评论 -
linux shell 磁盘总量 磁盘剩余量 占用比例
linux shell 磁盘总量 磁盘剩余量 占用比例time=`date +%Y-%m-%d__%H:%M:%S`sum=(`df | tr -s -c 'a-zA-Z0-9%-/\n' ' ' | cut -d ' ' -f 2 | tr -s -c 'a-zA-Z0-9-' ' '`)sy=(`df | tr -s -c 'a-zA-Z0-9%-/\n' ' ' | cut -d ...原创 2020-04-25 16:30:51 · 1221 阅读 · 0 评论 -
linux shell mem 内存总量 剩余量 当前占用百分比 占用百分比动态平均值
linux shell mem 内存总量 剩余量 当前占用百分比 占用百分比动态平均值#!/bin/bash#判断参数合法if [[ $# -lt 1 ]];then echo "Usage:$0 DyAver"fiTime=`date "+%Y:%m;%d__%H:%M:%S"`DyAver=$1if [[ ${DyAver}x == x ]];then exit ...原创 2020-04-25 16:10:01 · 1038 阅读 · 0 评论 -
linux shell CPU信息获取 负载 占用率 当前温度 温度警告
CPU信息获取#时间time=`date "+%Y-%m-%d__%H:%M:%S"`#CPU负载fz=`cat /proc/loadavg | cut -d ' ' -f 1-3`#CPU温度wd=`cat /sys/class/thermal/thermal_zone0/temp`wd=`echo "scale=2;${wd}/1000" | bc`#警告war=""if ...原创 2020-04-25 15:16:24 · 961 阅读 · 0 评论 -
在Linux系统中,假设现在有⼀篇英⽂⽂章,基于项⽬要求,你需要计找出⽂章中,出现频次最多的20个单词,请说明思路,及相关命令
tr -sc "[A-Z][a-z]" "[\012*]" < 1.txt | \tr "[A-Z]" "[a-z]" | \sort | uniq -c | \sort -k1 -n -r | \head -20 | nl原创 2020-04-16 09:55:51 · 454 阅读 · 0 评论 -
c语言 实现 poen pclose
#include <stdio.h>#include <unistd.h>#include <string.h>#include <sys/types.h>#include <sys/wait.h>#include <errno.h>#include <stdlib.h>static pid_t ...原创 2020-04-14 19:53:49 · 1037 阅读 · 0 评论 -
第一次实现的简易shell
https://github.com/libohao666/My_Shellhttps://github.com/libohao666/My_Shell原创 2020-04-14 18:28:01 · 133 阅读 · 0 评论 -
c语言 select poll epoll 区别 总结
IO复用 为了解决大量客户端访问的问题,引入IO技术:一个进程可以同事对多个客户请求进行服务,复用一个进程对多个IO进行服务。IO读写的数据多数情况下没准备好,需要通过一个函数监听这些数据状态,一旦有数据可以读写就服务。 select,poll,epoll都是IO多路复用的机制,监视多个描述符,一旦某个描述符就绪,通知程序进行操作。int select(int nfds, fd_set ...原创 2020-04-12 11:10:29 · 1033 阅读 · 0 评论 -
c语言 使用fgets fprintf 替代read write 读写管道 进行进程通信
使用fgets fprintf替代read write读写管道#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <sys/ipc.h>#include <sys/shm.h>#include <sys/types.h>#inclu...原创 2020-04-09 12:43:07 · 537 阅读 · 0 评论 -
c语言 fork pipe 实现popen plcose源码
还有点问题,待解决#include <stdio.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <stdlib.h>#include <errno.h>#inclu...原创 2020-04-09 10:21:16 · 553 阅读 · 0 评论 -
c语言 共享内存 pthread_cond init... server client 互斥锁
client#include<sys/shm.h> #include<sys/ipc.h> #include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<signal.h> #include<sys/types.h> ...原创 2020-04-05 20:34:56 · 310 阅读 · 0 评论 -
c语言 进程 共享内存 pthread_mutex 互斥锁 数字累加
#include<sys/ipc.h> #include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<signal.h> #include<sys/types.h> #include<sys/stat.h> #inclu...原创 2020-04-05 17:01:39 · 701 阅读 · 0 评论 -
亲缘进程、非亲缘进程-共享内存与信号
亲缘进程 共享内存与信号#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <sys/ipc.h>#include <sys/types.h>#include <sys/shm.h>#include <signal.h>...原创 2020-04-04 20:56:09 · 624 阅读 · 0 评论 -
c语言 flock 多进程 数字累加
#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <sys/types.h>#include <sys/wait.h>#include <fcntl.h>#include <sys/file.h>char *num_fi...原创 2020-04-04 17:04:20 · 295 阅读 · 0 评论 -
c语言 实现简单的socket聊天 在线名单 文件传输 如图
github地址原创 2020-03-30 11:53:51 · 861 阅读 · 1 评论 -
c语言 socket 多进程 多线程
多进程 server#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <sys/types.h>#include <sys/socket.h>#include <arpa/inet.h>...原创 2020-03-28 09:10:33 · 831 阅读 · 0 评论 -
exec fork vim 编译 运行 .c/.cpp
如果需要传入参数,NULL之前传入 *++argv#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <sys/wait.h>int main(int ...原创 2020-03-26 19:11:13 · 180 阅读 · 0 评论 -
scp实现最简单的图床,图片路径直接覆盖剪切板
#!/bin/bashdatetime=`date '+%Y%m%d_%H%M%S'`target="用户名@ip或网站地址:文件夹"$datetime$1scp $1 $targetecho "![$1](http://网站或ip/images/$datetime$1)" | xsel --clipboard原创 2020-03-22 19:39:24 · 377 阅读 · 0 评论 -
cp 自写 linux 命令
cp 1.log 2.log#include <stdio.h>#include <stdlib.h>#include <fcntl.h>#include <sys/types.h>#include <sys/stat.h>#include <string.h>#include <unistd.h>...原创 2020-03-22 17:41:54 · 167 阅读 · 0 评论 -
more 自写 linux命令
满足1.回车 下一行2.空格 下一页3.q 退出4.下方有”–More–(百分比)"截图如下:#include <stdio.h>#include <stdlib.h>#include <string.h>#include<sys/types.h>#include<sys/ioctl.h>#include<u...原创 2020-03-22 17:13:08 · 124 阅读 · 0 评论 -
deepin man 手册不全 解决办法
apt-get install manpages-de manpages-de-dev manpages-dev glibc-doc manpages-posix-dev manpages-posix原创 2020-03-19 18:49:10 · 626 阅读 · 0 评论 -
ssh -o ServerAliveInterval=60 保持ssh链接
ssh -o ServerAliveInterval=60 -p xx xx@xxxxxxxxx原创 2020-03-16 12:06:22 · 4372 阅读 · 0 评论 -
ls自写
只能lsls -als -a filename#include <stdio.h>#include <string.h>#include "dirent.h"#define RED "\033[0;32;31m"#define GREEN "\033[0;32;32m"#define BLUE "\033[0;32;34m"#define CYAN "\...原创 2020-03-15 10:44:02 · 258 阅读 · 0 评论 -
shell 编程 线性筛
#!/bin/bashfunction init_prime() { max_n=$1 cnt=0 for (( i = 2; i <= ${max_n}; i++ )) { if [[ ${vis[${i}]} -ne 1 ]]; then #echo ${i} cnt=$[${cnt} + 1] ...原创 2020-03-13 14:16:44 · 154 阅读 · 0 评论 -
linux shell 记录 ssh 登录时间 输出线条字 记录time.log echo彩色字
原创 2020-03-12 11:00:02 · 366 阅读 · 0 评论 -
macos 虚拟机
1.安装vm2.运行unlocker的wininstall。cmd3.更改目录下的vmx文件smc.present = “TRUE”把smc.version = 0 加载这个参数后面一行, 保存退出。重新启动客户机发现能正常启动了。4.实用工具 抹掉5....原创 2019-12-09 17:03:51 · 277 阅读 · 0 评论 -
linux git操作学习
git config --global user.name "libohao666"git config --global user.email "2052658718@qq.com" git status git init git remote add origin https://github.com/libohao666/2019-.git git push -u origin m...原创 2019-12-01 14:56:52 · 125 阅读 · 0 评论 -
linux免密登陆
自己的电脑普通用户到树莓派的普通用户ssh lbh@zentao.haizeix.tech#通过ssh连接重开一个终端[lbh@5VEYUOM6KWYJUEN ~]$ ssh-keygen#之后三次回车确认[lbh@5VEYUOM6KWYJUEN ~]$ cd /home/lbh/.ssh[lbh@5VEYUOM6KWYJUEN .ssh]$ cat id_rsa.pub...原创 2019-11-30 17:33:55 · 153 阅读 · 1 评论 -
Terminal(centos7)
#上下文目录用户名@主机名:路径(是否为root权限#/$)tab键 自动补全 cp [选项] 源文件 目标文件选项:-a:-d、-p、-r 的集合-d:如果源文件为软链接(对硬链接无效),则复制出的目标文件也为软链接;-i:如果目标文件已经存在,则会询问是否覆盖;-l:建立硬链接文件,不复制源文件;-s:建立软链接文件,不复制源文件;-p:复制后目标文件保留源文件的属性(...原创 2019-11-29 16:04:07 · 516 阅读 · 0 评论 -
centos7 配置各种环境
1.使用系统自带的输入法在设置-地区语言-±汉语-汉语pinyin2.换阿里yum源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup cd /etc/yum.repos.d/ wget -O /etc/yum.repos.d/CentOS-Base.repo http://m...原创 2019-11-26 11:51:02 · 788 阅读 · 0 评论 -
xshell6
xshell下载地址xshell输入服务器ip输入端口连接输入用户名输入密码原创 2019-11-24 16:24:42 · 275 阅读 · 0 评论