解决办法:
进入单用户 #fsck -p
#shutdown -r now

实践:
应该是直接进入单用户模式了:

vim /etc/fstab      #(dum=0, pass#=0),之前都是1,全改为0。


  学习的BSD的教材上,作者明确指出不要用reboot和halt执行重启和关机动作,那样系统不会执行rc.shutdown脚本导致不能在文件系统上设立“清除”标记,下次开机时系统会自动调用FSCK来检查文件系统一的。



异常掉电可能引起磁盘分区被标记为dirty,默认地,系统下一次启动时会运行fsck进行分区检查和错误恢复。如果fsck过程中某个操作需要用户干预或确认,而现在的应用没有使用显示器和键盘鼠标,启动过程可能无法继续进行。
1、编辑/etc/fstab,将分区标记为无须检查(dum=0, pass#=0),详见man fstab
2、编辑/etc/rc.conf,添加以下内容:
      fsck_y_enable="YES"
      fsck_background="NO"            

這個檔案用來定義開機時要掛入的檔案分割區。

# 裝置名稱  掛入點  檔案系統   參數  Dump   Pass#
/dev/ad0s1b  none  swap  sw 0  0
/dev/ad0s1a / ufs rw 1 1

原文链接:https://blog.csdn.net/ncdawen/article/details/574279


掛入點就是你要將來源掛到什麼地方,其中 swap 沒有掛入點,所以是 none。
檔案系統就是要掛入的類型,必須在 kernel 中有定義。一般 FreeBSD 的檔案是 ufs,硬碟要掛入的設定就是 ufs。如果是 cdrom 就是

cd9660。
ufs 本地的 UNIX 檔案系統。
mfs 本地的 memory-based UNIX 檔案系統。
nfs 和 Sun Microsystems 相容的 "Network File System"。
swap 用來作 swapping 的檔案系統。
msdos DOS 相容的檔案系統。
cd9660 CD-ROM 的檔案系統。
procfs 用來存取執行程序(process)的檔案系統。
kernfs 用來存取核心參數(kernel parameter)的檔案系統。
原文链接:https://blog.csdn.net/ncdawen/article/details/574279
理解谁干的,有可能是nm干的,或者黑客干的,极有可能是CentOS8引入两个管理网络的network和NetworkManager都启动后“打架”干的。

实际上这俩都开了:
systemctl  status network
● network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network; generated)
   Active: active (exited) since Sat 2022-03-26 05:56:48 CST; 9min ago
#systemctl  status NetworkManager
● NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2022-03-26 05:56:41 CST; 9min ago
     Docs: man:NetworkManager(8)
Main PID: 2465 (NetworkManager)
只开network的步骤:
一、都禁用:
systemctl mask network
Created symlink /etc/systemd/system/network.service → /dev/null.

systemctl mask NetworkManager
Created symlink /etc/systemd/system/NetworkManager.service → /dev/null.

二、启用一个:
/usr/lib/systemd/systemd-sysv-install enable network
#下面提示怎么启用:
systemctl enable network
network.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable network

三、测试NetworkManager 被彻底禁用了:
systemctl start NetworkManager
Failed to start NetworkManager.service: Unit NetworkManager.service is masked.

mask彻底禁用systemctl服务:
https://blog.csdn.net/stpice/article/details/104569146/

----------------------------------------------------------
cd /etc/sysconfig/network-scripts/ifcfg-lanbr0
#cat ifcfg-
ifcfg-eno1    ifcfg-lanbr0  ifcfg-lo      

在桥接的网卡lanbr0新增:
/etc/sysconfig/network-scripts/
DNS1=202.106.196.115
DNS2=114.114.114.114

重启动后,会将/etc/resolv.conf的配置重新刷成上面的(测试过删除一行:nameserver 114.114.114.114,重启后会自动加上):
#cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 202.106.196.115
nameserver 114.114.114.114

#cat ifcfg-eno1
DEVICE="eno1"
ONBOOT="yes"
BRIDGE="lanbr0"

#cat ifcfg-lanbr0
DEVICE="lanbr0"
ONBOOT="yes"
TYPE="Bridge"
BOOTPROTO="none"
IPADDR="10.10.0.1**"
NETMASK="255.255.255.0"
GATEWAY="10.10.0.1"
DNS1=202.106.196.115
DNS2=114.114.114.114
Centos重新启动网络配置文件,/etc/resolv.conf被覆盖或清空问题解决
cat short-if.go


