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

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

lastmod: "2023-11-28"

hugo command

  • hugo.exe new site blog
  • cd blog
  • hugo.exe serve -D
  • cd ..\
  • hugo.exe serve -D -s blog
  • ../hugo new site blog --cacheDir /data/local/tmp/temp
  • ../hugo serve -D --cacheDir /data/local/tmp/temp -s blog
hugo.exe new site blog
cd blog
hugo.exe serve -D
cd ..\
hugo.exe serve -D -s blog


../hugo new site blog --cacheDir /data/local/tmp/temp
../hugo serve -D --cacheDir /data/local/tmp/temp -s blog

redis web

linux sshd config

  • vim /etc/ssh/sshd_config
ListenAddress 0.0.0.0
PermitRootLogin yes
PubkeyAuthentication no
PasswordAuthentication yes
UseLogin yes

ubuntu18.04 build python3.12

tar -xzvf nogil-3.12-3.12.0a4.tar.gz
apt install libffi-dev
apt-get install libssl-dev
apt-get install libbz2-dev liblzma-dev zlib1g-dev
./configure --prefix=/opt/python312/ --enable-optimizations --disable-gil
make -j4
make install
export PATH=/opt/python312/bin:$PATH
./pip3 install numpy                                                                                                                                                                                                                                                                 
./pip3 install pandas
python3 -c "import sys; print(sys.flags.nogil)"  # True
PYTHONGIL=1 python3 -c "import sys; print(sys.flags.nogil)"  # False
python3 -c 'import numpy; print(numpy.__version__)'
python3 -c 'import pandas; print(pandas.__version__)'

Ubuntu系统设置时区时间

date -R
timedatectl set-timezone Asia/Shanghai
tzselect
sudo dpkg-reconfigure tzdata (16.04 or below...)

Ubuntu Linux 常用软件包管理命令

  • /var/cache/apt/archives
    apt-cache search package 搜索包
  apt-cache show package 获取包的相关信息,如说明、大小、版本等
  sudo apt-get install package 安装包
  sudo apt-get install package - - reinstall 重新安装包
  sudo apt-get -f install 修复安装"-f = ——fix-missing"
  sudo apt-get remove package 删除包
  sudo apt-get remove package - - purge 删除包,包括删除配置文件等
  sudo apt-get update 更新源
  sudo apt-get upgrade 更新已安装的包
  sudo apt-get dist-upgrade 升级系统
  sudo apt-get dselect-upgrade 使用 dselect 升级
  apt-cache depends package 了解使用依赖
  apt-cache rdepends package 是查看该包被哪些包依赖
  sudo apt-get build-dep package 安装相关的编译环境
  apt-get source package 下载该包的源代码
  sudo apt-get clean && sudo apt-get autoclean 清理无用的包
  sudo apt-get check 检查是否有损坏的依赖
    apt-cache show xxx 显示某软件包的详细信息
    apt-cache depends xxx 查询某软件依赖哪些软件包
    apt-cache rdepends xxx 查询某软件被哪些软件包依赖
    apt-file search xxx 查找某文件属于哪个包
    sudo apt-get autoclean 清理旧版本的软件缓存
    sudo apt-get clean 清理所有软件缓存
    sudo apt-get autoremove 删除系统不再使用的孤立软件
    dpkg -l xxx 查看已经安装了哪些软件包
    dpkg -L xxx 查看某软件包的安装文件的保存位置
    dpkg --get-selections 备份当前系统安装的所有软件包的列表
    dpkg --set-selections 恢复备份的安装包的列表文件所有包
    /var/cache/apt/archives 查看安装软件时下载软件包的临时存放目录

ubuntu安装gcc高版本,配置默认版本的gcc链接

  • install gcc
 1955  sudo update-alternatives --config gcc
 1956  sudo apt-get install -y gcc-9 g++-9
 1957  sudo add-apt-repository ppa:ubuntu-toolchain-r/test
 1958  ls /usr/bin/gcc*
 1959  ls -la /usr/bin/gcc*
 1960  sudo apt-get install -y gcc-9 g++-9
 1961  sudo update-alternatives --config gcc
 1962  gcc -v
 1963  gcc-9
 1964  gcc-9 -v
 1965  ll
*1975  sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 20 --slave /usr/bin/g++ g++ /usr/bin/g++-7
 1976  sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10 --slave /usr/bin/g++ g++ /usr/bin/g++-9
 1977  update-alternatives --config gcc
 1978  gcc -v
 1986  cmake ../
 1987  make
 1988  ls -la
 1989  pwd
 1990  ./template
 1991  history

APT & unixodbc

  • apt proxy & unixodbc
export http_proxy=http://192.168.1.5:8088
Acquire::http::Proxy "http://192.168.1.5:8088"
dpkg -i unixodbc_2.3.4-1.1ubuntu3_amd64.deb libodbc1_2.3.4-1.1ubuntu3_amd64.deb odbcinst1debian2_2.3.4-1.1ubuntu3_amd64.deb libodbc1_2.3.4-1.1ubuntu3_amd64.deb odbcinst_2.3.4-1.1ubuntu3_amd64.deb libltdl7_2.4.6-2_amd64.deb libreadline7_7.0-3_amd64.deb readline-common_7.0-3_all.deb

