config

configparser模块

巧了我就是萌 提交于 2020-03-05 12:58:46
1 import configparser 2 3 config = configparser.ConfigParser() 4 config['DEFAULT'] = { 5 'ServerAliveInterval': 45, 6 'Compression': 'yes', 7 'CompressionLevel': 9, 8 'ForwardX11': 'yes' 9 } 10 config['bit'] = { 11 'bitbucket': 'hg', 12 "User": 'nihoa' 13 } 14 config['SERVER'] = { 15 'PORT': 8080, 16 'PASSWD': 2663 17 } 18 with open('aa.config', 'w') as f: 19 config.write(f) 20 # 增删改查 21 # ---------------------查 22 config = configparser.ConfigParser() # 创建对象 23 config.read('aa.config') # 将文件传进对象 24 print(config.sections()) # 打印文件的各个部分 25 print('ok' if 'bit' in config.sections() else 'no') #

.NetCore 中Log4net简单使用

﹥>﹥吖頭↗ 提交于 2020-03-05 10:41:30
.NetCore 中Log4net简单使用 文章目录 .NetCore 中Log4net简单使用 1. 添加log4net配置文件 2. 读取 log4net.config 文件配置 3. 注册log4Net服务 4. 记录日志 5. 更多 1. 添加log4net配置文件 如图所示,在项目中添加log4net.config配置文件: log4net.config配置文件内容如下,文件属性设置为 始终复制 : < ? xml version = "1.0" encoding = "utf-8" ? > < configuration > < configSections > < section name = "log4net" type = "System.Configuration.IgnoreSectionHandler" / > < / configSections > < appSettings > < / appSettings > < log4net > < root > < level value = "ALL" / > < appender - ref ref = "console" / > < appender - ref ref = "file" / > < / root > < ! -- File Appender -- > < appender name =

Taro引入vant Weapp的方法

