这篇文章上次修改于 898 天前,可能其部分内容已经发生变化,如有疑问可询问作者。

title: "README.unix.md"
author: "andy"
description: "description information"
date: "2016-09-28"

lastmod: "2023-11-28"

Linux 安装远程桌面服务和客户端,可以登录win10的远程桌面

  • 1997 sudo apt-get install xrdp
  • 1998 xrdp
  • 1999 sudo apt-get install rdesktop
  • 2000 rdesktop
  • 2001 rdesktop 192.168.1.6
  • 2002 rdesktop -f -u lenovo 192.168.1.6
  • rdesktop退出全屏模式 :使用组合键ctrl+alt+enter进行切换。”

Linux mint xfce 19 使用记录

  • 解决汉化不完全的问题
  • sudo apt-fast install language-pack-zh-hans language-pack-gnome-zh-hans libreoffice-l10n-zh-cn thunderbird-locale-zh-hans firefox-locale-zh-hans
  • 安装谷歌拼音输入法 安装完成后注销或者重启即可。
  • sudo apt-fast install fcitx fcitx-config-gtk fcitx-ui-classic fcitx-googlepinyin

netstat 命令参数和使用详解

netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships

netstat - 打印网络连接、路由表、接口统计、伪装连接和多播成员关系

  • -a 显示所有状态的 socket
  • -n 不做名字解析,不加此参数,80 端口会显示成 http,127.0.0.1 显示成 localhost,uid 为 0 显示成 root 等等
  • -e 显示更多信息如用户,inode
  • -p 显示 pid 和程序名字
  • -t 显示 tcp 链接
  • -u 显示 udp 链接
  • -x 显示 unix 套接字

netstat -anpte #查看 tcp 链接

netstat -anpue #查看 udp 链接

netstat -anpxe #查看 unix 套接字链接

netstat -r # 查看路由表 netstat -r 和 route 命令输出是差不多的

netstat -s # 查看网络统计数据,netstat -s 展示各协议的统计信息

netstat -i # 查看网络接口信息

netstat -rF 和 netstat -rC 两个命令的区别是一个输出的是路由表,一个输出的是路由缓存。

默认 netstat -r 输出的是 netstat -rF 结果。-F 为默认参数

  • spring.io 上的项目介绍:
  • https://spring.io/blog/2021/03/11/announcing-spring-native-beta
  • GitHub 仓库:
  • https://github.com/spring-projects-experimental/spring-native
  • mvn install
  • mvn spring-boot:build-image or gradle bootBuildImage
  • Spring Native 0.9.2 设计用于 Spring Boot 2.4.5。为了保证支持和兼容性,最新的 Spring Boot 2.x 次要版本的每个修补版本都会发布一个新版本的 Spring Native。
  • Spring Native 0.9.2 仅支持 Spring Boot 2.4.5,建议使用指定版本。
  • https://www.graalvm.org/22.0/reference-manual/native-image/
  • gu install native-image
  • After this additional step, the native-image executable will become available in the $JAVA_HOME/bin directory.
  • javac Example.java
  • native-image Example
  • ./example
  • export GRAALVM_HOME=/home/andy/share/graalvm-ce-java11-22.0.0.2
  • export PATH=$GRAALVM_HOME/bin:$PATH
  • export PATH=$GRAALVM_HOME/lib/svm/bin:$PATH
  • UNIX Socket 是同一台服务器上不一样进程间的通讯机制。
  • TCP/IP Socket 是网络上不一样服务器之间进程的通讯机制,也可让同一服务器的不一样进程通讯。服务器
  • Postgres 的一位核心开发者曾经作过实验,证实 UNIX Socket 的方式比 TCP/IP Socket 方式要快 31%,
  • 因此,在同一个服务器上应该优先选择 UNIX Socket 方式。网络
  • influxDB-数据保存策略
  • retention policy: 存储策略,用于设置数据保留的时间,每个数据库刚开始会自动创建一个默认的存储策略 autogen,
  • 数据保留时间为永久,之后用户可以自己设置,例如保留最近 2 小时的数据。
  • 插入和查询数据时如果不指定存储策略,则使用默认存储策略,且默认存储策略可以修改。InfluxDB 会定期清除过期的数据。

