localhost

Eventmachine start_tcp_server no acceptor - port is in use or requires root privileges (RuntimeError)

我与影子孤独终老i 提交于 2019-12-05 11:39:46
I haven't been able to run my local server for 3 days now. Restarting my computer doesn't help. A couple of time, after trying repeatedly about 40-50 times, it randomly worked - I can't figure out why. I tried a different port once and that worked, but since then, no port works. Every time I try to run my rails server I get this. /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/eventmachine-1.0.5/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError) from /Users/colmtuite/.rvm/gems/ruby-2.2.0/gems/eventmachine-1.0.5/lib/eventmachine.rb

mysql学习笔记----增加新用户权限

不问归期 提交于 2019-12-05 11:33:12
1.向MySql增加新用户权限: 第一种:使用GRANT语句 比较好的方法,更简明并且错误少 mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION; 超级用户,本机连接,完全权限 mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION; 超级用户,其他主机,完全权限 mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost'; 账户用户名admin,没有密码,只能本机连接,授予RELOA和PROCESS管理权限。 这些权限允许admin用户执行mysqladmin reload、mysqladmin refresh和 mysqladmin flush-xxx命令,以及mysqladmin processlist。 未授予访问数据库的权限。你可以通过GRANT语句添加此类权限。 mysql> GRANT USAGE ON *.* TO 'dummy'@'localhost'; 一个账户有用户名dummy,没有密码。该账户只用于从本机连接。

Running jar as a Linux service - init.d script gets stuck starting app

