host

How to use the optional hostname parameter in Node.js server.listen()

倖福魔咒の 提交于 2019-12-04 07:11:44
From what I've read in tutorials so far, the optional hostname parameter to server.listen(port[, hostname][, backlog][, callback]) has always been either 127.0.0.1 (loopback), 0.0.0.0 ( listen on every available network interface, the default option ), or one of the actual IP addresses available to the server. Everything else will give an Error: listen EADDRNOTAVAIL . Is that the whole picture? (I believe hostname is technically different from IP...) I wasn't able to find out too much about it from the doc ... So, you need a resolvable DNS host name for this to work. For a quick example, I

堡垒机实例以及数据库操作

左心房为你撑大大i 提交于 2019-12-04 06:52:27
开发堡垒机之前,先来学习Python的paramiko模块,该模块机遇SSH用于连接远程服务器并执行相关操作 SSHClient 用于连接远程服务器并执行基本命令 基于用户名密码连接: 1 import paramiko 2 3 # 创建SSH对象 4 ssh = paramiko.SSHClient() 5 # 允许连接不在know_hosts文件中的主机 6 ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) 7 # 连接服务器 8 ssh.connect(hostname='c1.salt.com', port=22, username='wupeiqi', password='123') 9 10 # 执行命令 11 stdin, stdout, stderr = ssh.exec_command('df') 12 # 获取命令结果 13 result = stdout.read() 14 15 # 关闭连接 16 ssh.close() View Code 1 import paramiko 2 3 transport = paramiko.Transport(('hostname', 22)) 4 transport.connect(username='wupeiqi', password='123') 5

Flask基础简介

不羁岁月 提交于 2019-12-04 06:52:06
一:Flask简介 Flask是一个Python编写的Web 微框架,让我们可以使用Python语言快速实现一个网站或Web服务,在介绍Flask之前首先来聊下它和Django的联系以及区别,django个大而全的web框架,它内置许多模块,flask是一个小而精的轻量级框架,Django功能大而全,Flask只包含基本的配置, Django的一站式解决的思路,能让开发者不用在开发之前就在选择应用的基础设施上花费大量时间。Django有模板,表单,路由,基本的数据库管理等等内建功能。与之相反,Flask只是一个内核,默认依赖于2个外部库: Jinja2 模板引擎和 WSGI工具集--Werkzeug , flask的使用特点是基本所有的工具使用都依赖于导入的形式去扩展,flask只保留了web开发的核心功能。 WSGI(web服务器网关接口)是python中用来规定web服务器如何与python Web服务器如何与Python Web程序进行沟通的标准,本质上就是一个socket服务端。而 Werkzeug模块 就是WSGI一个具体的实现 关键词 :一个Python编写微web框架 一个核心两个库( Jinja2 模板引擎 和 WSGI工具集) 二:Flask的优点 flask性能上基本满足一般web开发的需求, 并且灵活性以及可扩展性上要优于其他web框架,

MySQL分析数据运行状态利器【show full processlist】

こ雲淡風輕ζ 提交于 2019-12-04 06:39:30
原文地址: https://www.cnblogs.com/shihuc/p/8733460.html 今天的主角是: SHOW [FULL] PROCESSLIST show full processlist; 官方文档的描述如下: SHOW PROCESSLIST shows you which threads are running. You can also get this information from the INFORMATION_SCHEMA PROCESSLIST table or the mysqladmin processlist command. If you have the PROCESS privilege, you can see all threads. Otherwise, you can see only your own threads (that is, threads associated with the MySQL account that you are using). If you do not use the FULL keyword, only the first 100 characters of each statement are shown in the Info field.

[20191108]内核参数tcp_keepalive与sqlnet.ora expire_time的一些总结.txt

匆匆过客 提交于 2019-12-04 05:35:52
[20191108]内核参数tcp_keepalive与sqlnet.ora expire_time的一些总结.txt --//前几天在做12c DCD SQLNET.EXPIRE_TIME相关测试时,在11g数据库遇到1个古怪的问题,就是设置sqlnet.expire_time无效.不知道为 --//什么?以前做过类似测试就是在两个都设置的情况下,sqlnet.ora expire_time优先. --//我当时的情况如下,设置内核参数如下: net.ipv4.tcp_keepalive_time = 7200 net.ipv4.tcp_keepalive_intvl = 75 net.ipv4.tcp_keepalive_probes = 9 --//参数解析: /proc/sys/net/ipv4/tcp_keepalive_time 当keepalive起用的时候,TCP发送keepalive消息的频度。默认是2小时。 /proc/sys/net/ipv4/tcp_keepalive_intvl 当探测没有确认时,keepalive探测包的发送间隔。缺省是75秒。 /proc/sys/net/ipv4/tcp_keepalive_probes 如果对方不予应答,keepalive探测包的发送次数。缺省值是9。 --//sqlnet.ora,没有设置#SQLNET