linux c DEBUG

  • linux c segmentfault
export LD_PRELOAD=/lib64/libc-2.19.so
ulimit -c
ulimit -c 1024
ulimit -c unlimited
gdb main core.83505
objdump -ld main > dumpcode
cat /proc/sys/kernel/core_pattern
echo "core-%e-%p-%t" > /proc/sys/kernel/core_pattern
gdb test core.8482

GCC

tar -xvf gcc-7.5.0.tar.gz
cd gcc-7.5.0
upload... gmp-6.1.0.tar.bz2、mpc-1.0.3.tar.gz、mpfr-3.1.4.tar.bz2、isl-0.16.1.tar.bz2 on gcc7.5.0 directory...
./contrib/download_prerequisites
cd ..
mkdir gcc-build-7.5.0
cd gcc-build-7.5.0
../gcc-7.5.0/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j4
make install
gcc -v
g++ -v
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
sudo ln -sv /usr/local/gcc/include/ /usr/include/gcc
$ wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
$ tar -xvf glibc-2.18.tar.gz
$ cd glibc-2.18
$ mkdir build && cd build && ../configure --prefix=/usr && make -j4 && make install
$ strings /lib64/libc.so.6 | grep GLIBC_
$ strings /lib64/libstdc++.so.6 | grep GLIBC_
ldd --version
strings /lib64/libc.so.6 | grep GLIBC_
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC_

DBeaver 设置 maven 下载仓库为 aliyun

设置 maven 下载仓库为 aliyun

json RFC

json RFC protocol

  • INI RFC 822-style
  • json
  • JSON Pointer (RFC 6901)
  • JSON Patch (RFC 6902)
  • JSON Merge Patch (RFC 7386)
  • UTF-8 encoded RFC 8259

Windows下读写Linux分区Ext4的驱动程序:Ext2Fsd v0.68

官网:https://sourceforge.net/projects/ext2fsd/files/Ext2fsd/

  • 系统平台:Win XP/7/10(11未测,听反馈说是支持)
  • 注:
  • 1.不推荐用官方最新版v0.69,会出现无法识别ext4等问题。
  • 2.http://www.acc.umu.se/~bosse/v0.7beta修改版不支持win11系统,另外在实机测试中发现与U盘移动硬盘可能有盘符冲突无法安全弹出。

vs download tool

  • vs_Community.exe --layout F:\VS2017_Community_Offline4 --lang zh-CN --add Microsoft.VisualStudio.Workload.CoreEditor;includeRecommended;includeOptional --add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended;includeOptional --add Microsoft.VisualStudio.Workload.Universal;includeRecommended;includeOptional --add Microsoft.VisualStudio.Workload.VisualStudioExtensionBuildTools;includeRecommended;includeOptional
  • mu_visual_studio_community_2017_version_15.3_x86_x64_11100062.3.exe --layout D:\VS2017_Community_Offline4 --lang zh-CN --add Microsoft.VisualStudio.Workload.CoreEditor;includeRecommended;includeOptional --add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended;includeOptional --add Microsoft.VisualStudio.Workload.Universal;includeRecommended;includeOptional --add Microsoft.VisualStudio.Workload.VisualStudioExtensionBuildTools;includeRecommended;includeOptional
  • vs_community.exe --layout c:\vs2017layout --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --lang zh-CN
  • c:\vs2017layout\vs_community.exe --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended
  • vs_BuildTools.exe --layout c:\VS_BuildTools2017_offline --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.VCTools --lang en-US
  • vs_BuildTools.exe --layout C:\ BT2017offline --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio. Workload.WebBuildTools - 添加Microsoft.VisualStudio.Workload.NetCoreBuildTools --lang en-US
  • --add Microsoft.VisualStudio.Component.NuGet.BuildTools

VC项目前后出现如下六个入口函数:main、wmain、_tmain、WinMain、 wWinMain、_tWinMain,以下分别介绍它们的用法。

vc main

  • (1)、main()是WINDOWS的控制台程序(32位)或DOS程序(16位);
  • (2)、wmain()是UNICODE版本的main();
  • (3)、_tmain()是个宏,若是UNICODE,则它为wmain();否则为main()。
  • (4)、WinMain()是WINDOWS的GUI程序;
  • (5)、wWinMain是UNICODE版本的WinMain ();
  • (6)、_tWinMain是个宏,若是UNICODE,则它为wWinMain ();否则为WinMain()。

DNS为什么用TCP和UDP

首先了解以下TCP与UDP传送字节的长度限制:

  •     在以太网当中MTU是1500:
  •       UDP 包的大小就应该是 1500 - IP头(20) - UDP头(8) = 1472(Bytes)
  •       TCP 包的大小就应该是 1500 - IP头(20) - TCP头(20) = 1460 (Bytes)
  •     在英特网当中标准MTU值为576字节:
  •       UDP 包的大小就应该是 576 - IP头(20) - UDP头(8) = 548 (Bytes)
  •       TCP 包的大小就应该是 576 - IP头(20) - TCP头(20) = 536 (Bytes)