♀尐吖头ヾ 提交于 2020-03-04 23:20:21
Taro(V2.0.5)中引入Vant Weapp,(需下载资源到项目中:大小约322KB) 需如下几步: 1.在 /src/components下新建文件夹vant-weapp 2.在github上找到 Vant-weapp 下载文件包,将对应的 dist文件夹下内容 复制到新建的 vant-weapp文件夹 下。 (下载vant-weapp方式,编辑器终端输入:git clone https://github.com/youzan/vant-weapp.git ) 3.在 Pages或components 对应文件的 config.usingComponents 中,配置每个页面所需要的组件。( 注:无法在 app.js 中进行全局注册组件。 ) 例: config = { usingComponents: { "van-icon": "../../components/vant-weapp/icon/index" } } 4.在使用 Vant-weapp 组件后, taro 会 自动 将相应的组件复制一份到 dist/components 下,而 Vant-weapp 的组件还依赖工具库 /src/components/vant-weapp/wxs ,该工具库 taro 不会自动 复制到 dist 中。所以,我们需要在 /config/index.js 文件下的

vue配置文件分离

别来无恙 提交于 2020-03-04 22:07:30
vue配置文件分离 1.安装插件webpack-merge npm install --save-dev webpack-merge 2.创建要分离出的配置信息文件比如:共有的base.config.js 注意:path路径 const path = require ( 'path' ) ; module . exports = { entry : './src/main.js' , output : { path : path . resolve ( __dirname , '../dist' ) , filename : 'bundle.js' , publicPath : 'dist/' } , module : { rules : [ { test : /\.css$/ , use : [ 'style-loader' , 'css-loader' ] } , { test : /\.vue$/ , user : [ 'vue-loader' ] } , { test : /\.(png|jpg|gif)$/ , use : [ { loader : 'url-loader' , options : { limit : 500 } } ] } , { test : /\.js$/ , exclude : /(node_modules|bower_components)/ ,

关于渗透测试的学习环境——DVWA

不羁的心 提交于 2020-03-04 19:28:36
DVWA的安装过程: 安装过程总共分两步,phpstudy的下载以及dvwa的下载。 下面正式进入安装教程: 链接:https://www.jb51.net/article/160378.htm 1.1首先需要准备的是DVWA的环境,DVWA需要运行在有数据库/服务器等多种环境下,我们一般选用集成了这些环境的phpStudy, 这个工具可以在官网下载,官网网址为: http://phpstudy.php.cn/ 官网界面如下所示: 1.2点击标题栏的“软件下载”,进入phpStudy的版本选择下载界面: 1.3个人推荐下载这个大小为33M的解压版,里面的配套插件比较全一点。下载完成之后解压,这里随便解压到哪里。 解压完成后点击phpstudy20161103.exe(版本不同,名字不同)运行安装程序。 注意:安装路径不能包含中文,我个人直接安装在D盘的根目录下,安装路径为:D:\phpStudy 1.4然后就可以点击phpStudy.exe运行程序了。成功运行结果如下(注意,它是有个开启服务的过程的,运行状态的那两个指示灯是从红色变到绿色的): 如果无法成功运行,请参考附带的使用手册 “manual.chm” 查找解决方案。 这个软件就让它保持开启的状态挂着,接下来将dvwa的下载安装配置。 2.1进入dvwa官网,网址为:http://www.dvwa.co.uk/

anaconda 无法安装新环境

浪子不回头ぞ 提交于 2020-03-04 18:14:24
查了好多都说要设置清华的镜像,但是我一直都有设呀,突然就不好使了,也尝试过把.condarc文件下,default那一行删除,但是也不行。最后!!!只需要把清华镜像里的https改成http就行啦?!诡异的操作 conda config - - add channels https : // mirrors . tuna . tsinghua . edu . cn / anaconda / cloud / msys2 / conda config - - add channels https : // mirrors . tuna . tsinghua . edu . cn / anaconda / cloud / conda - forge / conda config - - add channels https : // mirrors . tuna . tsinghua . edu . cn / anaconda / pkgs / free / conda config - - set show_channel_urls yes 来源: CSDN 作者: 小白胖爱学习- 链接: https://blog.csdn.net/m0_37723079/article/details/104657353

基于 Egg + Vue + Webpack 框架搭建

佐手、 提交于 2020-03-04 18:08:31
基于 Egg + Vue + Webpack 服务端渲染开发指南 1. 项目初始化 1.1 easywebpack-cli 脚手架初始化项目 安装脚手架 npm install easywebpack-cli -g 命令行,然后就可以使用 easywebpack 或 easy 命令 命令行运行 easywebpack init 选择 egg+vue server side render boilerplate 初始化骨架项目 安装依赖 npm install 1.2 GitHub 仓库代码初始化项目 Bash git clone https://github.com/hubcarl/egg-vue-webpack-boilerplate.git npm install 初始化的项目提供多页面和SPA(vue-router/axios)服务端渲染实例,可以直接运行。 1.3 vscode 插件初始化项目 https://marketplace.visualstudio.com/items?itemName=hubcarl.vscode-easy-plugin#overview 2. 项目运行 2.1 本地运行 Bash npm run dev // egg-bin dev npm run dev 做了如下三件事情 启动 egg 应用 启动 Webpack 构建, 文件不落地磁盘

跟我学习SpringCloud 教程第六篇: 分布式配置中心(Spring Cloud Config)-b2b2c小程序电子商务

↘锁芯ラ 提交于 2020-03-04 15:48:09
在分布式系统中,由于服务数量巨多,为了方便服务配置文件统一管理,实时更新,所以需要分布式配置中心组件。在Spring Cloud中,有分布式配置中心组件spring cloud config ,它支持配置服务放在配置服务的内存中(即本地),也支持放在远程Git仓库中。在spring cloud config 组件中,分两个角色,一是config server,二是config client。 一、建Config Server 创建一个spring-boot项目,取名为config-server,其pom.xml: < ?xml version = "1.0" encoding = "UTF-8" ? > < project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > < modelVersion > 4.0 .0 < / modelVersion > < groupId > com . forezp < / groupId >

ubuntu安装pytorch问题

不问归期 提交于 2020-03-04 05:14:07
添加conda的国内源: conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ conda config --set show_channel_urls yes 进入Anaconda的环境:source activate env_name 根据pytorch官网的安装命令:conda install pytorch torchvision cpuonly -c pytorch 安装发现pytorch的源头仍然是官网源。 解决办法:conda install pytorch torchvision cpuonly (其中, -c pytorch 参数指定了conda获取pytorch的 channel ,在此指定为conda自带的pytorch仓库。因此,只需要将 -c pytorch 语句去掉

git 清除缓存

≯℡__Kan透↙ 提交于 2020-03-04 02:51:25
清除git缓存 git config --local --unset credential.helper git config --global --unset credential.helper git config --system --unset credential.helper 保存git缓存 git config --global credential.helper store 来源: https://www.cnblogs.com/zhouyideboke/p/11211650.html