server

Python pip raising NewConnectionError while installing libraries

☆樱花仙子☆ 提交于 2019-12-02 00:39:19
问题 I've Python 3 running in a linux server. I need to install some libraries (obviously) so I'm trying : pip3 install numpy Which, is resulting in the following error: Collecting numpy Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f7542572828>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/numpy/ Retrying (Retry(total

XAMPP missing php_eaccelerator_ts.dll

谁都会走 提交于 2019-12-02 00:38:44
In php.ini there's this line zend_extension = "C:\xampp\php\ext\php_eaccelerator_ts.dll" and following this guide at XAMPP on Win7 too slow it says uncommenting that line makes XAMPP faster, but what's the point if the file wasn't even installed with latest Windows XAMPP installer. So I snatched the file from Google and put in the dir, but now when starting servers Apache and the rest it gives this error: http://i.stack.imgur.com/ajQmg.jpg (not enough rep to post pics yet). You should download and use one of the complied dll's below. It should match your PHP version. PHP 5.3.XX VC9: http://eac

The requested address is not valid in its context error

扶醉桌前 提交于 2019-12-02 00:37:31
问题 I was following a tutorial called "Black Hat Python" and got a "the requested address is not valid in its context" error. I'm Python IDE version: 2.7.12 This is my code: import socket import threading bind_ip = "184.168.237.1" bind_port = 21 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((bind_ip,bind_port)) server.listen(5) print "[*] Listening on %s:%d" % (bind_ip,bind_port) def handle_client(client_socket): request = client_socket.rev(1024) print "[*] Recieved: %s"

Java Sockets. Server-Client communication

非 Y 不嫁゛ 提交于 2019-12-01 23:41:13
I am trying to connect a client with gui with a server withoout gui. Connection is being done, but i cant see any messages between these two apps. (i should get SERVER HERE in client, and CLIENT HERE in server) Client Connection Code: @Override public void ClientRunning(){ try { connectToServer(); setStreams(); ClientRun(); }catch(EOFException oefException){ showMessage("\n Client terminated the connection\n"); }catch(IOException ioException){ ioException.printStackTrace(); }finally{ close(); } } public void connectToServer() throws IOException{ showMessage("Attempting Connection... \n");

How to restrict web server written in golang to allow a particular address instead of a pattern?

时光毁灭记忆、已成空白 提交于 2019-12-01 23:01:43
When I use http.HandleFunc("/", serveRest) //serveRest is the method to handle request http.ListenAndServe("localhost:4000", nil) It will accept all request starting with "/" . How do I restrict it to serve only "localhost:4000" instead of every address like "localhost:4000/*" ? And can you guys suggest me a good tutorial for Go? icza The URL pattern to which you register your handlers is documented in the http.ServeMux type: Patterns name fixed, rooted paths, like "/favicon.ico", or rooted subtrees, like "/images/" (note the trailing slash). Longer patterns take precedence over shorter ones,

Exception in thread “main” java.net.ConnectException: Connection refused: connect Socket Programming Java

百般思念 提交于 2019-12-01 22:50:43
I recently learn about Socket Programming between client and server. So I thought of doing an exercise of connecting both client and server. However, I have encountered this error message when I try to run the code: Exception in thread "main" java.net.ConnectException: Connection refused: connect This is my client class code: public class clientpart { public static void main(String[]args) throws UnknownHostException, IOException { Scanner input = new Scanner(System.in); int port = 8080; String host=null; String answer; String sendMessage; String receivedMessage; InetAddress address =

PHP中$_SERVER的详细参数与说明

心已入冬 提交于 2019-12-01 22:39:45
PHP编程中经常需要用到一些服务器的一些资料,特把$_SERVER的详细参数整理下,方便以后使用。 $_SERVER['PHP_SELF'] #当前正在执行脚本的 文件 名,与 document root相关。 $_SERVER['argv'] #传递给该脚本的参数。 $_SERVER['argc'] #包含传递给 程序 的命令行参数的个数(如果运行在命令行模式)。 $_SERVER['GATEWAY_INTERFACE'] #服务器使用的 CGI 规范的版本。例如,“CGI/1.1”。 $_SERVER['SERVER_NAME'] #当前运行脚本所在服务器主机的名称。 $_SERVER['SERVER_SOFTWARE'] #服务器标识的字串,在响应请求时的头部中给出。 $_SERVER['SERVER_PROTOCOL'] #请求 页面 时通信协议的名称和版本。例如,“HTTP/1.0”。 $_SERVER['REQUEST_METHOD'] # 访问 页面时的请求方法。例如:“GET”、“HEAD”,“POST”,“PUT”。 $_SERVER['QUERY_STRING'] # 查询 (query)的 字符 串。 $_SERVER['DOCUMENT_ROOT'] #当前运行脚本所在的文档根目录。在服务器配置文件中定义。 $_SERVER['HTTP_ACCEPT']

Restrict access to Node.js using Express

一笑奈何 提交于 2019-12-01 18:12:43
I do have a running node.js script located in a server. What i want is that it doesn't get directly accessed from browser and also i want that only certain domains/IP-s can call it! Is it possible?! traktor53 Not sure how to distinguishing between accessing something from a browser as opposed to other software, but restricting access to some domains/IPs should be doable. The following (non production) code to restrict access to the localhost loop back might serve as a starting point: function securityCheck( req, response, next) { var callerIP = req.connection.remoteAddress; (callerIP == ":

Restrict access to Node.js using Express

风格不统一 提交于 2019-12-01 17:36:12
问题 I do have a running node.js script located in a server. What i want is that it doesn't get directly accessed from browser and also i want that only certain domains/IP-s can call it! Is it possible?! 回答1: Not sure how to distinguishing between accessing something from a browser as opposed to other software, but restricting access to some domains/IPs should be doable. The following (non production) code to restrict access to the localhost loop back might serve as a starting point: function

Wakanda Server scripted clean shutdown

北城以北 提交于 2019-12-01 17:17:05
问题 What is best practice to perform a clean shutdown of a Wakanda server via OS X shell scripting? This would be with a solution currently loaded and operating. 回答1: The best practice for the upcoming release 1.1.0 : Handle the applicationWillStop event on a service to handle app specific closing logic service wakanda stop for Ubuntu and a normal kill for Mac OS ( kill -9 should always be the last resort after some kind of timeout but this should not be necessary anymore) The best practice for