Linux安装Opencv(C++)

Opencv

sudo apt-get install cmake
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install pkg-config
unzip opencv-3.4.7.zip
cd opencv-3.4.7
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j8
make install
sudo gedit /etc/ld.so.conf
- include  /usr/local/lib
sudo ldconfig
sudo gedit /etc/bash.bashrc
- PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
source /etc/bash.bashrc
pkg-config opencv --modversion

Cmder config

  • Cmder.exe /REGISTER ALL
  • clink.lua line:51

CMake构建Visual Studio中MFC项目的MFC配置问题

使用CMake生成MFC项目的时候,需要用到在共享DLL中使用 MFC,需要在CMakeLists文件中加上如下的代码:

  • ADD_DEFINITIONS(-D_AFXDLL)
  • SET(CMAKE_MFC_FLAG 2)
  • ADD_EXECUTABLE(detect WIN32 ${DIR_SRCS})
  • CMAKE_MFC_FLAG参数的意思是这样解释的:
  • To use MFC, the CMAKE_MFC_FLAG variable must be set as follows:
  • 0: Use Standard Windows Libraries
  • 1: Use MFC in a Static Library
  • 2: Use MFC in a Shared DLL

GNU

// g++ -O2 -std=c++11 lock.cpp
// vc中的CString和MFC及std库string头文件及转换
// "C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat"
// "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
cmake -A x64 -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=Release ../
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"  ALL_BUILD.vcxproj /t:rebuild /p:"Configuration=Release;Platform=x64"
// cl.exe /O2 /std:c++11 lock.cpp
// cl.exe /O2 /std:c++14 stream.cpp
VS2010 not support stdc++11 thread
"C:\Users\andy\Desktop\Visual Studio 2010 Ultimate\VC\vcvarsall.bat"
"D:\Microsoft Visual Studio 10.0\Common7\Tools\vcvarsall.bat"
"C:\Users\andy\Desktop\Visual Studio 2010 Ultimate\Common7\IDE\devenv.exe" template.sln /Build "Release|x64"
cl mfc.cpp /link /subsystem:windows

Visual Studio 2010打开工程,提示“未知错误”弹窗,原因是整理电脑时,误删除.NET Framework。

打不开工程是因为缺少.NET Framework,安装上即可。

更改树莓派(Raspberry Pi)的默认用户名pi

usermod

usermod -l andy pi
kill -9 789
usermod -l andy pi
groupmod -n andy pi
mv /home/pi /home/andy
usermod -d /home/andy andy

python 编译安装

./configure --enable-optimizations --enable-shared
make -j20

GLIBC_2.14 not found 终极解决方案

ldd --version

strings /lib64/libc.so.6 |grep GLIBC
http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
http://ftp.gnu.org/gnu/glibc/glibc-ports-2.14.tar.gz
tar -xvf  glibc-2.14.tar.gz
tar -xvf  glibc-ports-2.14.tar.gz
mv glibc-ports-2.14 glibc-2.14/ports
mkdir glibc-2.14/build
cd glibc-2.14/build
../configure  --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make
make install
wget http://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
tar -xvf glibc-2.17.tar.gz
cd glibc-2.17
mkdir build; cd build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make -j 8
make install
ldd --version
strings /lib64/libc.so.6 |grep GLIBC_
strings /lib/x86_64-linux-gnu/libc.so.6 |grep GLIBC_
/sbin/ldconfig -p | grep stdc++
locate libstdc++.so
readelf -s exe_python  | grep -oP "GLIBC_[\d\.]*" | sort | uniq

黑苹果与Windows双系统时间不一致的解决办法

Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1

linuxmint显示隐藏的文件

CHRL+H

linux mint 终端无法输入原因

CTRL + S 锁住终端禁用输入, CTRL + Z 解锁终端启用输入, CTRL + Z解锁后终端会显示锁住后第一次输入的命令

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

linux mint 输入法问题

fcitx 输出的文字变繁体 按了 ctrl shift + f 开了繁体的模式,按 ctrl shift + f 切回简体。

linux中的top -c命令,根据进程名过滤列出的进程

top -c

  • top -n 1
  • top -p 574
  • top -c -p $(pgrep -d',' -f exe)
  • 命令参数:
  • -b 批处理
  • -c 显示完整的治命令
  • -I 忽略失效过程
  • -s 保密模式
  • -S 累积模式
  • -i<时间> 设置间隔时间
  • -u<用户名> 指定用户名
  • -p<进程号> 指定进程
  • -n<次数> 循环显示的次数
  • 交互命令:
  • 在top 命令执行过程中可以使用的一些交互命令。这些命令都是单字母的,如果在命令行中使用了s 选项, 其中一些命令可能会被屏蔽。
  • h 显示帮助画面,给出一些简短的命令总结说明
  • k 终止一个进程。
  • i 忽略闲置和僵死进程。这是一个开关式命令。
  • q 退出程序
  • r 重新安排一个进程的优先级别
  • S 切换到累计模式
  • s 改变两次刷新之间的延迟时间(单位为s),如果有小数,就换算成m s。输入0值则系统将不断刷新,默认值是5 s
  • f或者F 从当前显示中添加或者删除项目
  • o或者O 改变显示项目的顺序
  • l 切换显示平均负载和启动时间信息
  • m 切换显示内存信息
  • t 切换显示进程和CPU状态信息
  • c 切换显示命令名称和完整命令行
  • M 根据驻留内存大小进行排序
  • P 根据CPU使用百分比大小进行排序
  • T 根据时间/累计时间进行排序
  • 1在top基本视图中,按键盘数字“1”可以监控每个逻辑CPU的状况:
  • 2敲击键盘‘b’(打开关闭加亮效果)top视图变换如下:
  • 3敲击键盘‘x’(打开/关闭排序列的加亮效果),top视图变换如下:
  • 4改变进程显示字段 在top基本视图中,敲击”f”进入另一个视图,在这里可以编辑基本视图中的显示字段