sudo vim /etc/bash.bashrc

  • export PATH=/home/andy/dev/Kubernetes:$PATH
  • alias kubectl='k0s kubectl'
  • 395 ln -s ./k0sctl-linux-x64 k0sctl
  • 397 ln -s ./k0s-v1.23.5+k0s.0-amd64 k0s
  • sudo ./k0s kubectl get nodes
  • sudo ./k0s kubectl get pods -n kube-system
  • sudo ./k0s kubectl get -n ingress all
  • sudo ./k0s kubectl get pods
  • sudo ./k0s kubectl get pods -o wide
  • 1554 sudo systemctl status autosync.service
  • 1556 sudo systemctl status autosync.service -l
  • 1557 systemd-analyze critical-chain autosync.service
  • 1560 systemctl show autosync.service
  • 1561 sudo journalctl -u autosync.service
  • 1563 sudo systemctl restart autosync.service
  • 1564 sudo journalctl -u autosync.service
  • 1568 sudo systemctl restart autosync.service
  • 1569 systemctl show autosync.service
  • 1570 sudo systemctl status autosync.service -l
  • 1571 sudo vim /etc/systemd/system/autosync.service
  • 1572 sudo systemctl restart autosync.service
  • 1575 sudo systemctl restart autosync.service
  • 1576 sudo systemctl status autosync.service -l
  • ssh 无法免密登陆 cannot remove ‘.ssh/authorized_keys’: Operation not permitted 解决方法 1.在.ssh 文件夹下执行命令 chattr -i authorized_keys
  • 2.rm -rf authorized_keys
  • 1.集群内节点 SSH 登录免密
  • 依次执行:
  • 登录 master
  • ssh-keygen -t rsa
  • ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.4
  • ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.14
  • 登录 node1
  • ssh-keygen -t rsa
  • ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.2
  • ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.14
  • 登录 node2
  • ssh-keygen -t rsa
  • ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.2
  • ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.4
  • 2.master 可当作 Node 使用
  • kubectl taint node master node-role.kubernetes.io/master#将 Master 也当作 Node 使用
  • kubectl taint node master node-role.kubernetes.io/master="":NoSchedule #将 Master 恢复成 Master Only 状态
  • GCC 版本对 C++的支持情况
  • C++版本 GCC 版本支持情况 GCC 版本 指定版本的命令标志
  • C++98 完全支持 是 GCC 6.1 之前版本的默认模式 -std=c++98 or -std=gnu++98
  • C++11 完全支持 从 GCC4.8.1 版本开始完全支持 -std=c++11 or -std=gnu++11
  • C++14 完全支持 从 GCC 6.1 版本开始完全支持,是 GCC 6.1 到 GCC 10 (包括) 的默认模式 -std=c++14 or -std=gnu++14
  • C++17 完全支持 从 GCC 5 版本开始,到 GCC 7 版本,已基本完全支持。 是 GCC 11 版本的默认模式 -std=c++17 or -std=gnu++17
  • C++20 未完全支持 从 GCC 8 版本开始陆续支持 C++20 特性 -std=c++20 or -std=gnu++20 (GCC9 及以前使用-std=c++2a)
  • C++23 未完全支持(标准还在发展中) 从 GCC 11 版本开始支持 C++23 特性 -std=c++2b or -std=gnu++2b
  • fcitx 输出的文字变繁体 按了 ctrl shift + f 开了繁体的模式,按 ctrl shift + f 切回简体。
  • sudo vim /etc/default/grub
  • GRUB_DEFAULT=0
  • GRUB_DEFAULT=2
  • sudo update-grub
  • ubuntu 18.04 / linux mint 19.3
  • 【运行】~/app_linux/cmd_markdown_linux64$ ./Cmd\ Markdown
  • 【报错】./Cmd Markdown: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
  • 【解决】sudo apt-get install libgconf-2-4
  • sudo apt-get install x11vnc
  • x11vnc -storepasswd
  • https://download.jetbrains.com.cn/go/goland-2021.3.4.win.zip
  • https://www.jetbrains.com/zh-cn/go/download/other.html
  • https://developer.android.google.cn/studio/releases/platform-tools
  • https://github.com/syncthing/syncthing/releases
  • https://github.com/android/testing-samples/tree/master/
  • https://github.com/android/testing-samples/tree/master/ui/uiautomator/BasicSample
  • exec java -Xmx1600M -Djava.ext.dirs=/home/andy/Android/Sdk/tools/lib/x86_64:/home/andy/Android/Sdk/tools/lib -Dcom.android.uiautomator.bindir=/home/andy/Android/Sdk/tools -jar /home/andy/Android/Sdk/tools/lib/uiautomatorviewer-26.0.0-dev.jar
  • AppImage
  • cp /home/andy/app_linux/app_icon/icon.png default.png
  • echo "Categories=Application;" >> default.desktop
  • 2011 export PATH=/home/andy/Qt5.12.10/5.12.10/gcc_64/bin:$PATH
  • 2012 qmake -v
  • 2030 /home/andy/Qt5.12.10/5.12.10/gcc_64/bin/qmake -o Makefile ../untitledClient/untitledClient.pro -spec linux-g++ CONFIG+=qtquickcompiler
  • 2031 make
  • 2045 ldd untitledClient
  • 2046 readelf -d untitledClient
  • 2047 /home/andy/app_linux/linuxdeployqt-continuous-x86_64.AppImage --help
  • 2048 /home/andy/app_linux/linuxdeployqt-continuous-x86_64.AppImage untitledClient -appimage
  • 1、docker 三个基本概念:
  • • 镜像(Image):Docker 镜像(Image),就相当于是一个 root 文件系统。比如官方镜像 ubuntu:16.04 就包含了完整的一套 Ubuntu16.04 最小系统的 root 文件系统。
  • • 容器(Container):镜像(Image)和容器(Container)的关系,就像是面向对象程序设计中的类和实例一样,镜像是静态的定义,容器是镜像运行时的实体。容器可以被创建、启动、停止、删除、暂停等。
  • • 仓库(Repository):仓库可看着一个代码控制中心,用来保存镜像。
  • 2、docker 的镜像分层
  • 一个完整的 Docker 镜像可以支撑一个 Docker 容器的运行,在 Docker 容器运行过程中主要提供文件系统数据支撑。
  • Docker 镜像作为 docker 中最基本的概念,有以下几个特性:
  •  镜像分层,每个镜像都由一个或多个镜像层组成;
  •  可通过在某个镜像加上一定的镜像层得到新镜像(此过程可通过编写 dockerfile 或基于容器 Commit 实现);
  •  每个镜像层拥有唯一镜像 ID;
  •  镜像在存储和使用时共享相同的镜像层(根据 ID),所以在 pull 镜像时,已有的镜像层会自动跳过下载;
  •  每个镜像层都是只读,即使启动成容器,也无法对其真正的修改,修改只会作用于最上层的容器层;
  • 6、附 docker 基本命令
  • docker build -t friendlyhello . # Create image using this directory's Dockerfile
  • docker run -p 4000:80 friendlyhello # Run "friendlyhello" mapping port 4000 to 80
  • docker run -d -p 4000:80 friendlyhello # Same thing, but in detached mode
  • docker container ls # List all running containers
  • docker container ls -a # List all containers, even those not running
  • docker container stop # Gracefully stop the specified container
  • docker container kill # Force shutdown of the specified container
  • docker container rm # Remove specified container from this machine
  • docker container rm $(docker container ls -a -q) # Remove all containers
  • docker image ls -a # List all images on this machine
  • docker image rm # Remove specified image from this machine
  • docker image rm $(docker image ls -a -q) # Remove all images from this machine
  • docker login # Log in this CLI session using your Docker credentials
  • docker tag username/repository:tag # Tag for upload to registry
  • docker push username/repository:tag # Upload tagged image to registry
  • docker run username/repository:tag # Run image from a registry
  • $ sudo docker run hello-world
  • sudo docker run hello-world
  • 5.2.以非 root 用户管理 docker
  • Docker 守护程序绑定到 Unix socket 而不是 TCP 端口。
  • 默认情况下,Unix socke 是 root 用户才有,而其他用户只能通过使用 sudo 使用它。Docker 守护程序始终以 root 用户身份运行。
  • 如果您不想在 docker 命令前加上 sudo,请创建一个名为 docker 的 Unix 组并向其添加用户。
  • 当 Docker 守护程序启动时,它会创建一个可由该 docker 组成员访问的 Unix socket。
  • 1.创建docker组
  • sudo groupadd docker
  • 2.添加user到docker组
  • sudo usermod -aG docker $USER
  • 请将$USER 替换为系统中你的除 root 外的某个用户。
  • 3.注销并重新登录,以便重新评估您的组成员身份。
  • https://objects.githubusercontent.com/github-production-release-asset-2e65be/6838921/e711afc2-01e1-466d-8bdb-3705c22b78c2?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220309%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220309T031333Z&X-Amz-Expires=300&X-Amz-Signature=f83a4ea9ef6769a60ab43655d5db206400cc795ddbdd28ed757adb6ec25d6841&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=6838921&response-content-disposition=attachment%3B%20filename%3Dprometheus-2.33.5.linux-amd64.tar.gz&response-content-type=application%2Foctet-stream
  • https://gh.xiu.workers.dev/https://github.com/prometheus/prometheus/releases/download/v2.33.5/prometheus-2.33.5.linux-amd64.tar.gz
  • node_exporter
  • 页面搜索 node exporter 根据 id 导入模板: https://grafana.com/dashboards/8919
  • mysqld_exporter
  • 推荐图标 ID:https://grafana.com/dashboards/7362
  • https://github.com/prometheus/node_exporter/releases
  • https://github.com/prometheus/mysqld_exporter/releases
  • Docker CE 镜像
  • 简介
  • Docker CE 是免费的 Docker 产品的新名称,Docker CE 包含了完整的 Docker 平台,非常适合开发人员和运维团队构建容器 APP。
  • 下载地址:https://mirrors.aliyun.com/docker-ce/
  • https://mirrors.aliyun.com/docker-ce/
  • https://mirrors.huaweicloud.com/grafana/
  • https://download.lfd.uci.edu/pythonlibs/x6hvwk7i/cp27/PyQt4-4.11.4-cp27-cp27m-win32.whl
  • https://download.lfd.uci.edu/pythonlibs/x6hvwk7i/cp27/PyQt4-4.11.4-cp27-cp27m-win_amd64.whl
  • https://github.com/Tencent/wepy 21.7K
  • https://github.com/Meituan-Dianping/mpvue 20.4K
  • https://github.com/youzan/vant-weapp 15.7K
  • https://github.com/TalkingData/iview-weapp 6.2K
  • H2 变电二次: https://liuzongandy.com/v3/exam-vue/Exam2022_H2.html
  • I2 配电架空: https://liuzongandy.com/v3/exam-vue/Exam2022_I2.html

