w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Efficient way to map my Ip address with subnet and subnet mask in java
If you mean to find out to what APN your IP corresponds, then you need to apply each subnet mask to the IP address, and then lookup the subnet and retrieve the APN. I don't understand if you want to do this on the DB, on Java, or some form of collaboration between both.

Categories : Java

Blackberry: how to find subnet mask of connected network
Unfortunately, I believe there is no reliable way to do this in BlackBerry Java. You can get the Wi-Fi IP address, but not the subnet mask. I was hoping that maybe you could reverse engineer the subnet mask by attempting a UDP broadcast connection, but it looks like that's not supported either. Certainly, if you're on a Wi-Fi network where you have access to a web interface for the Wi-Fi router, you could try to scrape subnet mask values off the router. But, that's only likely to be useful for your home network, and I assume you'd like this code to work anywhere. So, I don't think there's a good solution :(

Categories : Java

how to construct a string of physical subnet ids to create db subnet group on the fly in a cloudformation script?
I run into the same issue, after working with AWS support I understood that List of String does not mean what we initially thought. Also, if you want to place the DB inside a VPC you must not use AWS::RDS::DBSecurityGroup objects. Here is a full sample, it took me a while to get it working: "dbSubnetGroup" : { "Type" : "AWS::RDS::DBSubnetGroup", "Properties" : { "DBSubnetGroupDescription" : "Availability Zones for RDS DB", "SubnetIds" : [ { "Ref" : "subnetPrivate1" }, { "Ref" : "subnetPrivate2" } ] } }, "dbInstance" : { "Type" : "AWS::RDS::DBInstance", "Properties" : { "DBInstanceIdentifier" : { "Fn::Join" : [ "", [ { "Ref" : "AWS::St

Categories : Amazon

How to set connection affinity mask in SQL server 2005 when enabling VIA protocol
Well.The service is started for me by making connection affinity mask as [0xAA] in the setting. :) But, still I'm not able to access my SQL server Database from iPhone HWC application(made by SUP tool) and getting same error: "error code 503 com.microsoft.sqlserver.jdbc.sqlserverexception the tcp/ip connection to host failed" :( Any clue??

Categories : IOS

Part of my project started using incorrect connection string - how do I fix that?
When Entity Framework connects to create the entity objects it also establishes the connection string to that database. This usually isn't a problem since that project is referenced by another program that is overriding the server connection string with their own app config (or web config). Typically in code when connecting to an instance of Sql Server, you write your code: using ( MyServer context = new MyServer(myconfig.ConnectionStrings["MyServerName"])) { } If you exclude providing he connection string when creating the instance of your context, you risk catching the default value created when you updated entity framework. So this probably answers both your questions: the why is it changed your connection string. The explicit use is the code example above.

Categories : C#

How to mask divs with a linear gradient mask?
I would think that the transparent PNG would be the best bet, make it absolute with a higher z index and make it inside a container div. This container div would float over the background sliding image? I would use a very small 2 px slice and just repeat it along the y axis, but I might not be seeing your problem correctly. I tried it with a very small slice of the radiant that I repeated down (y) and the underlying image did scroll through the top transparent images. If I follow what you are trying to do. It worked in chrome, firefox and safari: here is the css #container { background-attachment: scroll; background-image: url(Untitled-1.jpg); background-repeat: repeat-x; clear: both; float: left; height: 768px; width: 80000px; position: relative; } #container #info { float: left; wid

Categories : HTML

Calculate in which subnet is IP address
Thanks, I attach a part of solution: $ip_addr = "192.168.36.9"; $subnet_mask = "255.255.248.0"; $ip = ip2long($ip_addr); $nm = ip2long($subnet_mask); $nw = ($ip & $nm); $bc = $nw | (~$nm); echo "IP Address: " . long2ip($ip) . " "; echo "Subnet Mask: " . long2ip($nm) . " "; echo "Network Address: " . long2ip($nw) . " "; echo "Broadcast Address: " . long2ip($bc) . " "; echo "Number of Hosts: " . ($bc - $nw - 1) . " "; echo "Host Range: " . long2ip($nw + 1) . " -> " . long2ip($bc - 1) . " "; This work, if I use zero subnet. For no zero subnet this example not work.

Categories : PHP

Multiple VLANs in the same subnet
Of course, that's possible to have multiple VLANs in the same subnet. But it's impossible to have one TMG for multiple VLANs, from the guest OS side, each switch VLAN interface can bind only one primary address. Either untag or tagged traffic can pass VLAN 1-3 range.

Categories : Misc

Regular Expression to Match IP Subnet
You might try using a lookahead. Also, please escape the . characters—otherwise it would match any character: @"d{1,3}.d{1,3}.d{1,3}(?=.d{1,3})" This will match any string like 127.65.231 as long as it's followed by a string like .111.

Categories : C#

Whats my IP and subnet from Azure website?
It sounds like this is what you're looking for: Windows Azure Datacenter IP Ranges

Categories : Asp Net

Given an IP address and a Subnet, how do I calculate the range of IPs using php
<?php $subnet = "255.255.252.0"; // provide your subnet here $ip = "191.168.31.0"; // provide your ip here $ip_blocks = explode(".", $ip); $mask_blocks = explode('.', $subnet); $ip_class = ''; if($ip_blocks[0] > 0 && $ip_blocks[0] <= 126) { $ip_class = 'a'; } elseif($ip_blocks[0] >= 128 && $ip_blocks[0] <= 191) { $ip_class = 'b'; } elseif($ip_blocks[0] >= 192 && $ip_blocks[0] <= 223) { $ip_class = 'c'; } elseif($ip_blocks[0] >= 224 && $ip_blocks[0] <= 239) { $ip_class = 'd'; } elseif($ip_blocks[0] >= 240 && $ip_blocks[0] <= 255) { $ip_class = 'e'; } else { die('wrong ip'); } $subnet_class= ''; if($mask_blocks[0]=='255' && $mask_blocks[1] < '255') { $subnet_class = 'a'; } el

Categories : PHP

AWS - Accessing instances in private subnet using EIP
Of course, the stuff in the private subnet is in the private subnet because it shouldn't be accessible from the Internet. :) But... I'm sure you have you reasons, so here goes: First, no, you can't do this in a straightforward attach → use → remove way, because each subnet has exactly one default route, and that either points to the igw object (public subnet) or the NAT instance (private subnet). If you bind an elastic IP to a machine in the private subnet, the inbound traffic would arrive at the instance, but the outbound reply traffic would be routed back through the NAT instance, which would either discard or mangle it, since you can't route asymmetrically through NAT, and that's what would happen here. If your services are TCP services (http, remote desktop, yadda yadda)

Categories : Amazon

MongoDB network subnet lookup
Remember that IPs are just ints and subnet masks are just ranges of ints - they're displayed as they are so that humans can read them (among other reasons). What I would do is add two additional fields to my MongoDB schema: startAddr and endAddr. Represent them as ints and they will be the starting and ending addresses for your subnet. Next, you can convert the IP to an int in your application. See here for information on converting an IP to an integer, you didn't mention what language you're writing your application in so can't help you there. Finally, query MongoDB on the following db.collection.find({startAddr: {$lte: <ip>}, {endAddr: {$gte: <ip>}}}) You can also combine this new schema with some application level code to easily do things like find documents that hav

Categories : Mongodb

Connecting to SQL Server 2008 R2 Express on same subnet
Have you installed the SQL 2008 Native Client? That maybe your issue. http://www.microsoft.com/en-us/download/details.aspx?id=16978

Categories : C#

Given a subnet range and a list of IPs select all rows which the IPs fall between
this is not a complete solution, but more a idea to another design, i was thinking instead of doing typical SQL comparison, why not try using logical comparison. Knowing very little of the sql implementation i have tried fooling around with bitwise comparison, (with bigint) there is much optimization to be done, however i think there is a possibility that it might help, a small demonstration where i compare 4 ip's (192.168.1.1 and 3 more), i use them as bigints cause a int is too small, and i need to use the logical bitwise comparison, (more info here http://msdn.microsoft.com/en-us/library/ms174965.aspx) select * from ( select cast(192168001001 as bigint) as ip union all select cast(192168001002 as bigint) as ip union all select cast(192168002001 as bigint) as ip union all

Categories : SQL

HTTP Status code for when client is outside the allowed IP subnet
403 Forbidden seems like the most descriptive status code for this. However, RFC 2616 suggests that you could also use 404 Not Found if you don't want to let the user know that the reason for the failure is an access control restriction. It says: If ... the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead. If the person attempting the access believes the error code, it might discourage them from trying to find a way around the restriction (e.g. by searching for a proxy). But it probably won't stop a determined hacker.

Categories : PHP

Java library to check if IPv4 or IPv6 address is in a given subnet
edazdarevic's CIDRUtils supports both IPv4 and IPv6. The example does not mention boolean isInRange(String ipAddress), but it is implemented! Another option is java-ipv6, but it does not support IPv4 and requires JDK7.

Categories : Java

Can almost determine subnet membership given CIDR notation, but getting unexpected results
I don't think you can safely assume that the netmask always occupies three characters at the end of the string: unsigned int startOfCidr=strlen(cidrNotation)-3; When you have a /8 mask, for example, you only use two characters to specify it. (This is probably also why it works for everything >= 10.) Try searching for a / character instead and parsing the netmask starting there.

Categories : C

Generating subnet CIDR blocks programmatically in CloudFormation templates (or adding integers together)
My solution for these kinds of issues was to use a legitimate programming language to compile a template into a CloudFormation JSON document. I used PHP 5.4, Twig and Symfony Console, but YMMV. Essentially, you do the math ahead of time in the programming language, then use that data as you write-out your JSON document.

Categories : Amazon

Openvpn server not forwarding ping traffic from tun0 to eth0 for rest of the hosts in the subnet
If you don't have rules in your firewall to forward the traffic you need to specify those. iptables -I FORWARD -i tun+ -o eth0 -j ACCEPT ###### iptables -I FORWARD -i eth0 -o tun+ -j ACCEPT

Categories : Misc

502 Bad Gateway Django
It sounds like your uWSGI instance has died or is failing in such a way that it does not know how to answer. Start by watching the nginx logs in addition to the uWSGI logs and see how far it gets. Perhaps the file you are uploading is so large it is choking some front streaming portion. Edit your post to indicate the output of the two log files and we will see.

Categories : Django

502 Bad Gateway HAproxy
First, enable haproxy logging. It will simply tell you why it is giving the 502's. My guess is that the backend "localhost:8080" is simply not able to keep up or is not able to get a connection within 4000ms "timeout connect 4000".

Categories : Linux

Get mac address from gateway
Please try netstat -nr | grep default | awk '{print $1}' If you do lots of bash scripting, you should probably get familiar with awk, which does this type of things (and is pretty mighty by the way).

Categories : Osx

502 Bad Gateway TimeOut
Can you get the substatus of the 502 errors (from the IIS logs)? Also, not sure how you're doing it but have a look at the following question (linked below) to see how to write to Excel ranges quickly. Using the interop methods is devastatingly slow. If you are, then maybe changing to this strategy will help you solve your problem. Write Array to Excel Range

Categories : C#

Zend_Db_Profiler_Firebug get 502 bad gateway
This is related to the problem of nginx with the Wildfire protocol headers. See this Nginx 502 Bad Gateway error ONLY in Firefox The proposed solution given there is to change the nginx configuration to increase buffer size proxy_buffers 8 16k; proxy_buffer_size 32k; Bug database of FirePHP Project https://code.google.com/p/firephp/issues/detail?id=128

Categories : PHP

Configuring SMS gateway?
Before you go on implementing something by yourself, I suggest that you check services that already do it well. Maybe you can just use them? One such easy-to-use service is Twilio.

Categories : Misc

php loop 502 Bad Gateway
I think the problem is that your script is timing out, you can overcome this by using set_time_limit(0) in you script or by changing the max_execution_time in your php.ini: while(1) { set_time_limit(0); // do something } You also need to increase your memory_limit by editing your php.ini and restart your webserver. Read documentation for set_time_limit()

Categories : PHP

Sms gateway foreach error
foreach($fields_string as $key=>$value) $fields_string is a string, not an array, and you've just initialized it to be empty. Perhaps you're meaning to iterate over $fields here?

Categories : PHP

SMS gateway integration with Tigase
There is no SMS gateway out of the box, but it is very easy to implement one. Just create a Tigase component which intercepts messages and forwards them as SMS. Some of our customers have implemented SMS, iPhone, Android, BB gateways already.

Categories : Misc

How to use Conbase API as a payment gateway?
This is the un-official library for coinbase api that is in node.js https://github.com/otakup0pe/nodecoinbase. Coinbase has a very nice documentation with their api here: https://coinbase.com/api/doc/1.0.html and you might be interested in the transactions. Also if you just planning to sell items, you can just use the "Bitcoins Accepted Here" button VIA the Merchant tools > Tools page.

Categories : Node Js

Payment Gateway Android and iOS
Use http://www.zooz.com/ (can use for paypal and credit/debit integration). And its simple.. Aslo https://stripe.com/

Categories : Android

How to use iphone as a gateway in SMSLib?
You can't access any of iOS SMS settings nor the messages. Java is also not support natively on iOS. It is also not possible to do any low level GSM calls like SMS. If you want to send a SMS in iOS you will need to use the MFMessageComposeViewController

Categories : Java

Sending an SMS via sms gateway in delphi
Read the documentatation again more carefully: Send a POST call to http://www.FreeSMSGateway.com/api_send with the following POST variables: access_token: Your API Access Token from your account dashboard message: The url encoded message, 160 characters or less send_to: This value need to be "existing_contacts" to send to all your existing contacts in your account or "post_contacts" to supply a custom list of contacts post_contacts: A JSON array of contacts to send the message to instead of your existing contacts. Only required is "send_to" is set to "post_contacts" Your send_to param value does not meet the requirements stated. You are passing the specific contact number in the send_to field, but that contact must be passed in the post_contacts field instead, e

Categories : Delphi

mvc4 acting as a gateway
Since nobody gave me an answer i'm gonna suggest myself to try with this: http://www.iis.net/learn/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing seems that reverse proxy can do the trick, but i need to do it with two separate iis

Categories : Asp Net Mvc

GCM push notifications cause 502 Bad Gateway
According to the GCM guide, all 5xx error codes should be treated as temporary errors, and requests that get these errors should be retried : 5xx Errors in the 500-599 range (such as 500 or 503) indicate that there was an internal error in the GCM server while trying to process the request, or that the server is temporarily unavailable (for example, because of timeouts). Sender must retry later, honoring any Retry-After header included in the response. Application servers must implement exponential back-off. I don't think 10 messages a second is too quick. As long as your code handles this error and retries, I don't think there should be any problem.

Categories : Android

Nginx + FastCGI + C throws 502 Bad Gateway
Its look like your php5-fpm is not running om 8000 port as you included in nginx conf fastcgi_pass 127.0.0.1:8000; You can verify your php5-fpm is running on that port by using following commands grep -Hr "8000" /etc/php5/fpm/pool.d For setup php5-fpm on 8000 open following file and change listen to 8000 port vim etc/php5/fpm/pool.d/www.conf now search listen and replace it with following line listen = 127.0.0.1:8000 Save the file and restart php5-fpm

Categories : C

502 Bad Gateway on WSGI app using Nginx + Cherrypy
When I've seen this (not with CherryPy, but with Gunicorn/others), it's been because the server is restarting and Nginx can't connect to it. Is anything else happening on the server which might be causing CherryPy to restart?

Categories : Python

https Request for CSS file gives 502 Bad Gateway
try calling your css by just <link href="./test/Style/Secure/en/BodyStyle.css" rel="stylesheet" /> When you are using https, it binds it to your whole entire domain name. If want your css3 to be hidden from the rest the public, this is impossible when you are importing through html. Browsers need this file to render ur html designs properly.

Categories : Asp Net

WP Ecommerce Payment Gateway for Belgium
There is very limited document for creating your own payment method in wp-ecommerce, Best method i would suggest, Look at default payment like authorize.net , paypal and see , Which methods/class they have used. Make clone of this functions with your Belgium Payment API & Response.

Categories : Wordpress

first data payment gateway (premium)
you have to take SSL licence from your web hoster for yor site After installation if that will not work then try to add below code in your function.php of theme for particular page with ssl add_action('wp_head', 'apply_ssl_to_specific_page'); add_action('admin_head', 'apply_ssl_to_specific_page'); add_action('login_head', 'apply_ssl_to_specific_page'); function apply_ssl_to_specific_page(){ <?php if ( is_page('your-checkout-page-slug') ) { if($_SERVER['SERVER_PORT'] != '443') header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); } else { if($_SERVER['SERVER_PORT'] == '443') header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); } } replace your-checkout-page-slug with your page sl

Categories : Wordpress



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.