linux命令行执行循环命令

  • watch free -n
  • watch -n 10 df -h
  • for i in {1..8}; do echo -n "running the command $i time"; sleep 3; done
  • for i in {1..1000}; do date >> testd.txt; sleep 10; done
  • while true; do date >>teste.txt; sleep 10; done

Linux MInt 和ubuntu版本对应关系

  • Linux Mint
  • Linux Mint 18(Sarah) 新版本基于Unbutu1604,属于LTS版本,一直维护到2021年 GCC4.8.5
  • Linux Mint 19 “Tara”将成为基于Ubuntu 18.04 LTS(Bionic Beaver) GCC7.5
  • Linux Mint 20 正式版发布:代号「Ulyana」,基于 Ubuntu 20.04 GCC8.3
  • Linux Mint 21“Vanessa”正式版发布,基于 Ubuntu 22.04 LTS

Debian 发行版本

  • Debian 一直维护着至少三个发行版本:稳定版(stable),测试版(testing)和不稳定版(unstable)。
  • 下一代 Debian 正式发行版的代号为 bookworm — 测试(testing)版 — 发布日期尚未确定
  • Debian 11 (bullseye) — 当前的稳定(stable)版
  • Debian 10(buster) — 当前的旧的稳定(oldstable)版
  • Debian 9(stretch) — 更旧的稳定(oldoldstable)版,现有长期支持
  • Debian 8(jessie) — 已存档版本,现有扩展长期支持
  • Debian 7(wheezy) — 被淘汰的稳定版
  • Debian 6.0(squeeze) — 被淘汰的稳定版
  • Debian GNU/Linux 5.0(lenny) — 被淘汰的稳定版
  • Debian GNU/Linux 4.0(etch) — 被淘汰的稳定版
  • Debian GNU/Linux 3.1(sarge) — 被淘汰的稳定版
  • Debian GNU/Linux 3.0(woody) — 被淘汰的稳定版
  • Debian GNU/Linux 2.2(potato) — 被淘汰的稳定版
  • Debian GNU/Linux 2.1(slink) — 被淘汰的稳定版
  • Debian GNU/Linux 2.0(hamm) — 被淘汰的稳定版
  • Some user-provided 2.0, 2.1 and 2.2 images (Hamm, Slink, Potato)
  • 3.0_r0 to 3.0_r6 (Woody)
  • 3.1_r0 to 3.1_r8 (Sarge)
  • 4.0_r0 to 4.0_r9 (Etch)
  • 5.0.0 to 5.0.10 (Lenny)
  • 6.0.0 to 6.0.10 (Squeeze)
  • 7.0.0 to 7.11.0 (Wheezy)
  • 8.0.0 to 8.11.0 (Jessie)
  • 8.11.1 (Jessie LTS, for some arches only)
  • 9.0.0 to 9.13.0 (Stretch)
  • 10.0.0 to ... (Buster)
  • 11.0.0 to ... (Bullseye)

Ubuntu 各版本代号对照表

版本号 代号 发布时间

  • 4.10(初始发布版本) Warty Warthog 2004-10-20
  • 5.04 Hoary Hedgehog 2005-04-08
  • 5.10 Breezy Badger 2005-10-13
  • 6.06 LTS Dapper Drake 2006-06-01
  • 6.10 Edgy Eft 2006-10-26
  • 7.04 Feisty Fawn 2007-04-19
  • 7.10 Gutsy Gibbon 2007-10-18
  • 8.04 LTS Hardy Heron 2008-04-24
  • 8.10 Intrepid Ibex 2008-10-30
  • 9.04 Jaunty Jackalope 2009-04-23
  • 9.10 Karmic Koala 2009-10-29
  • 10.04 LTS Lucid Lynx 2010-04-29
  • 10.10 Maverick Meerkat 2010-10-10
  • 11.04(Unity成为默认桌面环境) Natty Narwhal 2011-04-28
  • 11.10 Oneiric Ocelot 2011-10-13
  • 12.04 LTS Precise Pangolin 2012-04-26
  • 12.10 Quantal Quetzal 2012-10-18
  • 13.04 Raring Ringtail 2013-04-25
  • 13.10 Saucy Salamander 2013-10-17
  • 14.04 LTS Trusty Tahr 2014-04-18
  • 14.10 Utopic Unicorn 2014-10-23
  • 15.04 Vivid Vervet 2015-04-22
  • 15.10 Wily Werewolf 2015-10-23
  • 16.04 LTS Xenial Xerus 2016-04-21
  • 16.10 Yakkety Yak 2016-10-20
  • 17.04 Zesty Zapus 2017-04-13
  • 17.10(GNOME成为默认桌面环境) Artful Aardvark 2017-10-21
  • 18.04 LTS Bionic Beaver 2018-04-26
  • 18.10 Cosmic Cuttlefish 2018-10-18
  • 19.04 Disco Dingo 2019-4-19
  • 19.10 Eoan Ermine 2019-10-17
  • 20.04 LTS Focal Fossa 2020-04-23
  • 20.10 Groovy Gorilla 2020-10-22
  • 21.04 Hirsute Hippo 2021-04-22