go build short-if.go  
./short-if
1
SpaceX

./short-if
2
Virgin Galactic

./short-if
0
Space Adventures


如果不加:
        rand.Seed(time.Now().Unix())

其值一直是:2

原因是:https://blog.csdn.net/weixin_33816821/article/details/94581126


Go语言的switch语法学习之num的简短声明也可用于switch语句的一部分:


./short-switch
Virgin Galactic

./short-switch  
Random spaceline # 4


cat scope-rules.go   #几月有多少天的一个判断:



./scope-rules
AD 2018 10 24


        default:
            day := rand.Intn(31) + 1
            fmt.Println(era, year, month, day)
        }
        fmt.Println(month,day)  //作用域不再有了。
go build scope-rules.go      
# command-line-arguments
./scope-rules.go:22:14: undefined: month
./scope-rules.go:22:20: undefined: day


包括switch的每个case也是都拥有自己独立的作用域,每个分支里面的day变量在分支结束后,day变量将不再处于作用域之内,switch分支的作用域是唯一一种无需使用大括号标识的作用域。


cat random-date.go



#./random-date
AD 2018 11 30

#./random-date
AD 2018 11 30


研究下闰年:
cat random-date-study.go


./random-date-study
AD 2000 2 18
AD 2000 2 4
AD 2000 2 6
AD 2000 2 8
AD 2000 2 7
AD 2000 2 21
AD 2000 2 7
AD 2000 2 29
AD 2000 2 12
AD 2000 2 12
下载:
https://golang.google.cn/dl/go1.17.8.linux-amd64.tar.gz
完成之后解压到/usr/local
tar -C /usr/local -xzf go1.17.8.linux-amd64.tar.gz

打开环境变量文件
vi /etc/profile.d/golang.sh
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=/root/go
export PATH=$PATH:$GOPATH/BIN

刷新环境变量
source /etc/profile.d/golang.sh
一、CentOS Linux release 8.5更换阿里yum源:

来自:https://blog.csdn.net/alfiy/article/details/121897360

二、Centos8 不在维护,第三方的镜像站中均已移除CentOS 8的源,yum install 会报错建议更换源。
备份旧的:
cd /etc/yum.repos.d/
mv CentOS-Base-aliyun-8.repo CentOS-Base-aliyun-8.repo.bak
mv CentOS-Base.repo CentOS-Base.repo.bak


下载新的:
wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo
yum clean all && yum makecache



下载:
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
yum install -y epel-release
yum clean all
rpm --rebuilddb
yum update
yum list
yum makecache


来自:https://www.ngui.cc/article/show-390936.html
curl -v -d'1)杰克。
2)杰克\r\n3)杰克东
3)你是谁 "a" "b"
                 [空行的空格全是下划]
4)jack    ' x.xxxx.com


来自:https://blog.csdn.net/zhaozhi406/article/details/11131971
https://www.xknote.com/blog/1127037.html


背景:有时你想测试一下传说中的微服务如熔断,服务器的接口超时(尤其是上传姑且叫大文件),这个rpm包应该是有用的。
限速
wondershaper是国外人开发的一款在Linux内核下基于TC工具的对整块网卡的限度工具。

第一种安装方法
首先下载wondershaper的rpm安装包:wondershaper-1.1a-7.noarch.rpm

安装wondershaper:
[root@localhost ~]# rpm -ivh wondershaper-1.1a-7.noarch.rpm


第二种安装方法
由于Centos7第三方库内才有这个软件,先安装第三方库
yum install epel-release -y
yum install wondershaper -y
限速命令:
第一个参数为网卡接口名,后面两个数字分别代表上行和下行的速度(单位Kb)

[root@localhost ~]# wondershaper eth0 5000 500
取消限速:

[root@localhost ~]# wondershaper clear eth0

来自:https://www.shuzhiduo.com/A/LPdo61bg53/
     Alfred是Mac下一个非常强大的工具,网上有许多如何使用的教程,我目前也只是会使用一些基本功能。其中一个我特别喜欢的功能就是直接可以在Alfred里面输入shell命令(默认需要在命令前家>符号,表示是shell命令),然后就会自动打开终端执行。但这里有个问题就是Alfred默认使用Mac自带的Terminal,而大多数在Mac经常使用终端的一般都会使用iTerm2,因为它配合zsh+oh my zsh,真的是非常强大。对于目前最新的iTerm 3.x版本,可以通过如下方法将Alfred内置的Terminal改为iTerm2:

打开Alfred的"Preferences->features->Terminal/shell",将"Application"选为"custom",然后将下面的编辑框中的脚本内容替换为下面的


需要注意的是不同的iTerm2版本脚本内容不太一样,该脚本适用于最新的iTerm2版本,即iTerm2 3.0.

实践来自:https://www.cxymm.net/article/qq_29855509/120960802
sudo codesign --force --deep --sign - /Applications/PhotoScapeX.app

修复失败。
强制关掉一些进程后,方可使用zsh,发现有一个进程开了太多的进程:
ps -ef|grep UltraSearchSyste|wc -l
    3594
zsh出现 :fork failed: resource temporarily unavailable,且启动不了程序了。

ps -ef|grep UltraSearchSyste|head -1
    0   105     1   0 四05下午 ??         9:44.65 /var/root/.UltraSearchSystem/UltraSearchSystemDaemon pd

    0 98562   105   0  3:41下午 ??         0:00.00 (UltraSearchSyste)
    0 98569   105   0  9:05下午 ??         0:00.00 (UltraSearchSyste)

开机启动位置,以为它是:
ls ~+/com.UltraSearchSystemDaemon.plist
cat ~+/com.UltraSearchSystemDaemon.plist


其实,它不是,是它,符合位置和pd参数:
/Library/LaunchDaemons/com.UltraSearchSystemP.plist

解决开机启动问题:
sudo rm -rf  ~+/com.UltraSearchSystemP.plist
Password:
来自:

如何删除mac上的ultrasearchapp?
https://www.zhihu.com/question/400059869
再次参考:https://www.makeuseof.com/tag/hidden-launchdaemons-launchagents-mac/
来自:https://www.pcrisk.com/removal-guides/18893-ultrasearchsystem-adware-mac
执行命令:sudo su -
source ~/.zshrc
compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew_cask

出现:compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew_cask
解决办法:
vim /usr/local/share/zsh/site-functions/_brew_cask



来自:https://blog.csdn.net/shentian885/article/details/115902464
在 Linux 系统中,你可以通过访问 /proc/<PID>/cmdline 文件来查看进程的启动命令和参数,其中 <PID> 是进程的 ID。这个文件包含了进程启动时使用的完整命令行,参数之间用 null 字符(ASCII码值为0)分隔。

例如,你可以使用以下命令来查看特定进程的命令行参数:
cat /proc/<PID>/cmdline

这将输出进程的启动命令及参数列表,以 null 字符分隔。

问:
的确,cat /proc/45063/cmdline
./multiupd-d
这个实际参数-d前面有空格,如何分离出来
答:
在 `/proc/<PID>/cmdline` 中,命令行参数以 null 字符(ASCII码值为0)分隔。你可以通过读取该文件并以 null 字符分割内容来获得参数列表。在某些编程语言中,你可以按照 null 字符(ASCII码值为0)来分割字符串。

例如,在 Bash 中,你可以使用 `tr` 命令来将 null 字符替换成其他分隔符,然后查看参数列表:

```bash
cat /proc/45063/cmdline | tr '\0' '\n'
```

这将把 null 字符替换成换行符,使得参数列表更易于阅读。
ps -ef|grep multi
root     45055     1  0 11:41 ?        00:00:00 ./multiupd -d
root     45063 45055  0 11:41 ?        00:00:00 ./multiupd -d

cat /proc/45055/cmdline | tr '\0' '\n'
./multiupd
-d
cat /proc/45063/cmdline | tr '\0' '\n'
./multiupd
-d





ps只能看到部分:
root      3195  2205  0 Jun19 ?        00:00:13 containerd-shim -namespace moby -workdir /var/lib/containerd/io.containerd.runtime.v1.linux/moby/0a8be205faf5aa1500e55e83e36a3027c626ae

cat查看:
#cat /proc/3195/cmdline
containerd-shim-namespacemoby-workdir/var/lib/containerd/io.containerd.runtime.v1.linux/moby/0a8be205faf5aa1500e55e83e36a3027c626aea234747a51c949ffb1a9f95c83-address/run/containerd/containerd.sock-containerd-binary/usr/bin/containerd-runtime-root/var/run/docker/runtime-runc-systemd-cgroup