夙愿已清 提交于 2019-12-05 11:28:24
I am currently working on implementing a runnable jar as a background service on a Linux VM box. I have used the example found here as a base to work on, and have modified the start() method into this: start() { # Start application java -jar /home/vagrant/sagepay-stub-1.4.jar >/var/log/sagepay-stub.log 2>&1 PID=$! echo $PID > pid.txt } This sets up the service to write output to the log sagepay-stub.log and saves the PID for use when the service stop method is called. Here is the handler for the start command: case "$1" in start) echo "Starting $APP" start echo "$APP started." ;; When I call

mysql与python连接学习

感情迁移 提交于 2019-12-05 10:59:01
1 问题: pip install MySQLClient 遇到 error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools ---------------------------------------- Failed building wheel for MySQLClient 解决; 安装visual studio---瞎了 解决2;https://blog.csdn.net/ljyt2/article/details/78270559----http://www.jianshu.com/p/44821b6c72e6 这个里面说python3.5不支持python-mysql. 于是尝试: pip install pymysql. 成功! 2.环境变量----- 终端输入pip install numpy 显示'pip' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 解决方法:更改环境变量 这是环境变量所致, pip是默认在python根目录的scripts文件夹下,所以只要将这个路径设置为环境变量即可,设置环境变量 见:

# localhost 、217.0.0.1 、本机IP

我怕爱的太早我们不能终老 提交于 2019-12-05 10:55:16
localhost 、217.0.0.1 、本机IP localhost是一个域名 , 性质跟 “www.baidu.com” 差不多 , 指向 127.0.0.1 这个IP地址 ,在 windows下 ,这个域名是 可以自定义的 ,在hosts文件中。这个域名不能直接绑定套接字,必须先gethostbyname转成IP才能绑定。 可以理解为本机有三块网卡(事实上只有有线和无线两块网卡),一块网卡叫做 loopback(这是一块虚拟网卡),另外一块网卡叫做 ethernet (这是你的有线网卡),另外一块网卡叫做 wlan(这是你的无线网卡)。 你的 本机 IP 是你真实网卡的 IP ,具体来说 有线无线各有一个 ,而 127.0.0.1 是那块叫做 loopback 的虚拟网卡的 IP。 “本机地址”并不是一个规范的名词。通常情况下,指的是“本机物理网卡所绑定的网络协议地址”。 本机地址是与具体的网络接口绑定的 。比如以太网卡、无线网卡或者PPP/PPPoE拨号网络的虚拟网卡,想要正常工作都要绑定一个地址,否则其他设备就不知道如何访问它。 本机地址 通常指的是绑定在物理或虚拟网络接口上的IP地址 , 可供其他设备访问到 。 如果主机中存在多个网卡,分别连接不同的物理网络,比如 192.168.0.1/255.255.255.0 和 192.168.1.1/255.255.255

Nginx实现反向代理

自古美人都是妖i 提交于 2019-12-05 10:55:10
一、前言 在上一篇博客 IIS实现HTTP和WebSocket服务的反向代理 中已经介绍了什么是反向代理以及如何通过IIS实现反向代理,但IIS毕竟受环境的限制,接下来给大家介绍另一种方式使用Nginx实现反向代理。 关于Nginx大家可以参考我另一篇博客: Nginx一个很好用的“服务器” 二、开始 第一步、准备一个能访问的站点。 例如:我在IIS建了一个站点,里面只有一个test.html文件,里面是一句话“Hello World”,IIS上的访问地址为:http://localhost:5106/test.html,现在我要利用Nginx实现反向代理,通过访问http://localhost:8889/test.html然后跳转到5106。 第二步、打开conf/nginx.conf文件进行配置,配置可以参考: #在nginx.conf的注释符号位##每个指令必须有分号结束#user nobody; worker_processes 2;  #允许生成的进程数,默认为1,建议设置为等于CPU总核心数 pid D:/MyJob/Projects/nginx-1.17.5/pid/nginx.pid; #指定nginx进程运行文件存放地址,注意路径别写错了,如果不想要这个配置就在前面加#号 error_log logs/error.log debug;  #日志路径 events

python selenium webdriver issue ( selenium.common.exceptions.WebDriverException: Message: \"Can't load the profile. Profile Dir: )

时光总嘲笑我的痴心妄想 提交于 2019-12-05 10:50:51
I'm using Mac OS X 10.8.3, selenium 2.32.0, python 2.7, Firefox Version 20 and have been getting this error when running the python binding: selenium.common.exceptions.WebDriverException: Message: "Can't load the profile. Profile Dir: /var/folders/vn/8h6w79td4p59l9h9xhx2986r0000gn/T/tmpTmsdul Firefox output: LOG addons.xpi: startup LOG addons.xpi: Skipping unavailable install location app-system-share LOG addons.xpi: checkForChanges LOG addons.xpi: No changes found 2013-04-11 21:59:09.107 firefox-bin[26167:707] invalid drawable" Firefox opens, but doesn't load the url that I've supplied in my

使用熔断器仪表盘监控

坚强是说给别人听的谎言 提交于 2019-12-05 10:04:34
# Sentinel 控制台 Sentinel 控制台提供一个轻量级的控制台,它提供机器发现、单机资源实时监控、集群资源汇总,以及规则管理的功能。您只需要对应用进行简单的配置,就可以使用这些功能。 注意: 集群资源汇总仅支持 500 台以下的应用集群,有大概 1 - 2 秒的延时。 # 下载并打包 # 下载源码 git clone https://github.com/alibaba/Sentinel.git # 编译打包 mvn clean package 注:下载依赖时间较长,请耐心等待... # 启动控制台 Sentinel 控制台是一个标准的 SpringBoot 应用,以 SpringBoot 的方式运行 jar 包即可。 cd sentinel-dashboard\target java -Dserver.port=8080 -Dcsp.sentinel.dashboard.server=localhost:8080 -Dproject.name=sentinel-dashboard -jar sentinel-dashboard.jar 如若 8080 端口冲突,可使用 -Dserver.port=新端口 进行设置。 # 访问服务 打开浏览器访问: http://localhost:8080/#/dashboard/home # 配置控制台信息 application

11月19日 数据库连接 PDO

江枫思渺然 提交于 2019-12-05 09:36:01
PDO: <?php /*$conn = mysql_connect('localhost','root','root'); mysql_select_db('db_shcool'); $result = mysql_query ('select*from stu2');*/ //print_r(mysql_fetch_array($result)); //print_r(mysql_fetch_array($result)); //mysql_close($conn); /*while ($row = mysql_fetch_array($result)){ print_r($row);*/ /*$row=mysql_fetch_array($result); while($row){ print_r($row); $row=mysql_fetch_array($result); }*/ $dsn = 'mysql:host=localhost;dbname=db_shcool'; $opt = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'set names utf8'); $user = 'root'; $pwd = 'root'; $pdo = new PDO ($dsn, $user, $pwd,$opt); $rs = $pdo ->

Localhost not working on XAMPP - both service apache & mysql are fine

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 08:25:09
问题 My xampp installation 1.7.1 does not seem to work. http://localhost returns not found error. Xampp Control panel shows both mysql & apache service running fine. I'am on windows vista. Frustrated since past 2 weeks to find a solution to this. Any pointers and support will be appreciated! Thanks a ton folks. 回答1: I struggled for days figuring out why I was getting a blank screen while using xampp. The cultprit was skype. Always turn of skype when you want to use localhost. 回答2: In your "xampp"