C++版本 GCC版本支持情况 GCC版本 指定版本的命令标志

c++ && 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
  • gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
  • g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
  • gcc (ubuntu1~18.04) 7.5.0
  • gcc (ubuntu1~16.04) 4.7 5.4,6.3
  • gcc (debian 8) 4.9.2
  • gcc (debian 9) 6.3.0
  • gcc (debian 10) 9.3.0
  • -std=$std c89 c99 c11 c17 gnu89 gnu99 gnu11 gnu17
  • -std=$std c++98 c++11 c++14 c++17 gnu++98 gnu++11 gnu++14 gnu++17

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

vs

  • C++17:vs2017基本支持,vs2015部分支持。
  • C++14:vs2017就可以完全支持,vs2015基本支持,vs2013部分支持。
  • C++11:vs2015及以上可以完全支持。vs2013基本支持,vs2012部分支持,vs2010及以下版本不支持。
  • VC11,Visual Studio 2012编译器
  • VC14,Visual Studio 2015编译器
  • VC15,Visual Studio 2017编译器
  • VC11构建需要安装Visual Studio 2012 x86或x64的Visual C ++ Redistributable
  • VC14构建需要安装Visual Studio 2015 x86或x64的Visual C ++ Redistributable
  • VC15构建需要安装Visual Studio 2017 x64或x86的Visual C ++ Redistributable
  • C++20标准库(STL)现已在VS2022 v17.2和VS2019 v16.11.14
  • vs不同版本支持的c++版本#
  • C++17:vs2017基本支持,vs2015部分支持。
  • C++14:vs2017就可以完全支持,vs2015基本支持,vs2013部分支持。
  • C++11:vs2015及以上可以完全支持。vs2013基本支持,vs2012部分支持,vs2010及以下版本不支持。
  • Visual Studio 2012:v110
  • Visual Studio 2013:v120
  • Visual Studio 2015:v140
  • Visual Studio 2017:v141
  • Visual Studio 2019:v142
  • Visual Studio 2022:v143
  • Visual Studio 6 : vc6
  • Visual Studio 2003 : vc7
  • Visual Studio 2005 : vc8
  • Visual Studio 2008 : vc9
  • Visual Studio 2010 : vc10
  • Visual Studio 2012 : vc11
  • Visual Studio 2013 : vc12
  • Visual Studio 2015 : vc14
  • Visual Studio 2017 : vc15
  • C++17: gcc7完全支持,gcc6和gcc5部分支持,gcc6支持度当然比gcc5高,gcc4及以下版本不支持。
  • C++14: gcc5就可以完全支持,gcc4部分支持,gcc3及以下版本不支持。
  • C++11: gcc4.8.1及以上可以完全支持。gcc4.3部分支持,gcc4.3以下版本不支持。
  • cmake .. -G "Visual Studio 14 2015"
  • cmake .. -G "Visual Studio 9 2008"
  • cmake -G
  • Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files. Optional [arch] can be "Win64" or "ARM".
  • Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files. Optional [arch] can be "Win64" or "ARM".
  • Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files. Optional [arch] can be "Win64" or "ARM".
  • Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files. Optional [arch] can be "Win64" or "IA64".
  • Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files. Optional [arch] can be "Win64" or "IA64".
  • Visual Studio 8 2005 [arch] = Deprecated. Generates Visual Studio 2005 project files. Optional [arch] can be-"Win64".
  • MSVC_VERSION Value Visual Studio version
  • 1200 VS 6.0
  • 1300 VS 7.0
  • 1310 VS 7.1
  • 1400 VS 8.0 (v80 toolset)
  • 1500 VS 9.0 (v90 toolset)
  • 1600 VS 10.0 (v100 toolset)
  • 1700 VS 11.0 (v110 toolset)
  • 1800 VS 12.0 (v120 toolset)
  • 1900 VS 14.0 (v140 toolset)
  • 1910-1919 VS 15.0 (v141 toolset)
  • 1920-1929 VS 16.0 (v142 toolset)
  • 1930-1939 VS 17.0 (v143 toolset)

  • vnc & novnc useful

  • > sudo apt-get install x11vnc
  • > x11vnc -storepasswd
  • 1, download novnc (noVNC-1.3.0)
  • 2, npm install , npm run prepublish
  • 3, copy all(vnc.html vnc_lite.html app core lib vendor) to top httpd dir
  • 4, build websockify (c make)
  • 5, openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
  • 6, ./websockify 127.0.0.1:5900 192.168.1.31:5900
  • 7, http://localhost/vnc.html?host=127.0.0.1&port=5900