二、执行程序的软链接:
#ls -lart /proc/3195/exe
lrwxrwxrwx 1 root root 0 Jun 25 10:06 /proc/3195/exe -> /usr/bin/containerd-shim



三、环境变量:
#cat /proc/3195/environ
LANG=en_US.UTF-8PATH=/opt/containerd/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/binLD_LIBRARY_PATH=:/opt/containerd/libGOMAXPROCS=2



四、对应的fd编号:
#ls /proc/3195/fd
0  1  10  11  12  13  14  15  16  17  18  19  2  20  3  4  5  6  7  8  9

mac下面sudo su - 后出现:
sudo su
Password:
[Oh My Zsh] Would you like to update? [Y/n]: y
Updating Oh My Zsh
error: 不能变基式拉取:您有未暂存的变更。
error: 请提交或贮藏它们。
There was an error updating. Try again later?

最后我的解决办法是:
cd  ~/.oh-my-zsh/

git status
位于分支 master
您的分支与上游分支 'origin/master' 一致。

尚未暂存以备提交的变更:
  (使用 "git add <文件>..." 更新要提交的内容)
  (使用 "git restore <文件>..." 丢弃工作区的改动)
  类型变更: plugins/fedora/fedora.plugin.zsh
  类型变更: plugins/go/go.plugin.zsh
  类型变更: plugins/gradle/_gradle
  类型变更: plugins/gradle/_gradlew
  类型变更: plugins/per-directory-history/per-directory-history.plugin.zsh

git reset --hard origin/master #强制让本地的代码和远端一致
HEAD 现在位于 08da19e3 emacs: revert cab1ac6e682038b2ceca9d16f8c458c0e79149ca (#7765)

git status
位于分支 master
您的分支与上游分支 'origin/master' 一致。

git pull
remote: Enumerating objects: 9644, done.

root@bogon# upgrade_oh_my_zsh
Note: `upgrade_oh_my_zsh` is deprecated. Use `omz update` instead.
Updating Oh My Zsh
From https://github.com/ohmyzsh/ohmyzsh
* branch              master     -> FETCH_HEAD
Current branch master is up to date.
         __                                     __
  ____  / /_     ____ ___  __  __   ____  _____/ /_
/ __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / /
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/
                        /____/

Oh My Zsh is already at the latest version.
To keep up with the latest news and updates, follow us on Twitter: https://twitter.com/ohmyzsh
Want to get involved in the community? Join our Discord: https://discord.gg/ohmyzsh
Get your Oh My Zsh swag at: https://shop.planetargon.com/collections/oh-my-zsh


参考:https://www.chendalei.com/articles/2018/10/09/1539052284615.html
提示:

Updating Oh My Zsh
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.
There was an error updating. Try again later?

这种情况很可能发生,因为您已经在.oh-my-zsh目录中编辑了一些内容但尚未提交。

导航到该目录(.oh-my-zsh/目录)。
运行git status。 它应该显示已更改的文件列表。
使用git add暂存这些文件
使用git commit -m提交这些更改
你现在应该可以升级了。

可选:在步骤2之后,您可以运行git commit -a -m,它应该暂存所有未暂存的文件并提交这些更改(组合步骤3和4)。
然后通过upgrade_oh_my_zsh命令升级zsh。

参考来源:https://github.com/robbyrussell/oh-my-zsh/issues/1984
解决办法:
下载VCRUNTIME140.dll文件;微软官网:下载地址:https://www.microsoft.com/en-us/download/details.aspx?id=52685

下载真实地址及名称:vc_redist.x64.exe
https://download.microsoft.com/download/0/6/4/064F84EA-D1DB-4EAA-9A5C-CC2F0FF6A638/vc_redist.x64.exe
此次学习来源:https://mp.weixin.qq.com/s/YqZI4XUlsyPpaGIjy0pG3A
#cat p.c


#./p
value= 520

cat pp.c

#./pp


cat ppp.c

#./ppp
value0 = 1
value1 = 2
value2 = 3
temp[0] = 1
temp[1] = 2
temp[2] = 3

以前的学习:
https://jackxiang.com/post/7485/
分页: 4/339 第一页 上页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 下页 最后页 [ 显示模式: 摘要 | 列表 ]