自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

shunzi2016的博客

古人学问无遗力,少壮工夫老始成!

  • 博客(241)
  • 资源 (5)
  • 论坛 (5)
  • 收藏
  • 关注

原创 docker:centos7.8 离线安装docker20

docker 离线镜像下载网址: https://docs.docker.com/engine/install/centos/docker官网:centos 安装:https://docs.docker.com/engine/install/centos/[root@vcontroller docker_rpm]# lltotal 104288-rw-r--r--. 1 root root 34677436 Dec 21 20:23 containerd.io-1.4.3-3.1.el..

2020-12-21 23:22:42 80

原创 Python3:/bin/sh: mysql_config: command not found

ERROR: Command errored out with exit status 1: command: /usr/local/py_venv_fhwy/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ugvzplst/mysqlclient_c350b17bb3934779a5921200e5062c8b/setup.py'"'"'; __file__='"'"...

2020-12-14 16:07:25 14

原创 Python3: 关于Python对于空列表(list)的判断测试

测试代码a = []if a: print('a')else: print('b')if type(a) is list: print('a+')else: print('b+')运行结果ba+结论当列表返回值为空时,千万不能用判断对象以及属性是否为空的方式进行判断!必须通过类型以及长度进行判断!...

2020-11-08 20:21:28 23

原创 Linux: Centos 搭建rpm私有仓库

