root

解决Nginx: [error] open() "/usr/local/Nginx/logs/Nginx.pid

久未见 提交于 2020-02-13 13:01:26
重新启动服务器,访问web服务发现无法浏览啦!登陆服务器之后进到nginx使用./nginx -s reload重新读取配置文件,发现报nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)错误,进到logs文件发现的确没有nginx.pid文件   [root@localhost sbin]# ./nginx -s reload   nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)   解决方法:   [root@localhost nginx]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf   使用nginx -c的参数指定nginx.conf文件的位置   [root@localhost nginx]# cd logs/   [root@localhost logs]# ll   总用量 12   -rw-r--r-- 1 root root 1246 12月 9 18:10 access.log   -rw-r--r-- 1

STP生成树原理

我的未来我决定 提交于 2020-02-13 11:52:19
为了防止单点故障启用链路冗余而产生的广播风暴、mad地址飘逸、帧的重复传输而设计的协议有以下几种类型 STP–生成树802.1D RSTP–快速生成树802.1W MSTP–多实例生成树 PVST+和R-PVST思科设备使用滴 目前市面上多使用的是MSTP生成树,锐捷设备需手动开启 ROOT根桥一个广播域内选举一个,由root下发配置信息的bpdu,交换机通过BPDU先来选举谁说root通过bridge-id的对比来选举,bridge-id里面包含设备本身的mac地址和优先级,默认优先级32768可手动配置到要是4096的倍数,越小越优相关的端口角色如下 RP根端口:根据交换机接口到root的距离开销来选举一样的话就根据上游的bridge-id选择还是一样就根据上面的端口来选越小越优先,端口默认优先级是100 DP指定端口:root下的路由器接口都是指定端口,选举的条件同上 AP备份端口:也叫NDP非指定端口,堵塞状态 STP的拓扑变更: 四种bpdu 普通BPDU–由root下发进行协议的运行和信息的配置 TCNBPDU–通过发送了拓扑变更的信息跟root,需对方回应TCA才停止发送 TCABPDU–回应产生TCNBPDU的设备我知道了 TCBPDU–通告整个网络mac地址表的老化时间为15s,重新收敛 端口的转态: disable相对于down

LeetCode(111)二叉树的最小深度