命令行重复执行命令

enable root for adb

  • adb root
  • adb disable-verity
  • adb reboot
  • adb mount -o remount,rw /
  • adb shell mount -o remount,rw /
  • mount -o remount,rw /
  • mount -o remount,rw /vendor
  • /system/bin/sshd -f /data/ssh/sshd_config -D -ddd
  • on property:sys.boot_completed=1
  • write /dev/kmsg "ftpserver starting"
  • start ftpserver
  • write /dev/kmsg "ftpserver started"
  • service ftpserver /system/andy/ftpserver
  • class main
  • user root
  • group root
  • service ftpserver /vendor/bin/ftpserver
  • class core
  • user root
  • 466 service vendor.tftp_server /vendor/bin/tftp_server
  • 467 class core
  • 468 user root
  • 494 service loc_launcher /system/vendor/bin/loc_launcher
  • 495 class late_start
  • 496 user gps
  • 497 group gps
  • 503 service qcom-sh /vendor/bin/init.qcom.sh
  • 504 class late_start
  • 505 user root
  • 506 group root system radio
  • 507 oneshot
  • 508
  • 509 service qcom-post-boot /vendor/bin/init.qcom.post_boot.sh
  • 510 class late_start
  • 511 user root
  • 512 group root system wakelock graphics
  • 513 disabled
  • 514 oneshot
  • service touchserver /system/bin/touch /system/andy/$(date '+%Y-%m-%d_%H-%M-%S').log
  • class late_start
  • user root
  • group root
  • oneshot
  • vim /vendor/etc/init/hw/init.qcom.rc
  • dmesg
  • ftpserver /system/andy/ftpserver
  • Endwith named go
  • linux、darwin、windows、freebsd
  • only_build_on_linux.go
  • // +build linux
  • package main
  • func main() {
  • }
  • // end
  • only_build_on_windows.go
  • // +build !windows
  • package main
  • func main() {
  • }
  • // end
  • https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/
  • https://community-packages.deepin.com/deepin/
  • http://archive.ubuntukylin.com/ubuntukylin/pool/partner/
  • [ ] weixin_2.1.1_amd64.deb 2021-12-31 14:25 105M
  • [ ] qqmusic_1.0.8_amd64.deb 2021-04-23 20:12 74M
  • [ ] linuxqq_2.0.0-b2-1082_amd64.deb 2020-04-23 23:49 12M
  • [ ] TencentMeeting_2.8.0.0_amd64.deb 2021-09-03 14:04 99M
  • [ ] baidunetdisk_3.5.0_amd64.deb 2021-04-20 16:15 106M
  • [ ] bytedance-feishu-stable_4.8.0-52_amd64.deb 2021-09-07 10:00 228M
  • [ ] com.xunlei.download_1.0.0.1_amd64.deb 2020-10-10 16:44 44M
  • [ ] google-chrome-stable_81.0.4044.113-1_amd64.deb 2020-04-22 15:54 64M
  • gradlew 常用命令
  • 在开发时有些小伙伴喜欢使用./gradlew 命令行进行打包编译 App,使用起来很安逸.
  • ./gradlew -v //查看 Gradle、Groovy、Ant、JVM 等的版本,截图如下:
  • ./gradlew clean //和 clean project 类似,截图如下:
  • ./gradlew tasks --all //查看所有任务,截图如下:
  • ./gradlew build --info //编译并打印日志,截图如下:
  • ./gradlew clean build --refresh-dependencies //强制更新最新依赖,清除并构建,截图如下:
  • ./gradlew build --info --debug --stacktrace //调试模式并打印堆栈信息 ,截图如下:
  • ./gradlew installDebug //打 debug 包并安装,截图如下
  • ./gradlew assembleDebug //编译并打 Debug 包
  • ./gradlew assembleRelease //编译打 release 包,截图如下:
  • ./gradlew installRelease //Release 模式打包并安装,截图如下
  • ./gradlew uninstallRelease //卸载 Release 模式包
  • ./gradlew install[productFlavorsName] app:assembleDebug //结合 productFlavorsName
  • ./gradlew assembleTestRelease //Release 模式测试渠道打包
  • ./gradlew dependencies //依赖信息查看
  • ./gradlew dependencies --info // 查看详细的依赖信息
  • ./gradlew compileDebug --stacktrace // 查看详细的资源文件信息
  • 使用 gradlew 命令行还有一个好处就是,当依赖很多第三方库导致的 aapt 报错,而你又不知道具体是哪个库,可以用./gradlew build --info --debug --stacktrace 命令打印并排查对栈信息,不需要我们去手动排查,下一篇写一下排查步骤.
  • apt-get install g++
  • sudo apt-get install cmake
  • /usr/bin/ld: cannot find -lGL
  • sudo apt-get install libgl1-mesa-dev
  • sudo apt-get install redis-server
  • sudo apt-get install libhiredis-dev
  • sudo apt-get install mysql-server //服务端
  • sudo apt-get install mysql-client //客户端
  • sudo apt-get install libmysqlclient-dev //程序编译时链接的库
  • sudo netstat -tap | grep mysql
  • sudo mysql_secure_installation
  • sudo mysql -uroot -proot
  • https://downloads.gradle-dn.com/distributions/gradle-6.1.1-all.zip
  • export GOROOT=/home/andy/app_linux/go
  • export PATH=$PATH:$GOROOT/bin
  • export GOPATH=/home/andy/go
  • go env -w GO111MODULE=on
  • go env -w GOPROXY=https://goproxy.cn,direct
  • go env -w GOPROXY=https://goproxy.cn,direct
  • go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/
  • go env -w GO111MODULE=on
  • go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct
  • // pg_ctl.c:2199 // exit(0);
  • 1993 cd /home/andy/CLionProjects/postgresql-11.11/
  • 1994 ./configure --help
  • 1996 ./configure --prefix=/home/andy/pgsql --without-readline
  • 1998 make -j4
  • 1999 make install
  • 2000 /home/andy/pgsql/bin/initdb --help
  • 2001 /home/andy/pgsql/bin/initdb --pgdata=/home/andy/pgdat --username=root -W
  • 2002 /home/andy/pgsql/bin/pg_ctl -D /home/andy/pgdat -l logfile start
  • 2008 /home/andy/pgsql/bin/psql -d postgres -U root -h 127.0.0.1 -p 5432
  • postgres=# select * from current_user;
  • postgres=# select user;
  • postgres=# select * from pg_catalog.pg_user;
  • https://top.baidu.com
  • https://www.douyin.com/hot
  • https://weibo.com
  • export GOROOT=/home/andy/app_linux/go
  • export PATH=$PATH:$GOROOT/bin
  • go env -w GOPROXY="https://goproxy.cn,direct"
  • export NODE_HOME=/home/andy/app_linux/node-v10.21.0-linux-x64/
  • export PATH=$NODE_HOME/bin:$PATH
  • npm config list
  • npm config set prefix "D:\nodejs\node_global"
  • npm config set cache "D:\nodejs\node_cache"
  • npm config ls -l
  • npm config set registry https://registry.npm.taobao.org
  • npm install express -g
  • npm install -g cnpm --registry=https://registry.npm.taobao.org
  • npm install express # local
  • npm install express -g # global

