随笔分类 -  Linux

摘要:增加一个选项即可解决:--insecure 出问题: mosquitto_pub -d -h 192.168.1.10 -p 1883 -t hello -m 123 --cafile ~/cacert.pem Client null sending CONNECT Error: host name 阅读全文
posted @ 2022-10-24 15:59 船长博客 阅读(128) 评论(0) 推荐(0) 编辑
摘要:英文: https://topic.alibabacloud.com/a/use-ros-for-pppoe-servers_3_78_33012852.html 中文: https://jingyan.baidu.com/article/adc81513c6bd2bf723bf73da.html 阅读全文
posted @ 2022-09-19 15:00 船长博客 阅读(161) 评论(0) 推荐(0) 编辑
摘要:1、生成密钥对,输入以下命令一路回车即可 ssh-keygen 2、将客户端公钥发送给服务器 ssh-copy-id root@1.1.1.1 注:经过ssh-copy-id后接收公钥的服务器会把公钥追加到服务器对应用户的$HOME/.ssh/authorized_keys文件中 3、可以愉快的玩刷 阅读全文
posted @ 2022-07-29 19:14 船长博客 阅读(328) 评论(0) 推荐(0) 编辑
摘要:1.Ubuntuhttps://ubuntu.com/desktop#download 点击22.04LTS按钮即可下载 https://ubuntu.com/download/server 点击Option 2: Manual server installation 即可看到下载按钮 2.Cent 阅读全文
posted @ 2022-07-23 08:55 船长博客 阅读(5712) 评论(0) 推荐(2) 编辑
摘要:/etc/nginx/sites-available/default location中添加autoindex_localtime on; server { listen 80 default_server; root /var/www/; # Add index.php to the list i 阅读全文
posted @ 2022-04-01 10:22 船长博客 阅读(2764) 评论(0) 推荐(0) 编辑
摘要:1. Linux上的Docker CE仍然是免费的 https://forums.docker.com/t/license-to-use-docker-community-edition/114840/3 WSL的情况: 2. 我是否需要付费才能继续使用 Docker Desktop? https: 阅读全文
posted @ 2022-03-24 16:35 船长博客 阅读(856) 评论(0) 推荐(0) 编辑
摘要:1. PUTTY 支持SSH, Telnet, Serial串口 https://files.cnblogs.com/files/v5captain/putty.zip https://the.earth.li/~sgtatham/putty/0.77/w64/putty.exe 2. HFS - 阅读全文
posted @ 2022-03-22 10:50 船长博客 阅读(210) 评论(0) 推荐(0) 编辑
摘要:服务器端监听9995端口: nc -l 9995 客户端连接: 服务器IP是192.168.1.10没有安装的nc命令的可以使用telnet命令: nc 192.168.1.10 9995或telnet 192.168.1.10 9995 #telnet可以验证端口没有开放,不能进行双向通信 nc通 阅读全文
posted @ 2022-03-10 12:05 船长博客 阅读(249) 评论(0) 推荐(0) 编辑
摘要:通常把需要执行命令加入到/etc/rc.local即可开机自动执行。有时候不确定什么原因不管用(也可进一步调查原因),或使用下面这个方法: cd /etc/init.d #test.sh #!/bin/bash case "$1" in start) touch /tmp/abcd ;; stop) 阅读全文
posted @ 2022-02-09 09:46 船长博客 阅读(1281) 评论(0) 推荐(1) 编辑
摘要:解决:命令前加exec 转自:https://stackoverflow.com/questions/6742635/popen-creates-an-extra-sh-process 阅读全文
posted @ 2022-01-29 18:19 船长博客 阅读(87) 评论(0) 推荐(0) 编辑
摘要:sudo apt-get update sudo apt-get install iproute2 //ip sudo apt-get install net-tools //ifocnfig sudo apt-get install ping //centos 使用 sudo apt-get in 阅读全文
posted @ 2022-01-12 20:41 船长博客 阅读(7196) 评论(0) 推荐(1) 编辑
摘要:Linux meld命令比较两个文件的内容是否相同 meld 是一款图形化的文本比较编辑工具,适合不同版本文件的合成。 安装: sudo apt-get install meld 比较文件: meld a.py b.py 阅读全文
posted @ 2021-04-25 20:22 船长博客 阅读(380) 评论(0) 推荐(0) 编辑
摘要:查看端口被哪个进程占用:netstat -tnulp | grep 8080tcp 2 0 192.168.1.2:8080 0.0.0.0:* LISTEN 859048/node -t这里是tcp,其它选项,参考netstat --help查看哪个程序占用启动了该进程ps -aux | grep 阅读全文
posted @ 2021-04-21 11:52 船长博客 阅读(365) 评论(0) 推荐(0) 编辑
摘要:方法一: $ for i in `ls -B` for> do for> fn=${i%.log} for> mv $fn.log $fn.error for> done $ ls abc.error 方法二: $ ls *.error | sed -r -n 's/(.*)error/mv & \ 阅读全文
posted @ 2021-03-29 19:34 船长博客 阅读(137) 评论(0) 推荐(0) 编辑
摘要:查找出那些已经删除但是继续占用内存空间的文件: lsof -n | grep deleted 或者直接查找删除的大文件 lsof -n | grep deleted |grep debug rsyslogd 5154 root 7w REG 8,3 94263283712 6030228 /var/ 阅读全文
posted @ 2021-03-29 19:32 船长博客 阅读(1759) 评论(0) 推荐(1) 编辑
摘要:lsof error.log 杀掉进程 kill -9 17636 阅读全文
posted @ 2021-03-29 19:26 船长博客 阅读(1257) 评论(0) 推荐(1) 编辑
摘要:查看linux版本: $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04 LTS Release: 20.04 Codename: focal 查看内核版本: 阅读全文
posted @ 2021-03-29 19:22 船长博客 阅读(324) 评论(0) 推荐(0) 编辑
摘要:sed -i '2,$d' filename 删除第2行及以后所有行 sed -i '10,20d' filename 删除第10-20行 注:-i是直接修改原文件 如果不想直接修改原文件,可以重定向到新文件: sed '2,$d' abc.txt > aaa 阅读全文
posted @ 2021-02-24 08:32 船长博客 阅读(1989) 评论(0) 推荐(0) 编辑
摘要:docker run -d -p 80:80 --name my-apache-php-app -v "$PWD":/var/www/html php:7.2-apache $PWD是指当前目录,你也可以换成/var/www/html,根据自己的网站目录设置。-p是映射端口号,前面是本机,后面是容器 阅读全文
posted @ 2020-12-26 08:10 船长博客 阅读(1703) 评论(0) 推荐(2) 编辑
摘要:# cat a.csv aa11 aaaa abc ccdd # cat b.csv cc11 aaaa abc ddee # a,b相同的行 # grep -wf a.csv b.csv aaaa abc #在b中不在a中的行 # grep -wvf a.csv b.csv cc11 ddee # 阅读全文
posted @ 2020-12-23 21:13 船长博客 阅读(1718) 评论(0) 推荐(1) 编辑

永远相信美好的事情即将发生!