笑着哭i 提交于 2020-02-13 11:30:58
(111)二叉树的最小深度 Description: 给定一个二叉树,找出其最小深度。 最小深度是从根节点到最近叶子节点的最短路径上的节点数量。 说明: 叶子节点是指没有子节点的节点。 示例: 给定二叉树 [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 返回它的最小深度 2. 思路: 其实很简单,大致思路就是喝求最大深度相反。不过需要注意的是, 说明中 叶子节点是指没有子节点的节点。 需要注意,在写代码的时候要剔除此种情景。不然会在 [1, 2] 出栽跟头。 代码: int minDepth ( struct TreeNode * root ) { if ( root == NULL ) return 0 ; if ( root -> left == NULL && root -> right != NULL ) { return 1 + minDepth ( root -> right ) ; } if ( root -> left != NULL && root -> right == NULL ) { return 1 + minDepth ( root -> left ) ; } int left = minDepth ( root -> left ) ; int right = minDepth ( root -> right )

Navicat遇到1130错误该如何处理

时间秒杀一切 提交于 2020-02-13 10:05:02
用 Navicat 连接远程MySQL数据库时,有时会出现“Navicat for mysql 1130错误”,提示错误内容为不允许连接MySQL服务。很多人都以为是防火墙在作怪,其实关掉防火墙依然不能解决这个问题,本教程将为大家介绍Navicat for MySQL 1130错误的解决方法。 Navicat for MySQL 1130错误 问题描述: 1130 - Host 'localhost' is not allowed to connect to this MySQL server 原因分析: MySQL只有一个root用户,修改root密码后选了MD5,提交后重新 登陆就会出现Host 'localhost' is not allowed to connect to this MySQL server"错误提示。 解决方法: 编辑 my.ini 在[mysqld]的段中加上一句:skip-grant-tables 例如:Java代码 [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-name-resolve skip-grant-tables 这样就可以跳过MySQL的访问控制,任何人都可以在控制台以管理员的身份进入MySQL数据库。 需要注意的是,在修改完密码以后

Python Tkinter 简单使用

我与影子孤独终老i 提交于 2020-02-13 09:06:52
简单的一些实例,能够实现一般的功能就够用了 Tkinter: 创建顶层窗口: # -*- coding: utf-8 -*- from Tkinter import * root = Tk() root.title("顶层窗口") root.mainloop() Label使用: # -*- coding: utf-8 -*- from Tkinter import * root = Tk() root.title("顶层窗口") label = Label(root, text="Hello World!") label.pack() root.mainloop() 加入一些参数: # -*- coding: utf-8 -*- from Tkinter import * root = Tk() root.title("顶层窗口") label = Label(root, text="Hello World!", height=10, width=30, fg="black", bg="pink") label.pack() root.mainloop() Frame: # -*- coding: utf-8 -*- from Tkinter import * root = Tk() root.title("顶层窗口") for relief in [RAISED, SUNKEN

vue中的属性绑定和双向数据绑定

萝らか妹 提交于 2020-02-13 08:42:02
< html lang = "en" > < head > < meta charset = "UTF-8" > < title > 属性绑定和双向数据绑定 </ title > < script src = "./vue.js" > < / script > </ head > < body > < div id = "root" > < div title = "this is hello world" > hello world </ div >//title作用是当鼠标放在hello world 上面的时候,显示this is hello world </ div > < script > new Vue ({ el: "#root" , }) < / script > </ body > </ html > 提示语可变的情况: < html lang = "en" > < head > < meta charset = "UTF-8" > < title > 属性绑定和双向数据绑定 </ title > < script src = "./vue.js" > < / script > </ head > < body > < div id = "root" > < div v-bind:title = "title" > hello world </ div >/

linux中文件与目录的特殊权限

依然范特西╮ 提交于 2020-02-13 05:47:04
time:18.03.26 以以下2个典型的文件及目录来分析: ll /usr/bin/passwd -rwsr-xr-x. 1 root root 27832 Jan 29 2014 /usr/bin/passwd ll -d /tmp drwxrwxrwt. 23 root root 4096 Mar 25 23:53 /tmp SUID 当 s 出现在文件拥有者的 x 权限上时,如我们上面看到的 /usr/bin/passwd 这个文件的权限时 -rwsr-xr-x ,此时就被称为 SET UID 简称 SUID . SUID权限仅对二进制可执行文件有效 执行者对于该文件具有x的权限 本权限仅在执行该文件的过程中有效 执行者将具有该文件拥有者的权限 举例: 普通用户使用 passwd 命令修改自己的密码, 实际上最终更改的是 /etc/passwd 文件.该文件权限如下: ll /etc/passwd -rw-r--r--. 1 root root 2394 Mar 25 23:17 /etc/passwd 可以看到只有 root 用户才有写权限, 因为 /usr/bin/passwd 设置了 suid 权限位,普通用户执行此命令时临时拥有 root 权限以间接地修改 /etc/passwd 从而修改自己的密码. 设置方法 chmod u+s <文件或目录> SGID 当 s

二叉树的深度

我与影子孤独终老i 提交于 2020-02-13 02:12:38
/** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ int maxdeep ; void Maxdeep ( struct TreeNode * root , int deep ) { if ( deep > maxdeep ) { maxdeep = deep ; } if ( root - > left != NULL ) Maxdeep ( root - > left , deep + 1 ) ; if ( root - > right != NULL ) Maxdeep ( root - > right , deep + 1 ) ; } int maxDepth ( struct TreeNode * root ) { if ( root == NULL ) return 0 ; maxdeep = - 1 ; Maxdeep ( root , 1 ) ; return maxdeep ; } 来源: CSDN 作者: single aloner 链接: https://blog.csdn.net/qq_45863239/article/details

phpMyAdmin 初始用户名 密码

不想你离开。 提交于 2020-02-13 01:58:00
1. phpMyAdmin 文件下 将config.sample.inc.php 复制一份 改名为config.inc.php 默认情况下 用户名是 root 密码是 空 直接就能登录了 我改了几行代码, 测试是用 root 123456 能登陆 root 空密码也可以登录 //$cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = true; $cfg['Servers'][$i]['host'] = '127.0.0.1'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = '123456'; 来源: CSDN 作者: ARVRinChina 链接: https://blog.csdn.net/chuan403082010/article/details/91347424

Telnet服务配置

℡╲_俬逩灬. 提交于 2020-02-13 01:28:34
telnet:远程连接,使用未加密的用户/密码组进行验证,由xinetd服务管理。配置文件为/etc/xinetd.d/telnet  Telnet服务的配置步骤如下:   一、安装telnet软件包    #rpm -vih telnet-…...    #rpm -vih telnet-server-…... 二、开启telnet服务    1、编辑telnet配置文件    #vim /etc/xinetd.d/telnet    disable=no 启用服务    2、重启超级守护进程xinetd服务 service xinetd restart 三、测试服务     [root@wljs root]#telnet ip(或者hostname)    如果配置正确,系统提示输入远程机器的用户名和密码    Login:    Password:    注:默认只允许普通用户登录,即基于安全考虑root用户不能登录 四、设置修改telnet端口    #vim /etc/services   telnet 23/tcp   telnet 23/udp   将23修改成未使用的端口号(如:2000),重启服务,telnet默认端口号就被修改了。 五、Telnet服务限制      如果默认设置并不满意,可以修改成比较安全一点的机制。    假设这个 Linux