sql窗口函数初识

sql

  • MySQL从8.0开始支持窗口函数,这个功能在大多数据库中早已支持,有的也叫分析函数。
  • Postgresql 11 针对窗口函数(window function)进行了增强,添加了 sql:2011 标准中的所有窗口范围(window frame)子句选项
  • 1、什么是窗口函数
  • 窗口函数在和当前行相关的一组表行上执行计算。 这相当于一个可以由聚合函数完成的计算类型。但不同于常规的聚合函数, 使用的窗口函数不会导致行被分组到一个单一的输出行;行保留其独立的身份。 在后台,窗口函数能够访问的不止查询结果的当前行。
  • 可以访问与当前记录相关的多行记录;
  • 不会使多行聚集成一行, 与聚集函数的区别;
  • 2、窗口函数语法
  • window_func() OVER(PARTITION BY [字段] ORDER BY [字段])
  • 窗口函数跟随一个OVER子句,OVER子句决定究竟查询中的哪些行被分离出来由窗口函数处理。其中分区PARTITION BY与排序ORDER BY指令可以可选的,如果不指定,则等同于聚合函数,对全部数据进行计算。
  • 1.排名函数:row_number/rank/dense_rank
    1. 排序函数(分区最大/最小值):first_value/last_value
    1. 分布函数(累积百分比):cume_dist / sum() over
  • 4.偏移函数:lead/lag

java & download

java & scala

linux proxy 代理上网设置

client terminal

  • export http_proxy="http://192.168.1.6:8088"
  • export https_proxy="http:// 192.168.1.6:8088"
  • export ftp_proxy=$http_proxy
  • export https_proxy=http://192.168.1.6:8088
  • export http_proxy=http://192.168.1.6:8088
  • export all_proxy=socks5://192.168.1.6:8088
  • source /etc/profile
  • curl www.google.com

client apt-get

sudo vim /etc/apt/apt.conf.d/proxy.conf

server nginx

vim config/nginx.conf

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  logs/access.log  main;
    server{
            resolver 223.5.5.5;
            resolver_timeout 30s;
            listen 8088;
            location / {
                    proxy_pass http://$http_host$request_uri;
                    proxy_set_header Host $http_host;
                    proxy_buffers 256 4k;
                    proxy_max_temp_file_size 0;
                    proxy_connect_timeout 30;
                    proxy_cache_valid 200 302 10m;
                    proxy_cache_valid 301 1h;
                    proxy_cache_valid any 1m;
            }
    }
    server {
        listen       80;
        server_name  localhost;
        location / {
            root   html;
            index  index.html index.htm;
        }
    }
}
  • cat logs/access.log for check

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

xrdp

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

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 为默认参数

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'
ln -s ./k0sctl-linux-x64 k0sctl
ln -s ./k0s-v1.23.5+k0s.0-amd64 k0s

Win10 安装 OpenSSH 实现 SSH 远程登录

检查并且关闭防火墙,需要将 OpenSSH添加到path变量 否则 sftp会有认证问题。

  • NetSh Advfirewall set allprofiles state off #关闭防火墙
  • Netsh Advfirewall show allprofiles #查看防火墙状态
  • 安装方法一
  • 在系统内打开“设置”,选择“应用”>“应用和功能”,然后选择“可选功能 ”,搜索“OpenSSH”,查看是否已安装 OpenSSH, 如果未安
  • 装,请在页面顶部选择“添加功能”,然后:查找“OpenSSH 客户端”,再单击“安装”
  • 安装方法二
  • 查找
  • Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
  • 添加
  • Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
  • Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
  • 配置 OpenSSH
  • Start-Service sshd
  • Set-Service -Name sshd -StartupType 'Automatic'
  • 卸载 OpenSSH
  • Remove-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
  • Remove-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

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 状态

linux grub 调整

sudo vim /etc/default/grub

  • GRUB_DEFAULT=0
  • GRUB_DEFAULT=2
  • sudo update-grub

qt linuxdeployqt

  • 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

命令行重复执行命令

(mac 适用)
方法一、 while true; do ; sleep 1; done 无限重复执行,间隔单位秒。
方法二、 seq 10 | xargs -I (sudo)
重复执行 10 次,间隔约 0.4s,出现 xargs: xxx: Permission denied 时可加上 sudo。

npm config

[============================================>] 100.0% of 2.79 mB (2.79 mB/s)

  • 2001 cd /home/andy/NodejsProjects/my-project-webui/
  • 2002 npm install
  • 2002 npm run dev
  • 2003 cd /home/andy/NodejsProjects/my-project-appui/
  • 2003 npm install
  • 2004 npm run build:linux
  • 2058 ldd libffmpeg.so
  • 2059 readelf -d libffmpeg.so
  • 2060 readelf libffmpeg.so
  • 2065 nm -D libffmpeg.so
  • 2067 objdump -tT libffmpeg.so