nginx

  • 2060 cat /etc/nginx/nginx.conf
  • 2061 cat /etc/nginx/sites-available/default

apache2

  • 498 pwd
  • 499 ll
  • 500 sudo apt-get install -y apache2
  • 501 cd ~
  • 502 sudo a2enmod dav
  • 503 sudo a2enmod dav_fs
  • 504 sudo mkdir -p /var/www/webdav
  • 505 sudo chown -R www-data:www-data /var/www/webdav
  • 506 sudo htpasswd -c /etc/apache2/webdav.password dav
  • 507 sudo chown root:www-data /etc/apache2/webdav.password
  • 508 sudo chmod 640 /etc/apache2/webdav.password
  • 509 sudo vim /etc/apache2/sites-available/000-default.conf
  • 510 mkdir /home/pi/webdav
  • 511 sudo vim /etc/apache2/sites-available/000-default.conf
  • 512 sudo systemctl restart apache2
  • 513 sudo /etc/init.d/apache2 reload
  • 514 cat /etc/apache2/sites-available/000-default.conf
  • 515 ifconfig
  • 516 systemctl status autofrpc
  • 517 vim /boot/rpi/frpc.ini
  • 518 sudo vim /boot/rpi/frpc.ini
  • 519 systemctl restart autofrpc
  • 520 ifconfig
  • 521 history
  • 437 sudo apt-get install sshfs
  • 438 sudo apt-get install xrdp
  • 439 ll
  • 440 mkdir -p ~/pi/
  • 441 sshfs pi@192.168.1.4:/home/pi ~/pi/
  • 442 umount ~/pi/
  • 443 sudo umount ~/pi/
  • 444 sshfs pi@192.168.1.4:/home ~/pi/
  • 445 sudo umount ~/pi/
  • 446 sshfs pi@192.168.1.4:/ ~/pi/
  • 447 history
  • 448 sudo umount ~/pi/
  • 449 history
  • andy@andy-ThinkPad-T440s:~$
  • 175 df -BG
  • 176 fdisk 2019-04-08-raspbian-stretch-lite.img
  • 177 sudo mount -o loop,offset=4194304 2019-04-08-raspbian-stretch-lite.img /mnt/
  • 178 fdisk -l 2019-04-08-raspbian-stretch-lite.img
  • 179 mount **_.img /Volumes/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
  • 180 sudo mount _**.img /mnt/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
  • 181 mkdir /mnt/boot
  • 182 sudo mkdir /mnt/boot
  • 183 sudo mount ***.img /mnt/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
  • 184 sudo mount 2019-04-08-raspbian-stretch-lite.img /mnt/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
  • 185 sudo dd bs=4M if=2019-04-08-raspbian-stretch-lite.img of=/dev/sdc
  • 186 ll /mnt/
  • 187 ll
  • 188 sudo mount 2019-04-08-raspbian-stretch-lite.img /mnt/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
  • 189 fdisk -l 2019-04-08-raspbian-stretch-lite.img
  • 190 sudo ls /mnt/boot/
  • 191 umount /mnt/boot
  • 192 sudo umount /mnt/boot
  • 193 sudo chmod 777 /mnt/boot/
  • 194 sudo mount 2019-04-08-raspbian-stretch-lite.img /mnt/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
  • 195 sudo umount /mnt/boot
  • 196 sudo mount 2021-05-07-raspios-buster-armhf-lite.img /mnt/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
  • 197 fdisk -l 2021-05-07-raspios-buster-armhf-lite.img
  • 198 fdisk -l 2019-04-08-raspbian-stretch-lite.img
  • cat /proc/asound/cards
  • sudo vim /lib/systemd/system/getty@.service
  • ExecStart=-/sbin/agetty -o '-p -f root' -n -a root --noclear %I $TERM
  • sudo vi /etc/lightdm/lightdm.conf
  • [SeatDefaults]
  • autologin-user=pi
  • xset dpms 0 0 0
  • xset s off
  • sudo vi /etc/dhcpcd.conf
  • interface eth0
  • static ip_address=192.168.1.222/24
  • static routers=192.168.1.1
  • static domain_name_servers=114.114.114.114
  • auto wlan0
  • allow-hotplug wlan0
  • iface wlan0 inet dhcp
  • wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  • auto wlan0
  • allow-hotplug wlan0
  • iface wlan0 inet static
  • wpa-ssid NETGEAR_AND
  • wpa-psk 0987654321
  • address 192.168.1.11
  • netmask 255.255.255.0
  • gateway 192.168.1.1
  • network 192.168.1.1
  • iface default inet dhcp

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

  • interface eth0
  • static ip_address=192.168.1.222/24
  • static routers=192.168.1.1
  • static domain_name_servers=114.114.114.114
  • auto wlan0
  • allow-hotplug wlan0
  • iface wlan0 inet dhcp
  • wpa-ssid NETGEAR_AND
  • wpa-psk 0987654321
  • iface default inet dhcp
  • apt-get install g++
  • sudo apt-get install cmake
  • /usr/bin/ld: cannot find -lGL
  • sudo apt-get install libgl1-mesa-dev
  • sudo apt-get install redis-server
  • sudo apt-get install libhiredis-dev
  • sudo apt-get install mysql-server //服务端
  • sudo apt-get install mysql-client //客户端
  • sudo apt-get install libmysqlclient-dev //程序编译时链接的库
  • sudo netstat -tap | grep mysql
  • sudo mysql_secure_installation
  • sudo mysql -uroot -proot