纯净版,未联网情况下进行如下安装:mkdir -p /application/yum/centos7.x/x86_64 && cd /application/yum/centos7.x/x86_64上传所有的rpm文件(在我的下载文件中能找到)到这个目录下面安装 createreporpm --import /etc/pki/rpm-gpg/RPM*rpm -ivh --force 为前缀执行以下命令,并依次安装如下的依赖:(以下的包已经存在于/application/y

2020-10-18 16:52:21 47

原创 Python3:离线安装python3,构建virtualenv虚拟环境,以及搭建简易的pypi私有仓库

目录离线安装python3虚拟环境搭建创建pip的仓库批量执行pip依赖安装离线安装python3首先搭建python3.6.7的编程环境tar -zxvf Python-3.6.7.tgzcp -r Python-3.6.7 /usr/local/python367 && cd /usr/local/python367/ && ./configure && make && make install..

2020-10-18 12:34:21 163 2

原创 Python3: bytes 和 utf-8

a = b'aa'print(type(a))print(str(a))print(a.decode('utf-8'))<class 'bytes'>b'aa'aa

2020-10-09 09:49:07 57

原创 NodeJs:匿名回调,同步阻塞式,逻辑顺序控制示例

function a(a, callback) { console.log(a); a = a + 'a'; callback(a)}function b(b, callback) { console.log(b) new Promise(function(resolve, reject) { setTimeout(function() { b = b + 'b' resolve(b); .

2020-09-17 07:30:46 16

原创 Python3:最简短明了的requests, get json 请求

remote = 'http://xx.xxx.xxx.xxx:xx/xxx/xxxx'headers = { 'Content-Type': 'application/json',}document = { xx:xx}response = requests.get(remote, data=json.dumps(document), headers=headers, timeout=60)if response.

2020-09-14 07:42:39 71 1

原创 NodeJS:mongo db 入门级使用CURD封装

Mongo版本:4.2.*nodejs版本:12.x以上var MongoClient = require('mongodb').MongoClient;var log4js = require('log4js');log4js.configure('./config/log4js.json');var logger = log4js.getLogger();var log = require('./log.js');var moment = require('moment');var

2020-09-13 21:46:39 17

原创 NodeJS:redis 入门级使用示例 hgetall

var redis = require('redis');RDS_PORT = 6379 //端口号RDS_HOST = '172.18.xx.xx'; //服务器IP// RDS_PWD = config_db.redis.pass; //密码// RDS_OPTS = { auth_pass: RDS_PWD };// client = redis.createClient(RDS_PORT, RDS_HOST, RDS_OPTS);client = redis.createClie...

2020-09-13 21:40:02 91

原创 git: gitignore编写案例,包括python,nodejs的包以及编译文件过滤

.idea*.pyc*.py[cod]*/*.pyc**/*.pyc!.gitignore!.gitkeep*/node_modules**/node_modulesxx/xx/node_modules/node_modules/**/npm-debug.lognpm-debug.log.DS_Store**/.DS_Store*/.DS_Store.vscode*.log*/xxxxxx_python_pro/*.log**/xxxxxx_python_pro/*.l.

2020-09-08 08:30:01 52

原创 NodeJS:按照不同的操作系统读写文件

var fs = require('fs');var os = require('os');var xxx_file = '';var platform = os.platform();if (platform.indexOf('win') > -1) { xxx_file= 'E:/tmp/xxx_file.txt';} else if (platform.indexOf('linux') > -1) { xxx_file= '/tmp/xxx_file.txt'.

2020-09-08 07:50:49 21

原创 Python3:按照不同的系统进行文件的追加编写

import platformif 'Windows' in platform.system(): xxx_file = 'E:/tmp/xxx_file.txt'elif 'Linux' in platform.system(): xxx_file = '/tmp/xxx_file.txt'with open(xxx_file , 'w', encoding='utf-8') as foo: foo.write('true')

2020-09-08 07:43:45 22

原创 NodeJS: TypeError: os.tmpDir is not a function

TypeError: os.tmpDir is not a function at new Form (/home/vcontroller/cloudenforce/opcsec/contrail-web-core/node_modules/multiparty/index.js:55:44) at exports.SystemUpload (xx.js:103:16) at callbacks (xx.js/node_modules/express/lib/router/index.j.

2020-09-07 23:57:05 294

原创 Linux:子账户自动切换到root账户

忘记了是看的哪个大神的博客学到的了#!/usr/bin/expect# 需要等待控制台捕获输出set timeout 1# spawn开启进程,也可以是ssh $user@$host {your_command}# 只有先进入expect环境后才可执行spawnspawn su root# 判断上述进程(su root)的输出结果中是否有“password”的字符串(不区分大小写)。# 若有则立即返回,否则就等待一段时间后返回,等待时长就是开头设置的1秒expect "*pass.

2020-09-05 11:29:55 61

原创 Linux:自动pull git代码到指定目录,自动pull和覆盖指定分支代码

#!/usr/bin/expectspawn git clone -b xxx-branch http://x.x.x.x:xx/xx/xx/xxxxx.git /home/shunzi/xxxxx#spawn git clone -b xxx-branch http://x.x.x.x:xx/xx/xx/xxxxx.gitexpect "Username"send "shunzi\n"expect "Password"send "shunzishishuaige\n"expect eof.

2020-09-05 11:25:00 234

原创 Linux:一键yum centos常用工具指令

sudo yum -y install gcc python36-devel bzip2-devel sqlite-devel readline-devel xz-devel xz-devel tk-devel gdbm-devel vim net-tools telnetsudo yum install -y git gcc gcc-c++ glibc make autoconf openssl openssl-devel pcre-devel pam-devel expect --skip-br.

2020-09-05 11:15:29 63

原创 Linux:看门狗watchdog.sh程序编写示例

### # @Author: hanxiaoshun # @Date: 2020-07-08 15:53:34 # @LastEditTime: 2020-09-05 10:54:45 # @LastEditors: Please set LastEditors # @Description: In User Settings Edit # @FilePath: \shunzi\config\owatchdog.sh### #!/bin/sh#kill -9 $(ps -ef|grep .

2020-09-05 11:12:00 120

原创 Linux:添加开机自启动的系统服务

test_service为一个系统级服务的运行脚本,还有一种方式是写入rc.local里面sudo cp -rf /home/shunzi/config/test_service /etc/init.d/sudo chmod a+x /etc/init.d/test_servicecd /etc/init.d/sudo chkconfig --add test_servicesudo chkconfig test_service onsudo chkconfig --level 2345..

2020-09-05 11:00:46 36

原创 MongoDB:一键单机部署centos7.*

MongoDB:版本为4.2.*# mongodb 部署# 需要提前手动设置mongo_place目录以及上传对应的安装包# 指的是当前的非root子账户,所以不是必须shunzi账户sudo mkdir -p /home/shunzi/mongo_placesudo cp -rf mongodb-linux-x86_64-rhel70-v4.2-latest.tgz /home/shunzi/mongo_place/sudo rm -rf /home/shunzi/mongo_place.

2020-09-05 10:37:08 50

原创 Redis: 一键单机部署centos7.*

版本为redis-5.0.9# 安装redissudo rm -rf /home/shunzi/redis_place/*sudo mkdir -p /home/shunzi/redis_placesudo mv redis-5.0.9.tar.gz /home/shunzi/redis_placesudo tar -zxvf /home/shunzi/redis_place/redis-5.0.9.tar.gzsudo mv /home/shunzi/redis_place/redis-.

2020-09-05 10:34:00 41

原创 nodejs:0 和 空字符的比较

console.log(0 == '');//打印为trueconsole.log(0 === '');//打印为false

2020-08-25 14:12:59 45

原创 http: 400 bad request

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><title>400 Bad Request</title><h1>Bad Request</h1><p>Failed to decode JSON object: Expecting property name enclosed in double quotes: line 1 column 318 (char 317.

2020-08-09 08:17:35 115

原创 Git:没啥事研究研究自己做一个版本控制软件

> git for-each-ref --sort -committerdate --format %(refname) %(objectname)> git remote --verbose> git config --get commit.template> git ls-files --stage -- E:\work_space\enforce\mc01\cloudenforce\opcsec\contrail-web-core\src\serverroot\opcs.

2020-08-04 07:22:13 85

原创 Git:一些历史记录没事可以一条一条看看学习用

Looking for git in: E:/Git/bin/git.exeUsing git 2.23.0.windows.1 from E:/Git/bin/git.exe> git rev-parse --show-toplevel> git rev-parse --git-dirOpen repository: e:\work_space\enforce\mc01\cloudenforce> git status -z -u> git symbolic-ref .

2020-08-04 07:21:01 72

原创 Python3:gevent:greenlet.error: cannot switch to a different thread

2020-08-01 22:06:12:034678: ----------------------------------------2020-08-01 22:06:50:875038: Exception happened during processing of request from ('127.0.0.1', 55207)2020-08-01 22:06:50:875038: Traceback (most recent call last):2020-08-01 22:06:50:8.

2020-08-01 22:12:12 289

原创 MongoDB:nodejs the options [safe] is not supported

the options [safe] is not supported修改为 :MongoClient.connect(db_url, { useNewUrlParser: true }, function(err, db) { assert.equal(null, err); assert.ok(db != null); //acl_id db.collection("numbs").findAndModify({ _id: se.

2020-08-01 10:19:07 129

原创 MongoDB: UnhandledPromiseRejectionWarning: MongoError: Cannot use a session that has ended

(node:11104) UnhandledPromiseRejectionWarning: MongoError: Cannot use a session that has ended at applySession (E:\work_space\enforce\mc\cloudenforce\opcsec\contrail-web-core\node_modules\mongodb\lib\core\sessions.js:707:12) at _command (E:\work_s.

2020-08-01 09:17:16 538 2

原创 MongoDB:nodejs报错MongoError: command listCollections requires authentication...n个错误

mongo2.6代码dbo.collection(tb_arr[i], { safe: true }, function(err, collection) { if (['log', 'operation_log'].indexOf(tb_arr[i]) == -1) { collection.ensureIndex({ "timestamp.create": 1 }); collecti.

2020-08-01 08:56:17 421

原创 Centos7:您可以尝试添加 --skip-broken 选项来解决该问题

[vcontroller@vcontroller bin]$ sudo yum install -y glibc已加载插件:fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: mirrors.huaweicloud.com * elrepo: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.aliyun.com * updates: mirrors..

2020-07-28 23:30:35 1399

原创 Nodejs:CentOS 7.5安装Nodejs14

稍微有些慢,但是最终成功了[vcontroller@vcontroller mongo_place]$ sudo curl --silent --location https://rpm.nodesource.com/setup_14.x | sudo bash -[sudo] vcontroller 的密码:## Installing the NodeSource Node.js 14.x repo...## Inspecting system...+ rpm -q --whatpr

2020-07-28 16:59:53 379

原创 vcenter:Host xxxxx is not a member of VDS CloudSec_dvs_00

{"type":"com.vmware.vapi.std.errors.invalid_argument","value":{"messages":[{"args":[],"default_message":"A specified parameter was not correct: spec.deviceChange.device.port.switchUuid","id":"vmsg.InvalidArgument.summary"},{"args":[],"default_message":"Ho.

2020-07-26 23:59:46 68

原创 JavaScript:硬编码生成随机数,随机字符串

var next_chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; /****删除一些混淆字符oOLl,9gq,Vv,Uu,I1****/var next_length = next_chars.length;var next_random = '';for (i = 0; i < 6; i++) { next_random += next_chars.charAt(Math.floor(Math.random.

2020-07-26 16:09:45 41

原创 JQuery:取值的特殊常用用法

1.获取选中的radiovar xxxx = $("input[name='xxxxxx']:checked").val();2.获取select选中的文本var xxxx = $("#xxxxxxxx").find("option:selected").text();

2020-07-25 21:14:35 35

原创 JQuery:select change bind 监听

$('#xxx_id').unbind('click').bind('click', function() { console.log($(this)); });获取监听的文本属性$('#xxx_id').unbind('change').bind('change', function() { if(this.options.length > 0){ host_option_name = ''; console.log(this.options); cons..

2020-07-25 15:38:43 144

原创 RestApi:TypeErroThe view function did not return a valid response. The function either returned None

TypeErroThe view function did not return a valid response. The function either returned None or ended without a return statement.出现这种情况,根据经验有两种问题:1.没有加return方法2.api重名,或者指定的方法可能重RestApi:TypeErroThe名,修改删除就好...

2020-07-24 11:46:41 124

原创 vcenter:数据存储“datastore146”与数据中心中具有相同 URL (ds:///vmfs/volumes/5eddffa

出现这样的问题的时候需要仔细的回想,vcenter内部的哪些元素是对之前的一些存储有关联的,前往删除这些引用即可

2020-07-23 14:04:16 637

原创 vcenter:找不到引用的对象或项目。

将 OVF 软件包从内容库部署到资源池状态:找不到引用的对象或项目。启动者:xxxx.xxxxxx\Administrator目标:xxxxx线服务器:xxxxxx.xxxxxxx.com相关事件: 2020/07/23 上午9:54:29 任务: 将 OVF 软件包从内容库部署到资源池 待续》》...

2020-07-23 10:06:01 311

原创 vim:一般性操作

1. 全局替换带有特殊字符的字符串#例如想替换"/str"成“.”:%s/\/str/\./g待续...

2020-07-16 15:46:58 30

原创 centos7:yum -y install gcc python36-devel bzip2-devel sqlite-devel openssl-devel readline-devel xz-d
原力计划

安装执行的过程分析记录,有时间仔细分析一下过程,配合查看yum的脚本:目录安装过程yum脚本安装过程server]# yum -y install gcc python36-devel bzip2-devel sqlite-devel openssl-devel readline-devel xz-devel xz-devel tk-devel gdbm-devel已加载插件:fastestmirror, langpacksLoading mirror speeds from ca

2020-07-15 10:16:46 366

docker_rpm_next.zip

关于我一篇博客中所需要的centos 7.8 docker离线安装的资料包

2020-12-21

python3常用的pip3安装包

我的一个博客需要的一个资料包:Python3:离线安装python3,构建virtualenv虚拟环境,以及搭建简易的pypi私有仓库

2020-10-18

常用的linux centos7.x rpm

我的一个博客需要的资源;https://mp.csdn.net/console/editor/html/109146626

2020-10-18

fabric-samples

与我另外一个资源aliyunfabric.tar文件配合使用,在我的阿里云上进行测试部署e2e_cli成功运行,另外还需要一个fabric-samples等一下上传适合他对应的版本。将其tar zxvf /opt/gopath/src/github.com/hyperledger(src之前的目录可以根据$GOPATH设置)就好,如无积分请留言邮箱

2018-03-31

hyperledger/fabric的一个版本v1.1

fabric的一个稳定版本,在我的阿里云上进行测试部署e2e_cli成功运行,另外还需要一个fabric-samples等一下上传适合他对应的版本。将其tar zxvf /opt/gopath/src/github.com/hyperledger(src之前的目录可以根据$GOPATH设置)就好

2018-03-31

Current thread 0x00047f70 (most recent call first):

发表于 2018-11-15 最后回复 2018-11-15

ssl.CertificateError: hostname 'list.mall.taobao.com' doesn't match either of '*

发表于 2018-10-18 最后回复 2018-10-18

unknown status keyword 'x' in marked section warnings.warn(msg)

发表于 2018-10-01 最后回复 2018-10-18

linux安装golang

发表于 2017-03-19 最后回复 2017-03-19

分层代码自动生成

发表于 2017-01-22 最后回复 2017-03-19

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人 TA的粉丝

提示
确定要删除当前文章?
取消 删除