ubuntu 打开 chrome 弹出“Enter password to unlock your login keyring”解决方法

sudo rm -rf /home/andy/.local/share/keyrings/login.keyring

android mount & service

  • 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

gradlew 常用命令

https://downloads.gradle-dn.com/distributions/gradle-6.1.1-all.zip
在开发时有些小伙伴喜欢使用./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 // 查看详细的资源文件信息

linux mysql安装

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

linux go env & npm config

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=auto
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct

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

kafka2.8.1 版本 搭建部署启动 kafka

(一):搭建部署

  • 在新发布的 kafka2.8.0 版本中,已经可以不启动 zk 就可以使用 kafka 了,
  • 在 config 目录下多了一个 kraft 目录,在该目录中有一套新的配置文件,可以直接脱离 ZooKeeper 运行。
  • 修改配置到 config 下 kraft 目录中修改 server.properties 文件,单机的话主要是修改下面的配置
  • advertised.listeners=PLAINTEXT://localhost:9092
  • log.dirs=/tmp/kraft-combined-logs

(二):启动 kafka

  • 通过现在三行命令,即可开启一个单机的 broker
  • bin/kafka-topics.sh --create --topic foo --partitions 1 --replication-factor 1 --bootstrap-server localhost:9092
  • 参数 值类型 说明 有效值
  • --topic string 被消费的 topic
  • --whitelist string 正则表达式,指定要包含以供使用的主题的白名单
  • --partition integer 指定分区 除非指定’–offset’,否则从分区结束(latest)开始消费
  • --offset string 执行消费的起始 offset 位置 默认值:latest
  • --from-beginning 从存在的最早消息开始,而不是从最新消息开始
  • --max-messages integer 消费的最大数据量,若不指定,则持续消费下去
  • --timeout-ms integer 在指定时间间隔内没有消息可用时退出
  • --bootstrap-server string 必需(除非使用旧版本的消费者),要连接的服务器
  • --key-deserializer string
  • --value-deserializer string
  • --group string 指定消费者所属组的 ID
  • --zookeeper string 必需(仅当使用旧的使用者时)连接 zookeeper 的字符串。可以给出多个 URL 以允许故障转移
./bin/kafka-storage.sh random-uuid
./bin/kafka-storage.sh format -t 1DViwWWpQf63N6bhJFAgzQ -c ./config/kraft/server.properties
./bin/kafka-server-start.sh ./config/kraft/server.properties #后台启动
./bin/kafka-server-start.sh -daemon ./config/kraft/server.properties

停止 kafka
./bin/kafka-server-stop.sh

创建 topic

./bin/kafka-topics.sh --create --topic test --partitions 1 --replication-factor 1 --bootstrap-server localhost:9092

查看 topic 信息

./bin/kafka-topics.sh --describe --bootstrap-server localhost:9092 --topic test

./bin/kafka-topics.sh --describe --bootstrap-server localhost:9092

删除 topic

./bin/kafka-topics.sh --delete --bootstrap-server localhost:9092 --topic test

发送消息

./bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic test

消费消息

./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning

./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test

./examples/producer localhost:9092 test
./examples/consumer localhost:9092 1 test

> kafka check offset
kafka-topics.sh --bootstrap-server 192.168.1.31:9092 --list
kafka-consumer-groups.sh --bootstrap-server 192.168.1.31:9092 --list
kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list 192.168.1.31:9092 -topic eth-link-data
kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list 192.168.1.31:9092 -topic eth-term-stat
kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list 192.168.1.31:9092 -topic eth-term-sums

查看 消費組和偏移量 信息
kafka-consumer-groups.sh --bootstrap-server 192.168.1.111:9092 --list
kafka-consumer-groups.sh --describe --bootstrap-server 192.168.1.111:9092 --group local-consumer-group1
查看 基於分區和偏移量 信息
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
kafka-console-consumer.sh --bootstrap-server 192.168.1.111:9092 --topic eth-term-sums --partition 0 --offset latest
kafka-console-consumer.sh --bootstrap-server 192.168.1.111:9092 --topic eth-term-sums --partition 0 --offset earliest
kafka-console-consumer.sh --bootstrap-server 192.168.1.111:9092 --topic eth-term-sums --partition 0 --offset 3395



#################################################################################################
OTHER:

bin/kafka-storage.sh random-uuid > uuid
bin/kafka-storage.sh format -t `cat uuid` -c config/kraft/server.properties
bin/kafka-server-start.sh -daemon config/kraft/server.properties
bin/kafka-topics.sh --create --topic foo --partitions 1 --replication-factor 1 --bootstrap-server localhost:9092
#################################################################################################

Linux systemctl 服务管理

systemctl command

sudo systemctl status autosync.service
sudo systemctl status autosync.service -l
systemd-analyze critical-chain autosync.service
systemctl show autosync.service
sudo journalctl -u autosync.service
sudo systemctl restart autosync.service
sudo journalctl -u autosync.service
sudo systemctl restart autosync.service
systemctl show autosync.service
sudo systemctl status autosync.service -l
sudo vim /etc/systemd/system/autosync.service
sudo systemctl restart autosync.service
sudo systemctl restart autosync.service
sudo systemctl status autosync.service -l
systemctl daemon-reload # 重启载入服务配置
systemctl list-units --type=service # 查看已启动的服务
systemctl list-unit-files | grep enable # 查看是否设置开机启动

