host

How to write a simple Ping method in Cocoa/Objective-C

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I need to write a simple ping method in Cocoa/Objective-C. It also needs to work on the iPhone. I found an example that uses icmp , will this work on the iPhone? I'm leaning towards a solution using NSNetServices , is this a good idea? The method only needs to ping a few times and return the average and -1 if the host is down or unreachable. 回答1: The code below seems to be working synchronously: const char * hostName = [@ "stackoverflow.com" cStringUsingEncoding : NSASCIIStringEncoding ]; SCNetworkConnectionFlags flags = 0 ; if (

Debugging ASP.NET MVC3 application hosted on Local IIS Webserver

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've managed to use the local IIS Webserver to host my MVC3 application, and I can debug it and everything, from the machine that is hosting it. - however, when I send a request from another machine (my Mac, which is running my Windows in a Parallels VM), I get the expected result, but the debugger wont stop at my breakpoints! I tried adding a Debugger.Break(); to my action, and that crashes the w3wp.exe .. To, so summarize: Local requests are working, and can be debugged. External requests are working, but they cannot be debugged. In my

C# Runspace Powershell (Interactive)

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying with C# to execute a Powershell file with paramters in a runspace. Unfortunately i get the following output: A command that prompts the user failed because the host program or the command type does not support user interaction. Try a host program that supports user interaction, such as the Windows PowerShell Console or Windows PowerShell ISE, and remove prompt-related commands from command types that do not support user interaction, such as Windows PowerShell workflows. What could i do? Current c# code. this needs to execute

1130 Host 'amazon-ec2-ip' is not allowed to connect to this MySQL server

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am facing a problem in accessing the mysql DB on one of my Amazon EC2 servers from another EC2 server. I read through various articles regarding providing appropriate permissions for mysql to be accessed from external IP addresses, and here are the steps that I followed: Opened port 3306 on my host EC2 instance to allow for external Mysql connection. In the file /etc/mysql/my.cnf, changed the "bind-address" from "127.0.0.1" to "0.0.0.0". Opened mysql using root, and executed the following command: GRANT ALL PRIVILEGES on . to worker@'ec2

Unknown Host exception from the AWS Java client?

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Has anyone else run across this exception? We saw it during a load test last night. The hostname is correct and normally works fine. It just started throwing this exception last night. Either it was a random DNS fail on amanzon's part or the Aws SDK for Java does something unexpected under load. > Caused by: java.net.UnknownHostException: sdb.amazonaws.com at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:867) at java.net.InetAddress.getAddressFromNameService

SqlCommand timeout even though in SQL Studio same query is fast

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have what I thought was a simple query that I execute from my little log-processing application. The aim of this method is to simply get the highest date value out of the log table: private DateTime GetLastEntryDate(string serverName, string siteName) { DateTime dt = DateTime.MinValue; using (var con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["LogParserDB"].ConnectionString)) { con.Open(); using (var cmd = new SqlCommand("SELECT MAX(date) FROM iislogs WHERE host=@Host AND site=@Site", con)) { cmd

redirect_uri and how to host callback.html on SoundCloud?

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to access Soundcloud from a local HTML page on my laptop. I am stuck at the part of hosting "callback.html" as a redirect_uri. The script I am trying to run is the basic Authenication JavaScript from the Soundcloud documentation page: <script src = "http://connect.soundcloud.com/sdk.js" ></script> <script> // initialize client with app credentials SC . initialize ({ client_id : 'my_client_id' , redirect_uri : 'http://127.0.0.1/Users/Maria/Documents/SoundcloudClient/callback.html' }); // initiate auth popup SC . connect

SSRF漏洞利用从浅到深

…衆ロ難τιáo~ 提交于 2019-12-03 08:50:49
梳理一下最近 不详细 简单记录 看不懂拉倒 \0x01 SSRF成因和基本利用 0x02 内网打未授权redis 0x03 关于ssrf打授权的redis 0x04 写redis shell和密钥的一点问题 0x05 SSRF Bypass 0x06 SSRFmap 0x01 SSRF成因和基本利用 php vul function: file_get_contents() fsockopen() curl_exec() readfile() example: <?php function curl($url){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); } $url = $_GET['url']; curl($url); ?> <?php function Getfile($host, $port, $link){ $fp = fsockopen($host, intval($port), $errno, $errstr, 30); if(!$fp){ echo "$errstr (error number $errno) \n"; }else{ $out = "GET

Apache HttpClient 4.1 - Proxy Authentication

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I've been trying to configure the user and password for proxy authentication from the configured properties while using Apaches HttpComponent's httpclient, but with no success. All examples I have found refer to methods and classes that are no longer available, such as HttpState and setProxyCredentials . So, can anyone give me an example of how to configure the proxy credentials? 回答1: For Basic-Auth it looks like this: DefaultHttpClient httpclient = new DefaultHttpClient (); httpclient . getCredentialsProvider (). setCredentials (

Redirect www to non-www in Laravel with URL parameters

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I redirect URL from www.myapp.co to myapp.co ? And also if the URL has other parameter like www.myapp.co/other-parameter will be redirected to myapp.co/other-parameter where the other-parameter can be anything. Sorry for this noob question, I am still 1 week in using Laravel. BTW, I am using dynamic subdomain so I need only the redirect www to non-www and not the other subdomains. Route::group(array('domain' => 'myapp.co'), function() { Route::get('/', function() { return 'Hello! Welcome to main page...'; }); Route::get('/login',