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/
在Centos8环境中配置PHP出现如上报错:
 
原因是没有安装配置oniguruma导致的 
解决方法如下:
1、获取源码,2.并解压

wget https://github.com/kkos/oniguruma/archive/v6.9.4.tar.gz -O oniguruma-6.9.4.tar.gz
tar -zxf oniguruma-6.9.4.tar.gz
cd oniguruma-6.9.4
备用下载: http://down.24kplus.com/linux/oniguruma/oniguruma-6.9.4.tar.gz

3、编译安装

./autogen.sh && ./configure --prefix=/usr
make && make install
如果是Centos7环境中的话:
 解决方法如下:

yum -y install http://mirror.centos.org/centos-7/7.7.1908/cloud/x86_64/openstack-queens/oniguruma-6.7.0-1.el7.x86_64.rpm
yum -y install http://mirror.centos.org/centos-7/7.7.1908/cloud/x86_64/openstack-queens/oniguruma-devel-6.7.0-1.el7.x86_64.rpm
备用下载:

oniguruma:http://down.24kplus.com/linux/oniguruma/oniguruma-6.7.0-1.el7.x86_64.rpm
oniguruma-devel:http://down.24kplus.com/linux/oniguruma/oniguruma-devel-6.7.0-1.el7.x86_64.rpm
————————————————
版权声明:本文为CSDN博主「薄凉小伙」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Kangshuo2471781030/article/details/107241779



python excelsearchKeyList.py k.txt
sys.argv[0] = excelsearchKeyList.py
sys.argv[1] = k.txt

二)判断字符为空:


python excelsearchKeyList.py  k.txt
原创视频
line is null
line is null



三)判断是否传入新的参数:


来自:https://blog.csdn.net/index20001/article/details/74294945#:~:text=Python%E7%A8%8B%E5%BA%8F%E6%9C%89%E4%B8%A4%E7%A7%8D,%E8%A7%A3%E9%87%8A%E5%99%A8%E5%B0%86%E4%BC%9A%E9%80%80%E5%87%BA%E3%80%82
分页: 4/272 第一页 上页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 下页 最后页 [ 显示模式: 摘要 | 列表 ]