nginx

cat /etc/nginx/nginx.conf
cat /etc/nginx/sites-available/default
sudo systemctl restart nginx.service

apache2

pwd
ll
sudo apt-get install -y apache2
cd ~
sudo a2enmod dav
sudo a2enmod dav_fs
sudo mkdir -p /var/www/webdav
sudo chown -R www-data:www-data /var/www/webdav
sudo htpasswd -c /etc/apache2/webdav.password dav
sudo chown root:www-data /etc/apache2/webdav.password
sudo chmod 640 /etc/apache2/webdav.password
sudo vim /etc/apache2/sites-available/000-default.conf
mkdir /home/pi/webdav
sudo vim /etc/apache2/sites-available/000-default.conf
sudo systemctl restart apache2
sudo /etc/init.d/apache2 reload
cat /etc/apache2/sites-available/000-default.conf
systemctl status autofrpc
vim /boot/rpi/frpc.ini
sudo vim /boot/rpi/frpc.ini
systemctl restart autofrpc
history

pi command

sudo apt-get install sshfs
sudo apt-get install xrdp
ll
mkdir -p ~/pi/
sshfs pi@192.168.1.4:/home/pi ~/pi/
umount ~/pi/
sudo umount ~/pi/
sshfs pi@192.168.1.4:/home ~/pi/
sudo umount ~/pi/
sshfs pi@192.168.1.4:/ ~/pi/
history
sudo umount ~/pi/
history
andy@andy-ThinkPad-T440s:~$


df -BG
fdisk 2019-04-08-raspbian-stretch-lite.img
sudo mount -o loop,offset=4194304 2019-04-08-raspbian-stretch-lite.img /mnt/
fdisk -l 2019-04-08-raspbian-stretch-lite.img
mount **_.img /Volumes/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
sudo mount _**.img /mnt/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
mkdir /mnt/boot
sudo mkdir /mnt/boot
sudo mount \*\*\*.img /mnt/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
sudo mount 2019-04-08-raspbian-stretch-lite.img /mnt/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
sudo dd bs=4M if=2019-04-08-raspbian-stretch-lite.img of=/dev/sdc
ll /mnt/
ll
sudo mount 2019-04-08-raspbian-stretch-lite.img /mnt/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
fdisk -l 2019-04-08-raspbian-stretch-lite.img
sudo ls /mnt/boot/
umount /mnt/boot
sudo umount /mnt/boot
sudo chmod 777 /mnt/boot/
sudo mount 2019-04-08-raspbian-stretch-lite.img /mnt/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
sudo umount /mnt/boot
sudo mount 2021-05-07-raspios-buster-armhf-lite.img /mnt/boot -t vfat -o rw,loop,offset=4194304,sizelimit=45297664
fdisk -l 2021-05-07-raspios-buster-armhf-lite.img
fdisk -l 2019-04-08-raspbian-stretch-lite.img
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 netstat -tap | grep mysql
sudo mysql_secure_installation
sudo mysql -uroot -proot

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
  • 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

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

  • iface default inet dhcp

ifconfig configure network

ifconfig

  • ifconfig -a
  • ifconfig eth0 up
  • ifconfig eth0 down
  • ifconfig eth0 192.168.2.10
  • ifconfig eth0 192.168.2.10 netmask 255.255.255.0
  • ifconfig eth0 192.168.2.10 netmask 255.255.255.0 broadcast 192.168.2.255

pyinstaller

  • pyinstaller -F -w -i favicon.ico curFile.py
  • pyinstaller --distpath . -F -w -i favicon.ico test.py
  • pip install python-docx
  • pip install python-docx -i https://pypi.tuna.tsinghua.edu.cn/simple
  • pip install openpyxl==2.6.4
  • pip install python-docx==0.8.10
  • pip install PyMySQL==0.9.3
  • pip install redis==3.5.3
  • pip install PyQt4-4.11.4-cp27-cp27m-win32.whl
  • pip install numpy==1.16.6
  • pip install pandas==0.24.2
  • pip install --target=path_name package_name
  • pip install --target=D:\dev\python\ PyQt4-4.11.4-cp27-cp27m-win_amd64.whl

sip is in package PyQt4-4.11.4-cp27-cp27m-win_amd64.whl

  • python -m ensurepip --default-pip

only for python2

  • pip install pefile==2019.4.18
  • pip install PyInstaller==3.6
  • pip install python-qt5==0.1.10
  • pip install PyInstaller==3.6
  • pip download python-qt5==0.1.10
  • pip install python-qt5==0.1.10

python3 PyQt5 PyQt5-tools 安装

  • pip install pyQt5
  • pip install pyQt5-tools

website ipaddress

download ide

bootloader black mac

download debian

download mingw

download clangd

download xcode

xcode download link

linux 微信ubuntu麒麟官网下载

http://archive.ubuntukylin.com/software/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