PHP中的Memcache详解

a 夏天 提交于 2019-12-04 05:02:47
一、Memcache简介 Memcache是danga.com的一个项目,最早是为 LiveJournal 服务的,目前全世界不少人使用这个缓存项目来构建自己大负载的网站,来分担数据库的压力。它可以应对任意多个连接,使用非阻塞的网络IO。由于它的工作机制是在内存中开辟一块空间,然后建立一个HashTable,Memcached管理这些HashTable,所以速度非常快。 二、Memcache和memcached的区别 为什么会有Memcache和memcached两种名称?其实Memcache是这个项目的名称,而memcached是它服务器端的主程序文件名,知道我的意思了把~~~~。一个是项目名称,一个是主程序文件名,在网上看到了很多人不明白,于是混用了。 三、Memcache的服务器端和客户端安装 分为两个过程:memcache服务器端的安装和memcached客户端的安装。 所谓服务器端的安装就是在服务器(一般都是linux系统)上安装Memcache实现数据的存储。 所谓客户端的安装就是指php(或者其他程序,Memcache还有其他不错的api接口提供)去使用服务器端的Memcache提供的函数,需要php添加扩展。 四、PHP的Memcache客户端所有方法总结 memcache函数所有的方法列表如下: Memcache::add – 添加一个值,如果已经存在

Ansible之系列命令详解

这一生的挚爱 提交于 2019-12-04 05:02:43
  ansible系列命令有:ansible、ansible-doc、ansible-playbook、ansible-vault、ansible-console、ansible-galaxy、ansible-pull,这些命令每个命令都有它独特的作用和用法,接下来我们一一来了解它的用法。 1、ansible-doc:这个命令主要作用是显示模块的帮助信息,有点类似Linux里的man命令。 命令用法: ansible-doc [options] [module...] 常用选项:   -a:显示所有模块的文档 [root@localhost ~]# ansible-doc -a ping > A10_SERVER (/usr/lib/python2.7/site-packages/ansible/modules/network/a10/a10_server.py) Manage SLB (Server Load Balancer) server objects on A10 Networks devices via aXAPIv2. OPTIONS (= is mandatory): = host Hostname or IP of the A10 Networks device. [Default: None] - partition set active-partition

Android: Is there any way to turn on-off the physical keyboard programmatically?

你。 提交于 2019-12-04 04:55:19
问题 I have an android 3.1 with usb host capabilities. I connected to it via usb an RFID reader that works as a keyboard emulator. For keyboard emulator I mean that once I scan a tag it sends the output as keystrokes. Now once this reader is plugged in there is no way to have the soft keyboard visible. So it's impossible to type anything else than the rfid codes. I have tried without success the examples to "force show soft keyboard": they work until I plug in the RFID reader. Then the soft

MySQL授权认证

依然范特西╮ 提交于 2019-12-04 04:53:14
一、MySQL权限介绍 1、MySQL权限系统介绍。 • 权限系统的作用是授予来自某个主机的某个用户可以查询、插入、修改、删除等数据库操作的权限。 • 不能明确的指定拒绝某个用户的连接。 • 权限控制(授权与收回)的执行语句包括create user,grant,revoke 。 • 授权后的权限都会存放在MySQL的内部数据库中(数据库名叫MySQL),并在数据库启动之后把权限信息复制到内存中。 • MySQL用户的认证信息不光包括用户名,还要包含连接发起的主机(以下两个Joe被认为不是同一个用户) • show grants for 'joe '@'office, example.com'; • show grants for 'joe '@' home.example.com'; 2、MySQL权限级别介绍 • MySQL权限级别 • 全局性的管理权限,作用于整个MySQL实例级别。 • 数据库级别的权限,作用于某个指定的数据库上或者所有的数据库上。 • 数据库对象级别的权限,作用于指定的数据库对象上(表、视图等)或者所有的数据库对象上。 • 权限存储在MySQL库的user,db,tables_priv,columns_priv,and procse_priv这几个系统表中,待MySQL实例启动后就加载到内存中。 • 查看MySQL实例默认root用户的权限

What does Dns.GetHostEntry Method(String) actually do?

浪子不回头ぞ 提交于 2019-12-04 04:49:13
I can't find any proper description in the documentation for what this actually does. Does it check for the existence of A records or CNAME records or both? My understanding is that in .NET 4, this throws a SocketException if the host does not exist, and this is confirmed by my testing. This is the list of addresses returned by var ips = System.Net.Dns.GetHostEntry("microsoft.com").AddressList; foreach (var ip in ips) Console.WriteLine(ip); // output 64.4.11.37 65.55.58.201 And these are the A records pulled from network-tools.com, DNS query. Answer records microsoft.com A 64.4.11.37 microsoft