w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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

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

How to leave my general "Routes" intact when operating code in a specific "Area" with its own "Routes"?
When you have areas in your app you will need to be specific about which controllers and actions you want to point to. If you are inside your SubApp area, then any link you need to create pointing to the root, should include an empty area. @Url.Action("index", "home", new { area = "" } Using the same concept, any url from the root controllers to the SubApp area should include the area in the link: @Url.Action("index", "home", new { area = "SubApp" } If you are not crossing any boundaries, then not specifying the area will default to the area you are in.

Categories : Asp Net Mvc

How to enable format in routes with ServiceStack in tandem with custom routes?
See the wiki page on Routing for documentation on how Routing works, e.g. if you wanted to use pre-defined routes the correct urls would be: /api/json/reply/Things /api/json/reply/things?Id=1 /api/xml/reply/Things /api/xml/reply/things?Id=1 Note: the pre-defined only uses the name of the Request DTO, i.e. it does not use all your custom routes. The Content Negotiation section on Routing wiki shows the different ways to request different Content-Types. In ServiceStack (v3.9.54+) you can now use a format .ext e.g: /api/things.json /api/things/1.json /api/things.xml /api/things/1.xml Which is an alternative to using the ?format=ext parameter: /api/things?format=json /api/things/1?format=json /api/things?format=xml /api/things/1?format=xml

Categories : Rest

Iteration Through Routes Mapped to RouteTable.Routes via MapHttpRoute - MVC4 Web API
If you are looking to iterate only through Web API route collection, you could do something like GlobalConfiguration.Configuration.Routes to get HttpRouteCollection. This collection would have all your api routes.

Categories : Asp Net

Rails Routes. Multiple nested routes with member actions
Delete the comma between resources :milestones and resources :comments. Your code should be resources :projects do resources :milestones resources :comments do member {post :hide} end end

Categories : Ruby On Rails

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

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

Rails 2 + Spree 0.11.0: How do routes work when there are so many routes files?
Routes should be specified in config/routes.rb Here's where they're specified in Spree 0.11.0: https://github.com/spree/spree/blob/v0.11.0/config/routes.rb Modern versions of Spree are mountable Rails engines which will mount some of its own routes underneath your applications routes. However, you're dealing with the rails 2 version which injects its routes a little differently. You're dealing with a very old version of Spree, so many of the resources you find on the internet will pertain to more modern versions of Spree (Rails 3.0+). Your easiest bet will be to figure out where 'gourmet-specialties' is coming from and remove it. If it's coming from the taxonomy tree, try recategorizing it under the root taxon.

Categories : Ruby On Rails

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

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

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

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#

Matching routes in config/routes.rb to a controller
You should use a named route, it would be easier: routes.rb: post 'polls/toggle_live' => 'polls#toggle_live', :as => 'toggle_live' In the view: = link_to "Start", toggle_live_path, {:method => :post, :remote=>true}, {:class=> 'btn btn-success btn-small start-poll'}

Categories : Ruby On Rails

How to build specific resource routes in routes.rb
You can specify which of the standard routes to include when you use the resources command, with the except and only options: resources :foo, :except => [:destroy] do end or resources :foo, :only => [:index, :create, :show] do end

Categories : Ruby On Rails

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#

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

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

Routes inside Routes EmberJS
Why not use a nested resource? this.resource('project', { path: '/project/:project_id' }, function(){ this.resource('manage', function(){ this.route('settings'); this.route('team'); this.route('notifications'); /* etc */ }); }); This is not so different from the post/comments resources described in the ember guides: http://emberjs.com/guides/routing/defining-your-routes/#toc_nested-resources I'd like to have a "manage" section with subsections for the things you can manage, all of which referencing my "project" instance. Ok. So using nested-resources approach you will have a manage.hbs template. To reference the project instance from the manage section or any of the subsections just use needs like this: App.ManageController = Ember.Controller.extend({

Categories : Ember Js

Ember Routes and Rails Routes
How does the browser know to look for an Ember route when the route does not exist in rails? It doesn't. When you enter a url in browser, it will make request to the server, then rails should respond with some content. So in this case when the "/newslinks" url is requested you want rails to respond with an HTML page that includes your ember application. When that page is loaded, the ember app will boot up and from there the ember-router will be used to handle links within the context of your ember app. Make sense?

Categories : Ruby On Rails

Rails routes: same controller different routes
You can use route with constraints. Define a class that executes matches with customized conditions. You can search the API with match to see details. I assume that your tag has two columns named "category" and "name". route.rb match ':category/:name' => 'tags#show', via: 'get', constraints: TagRouteWhiteList.new, as: 'tag' app/models/tag_route_white_list.rb class TagRouteWhiteList def matches(request) Tag.distinct('category').include?(request.params[:category]) && Tag.distinct('name').include?(request.params[:name]) end end In your view, you can use tag_path(category: @tag.category, name: @tag.name)

Categories : Ruby On Rails

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

Rails 4 Include Rails.application.routes.url_helper undefined method routes for nil:NilClass
One way to do it, though probably not the best way is to use included and method_missing. This is of course assuming that you are in ActionView or ActionController Something like this should do OK: module DynamicMenu def included(base) @parent = base end def method_missing method, *args super unless @parent.methods.index method @parent.send(method,args) end end

Categories : Ruby On Rails

how the FireWall knows if the transportation is UDP or TCP?
The header of the packets are completely different, TCP is much bigger for example. A stateful firewall needs to intercept the TCP headers to map the packets to its state table, but also stateless firewalls sometimes have techniques implemented to recognize valid TCP or UDP headers. Most home routers (broadband/wireless) make use of this when you are using port forwarding to distinguish between both protocol versions.

Categories : Security

firewall: 2-way UDP communication possible?
Yes this is called NAT traversal (or UDP punch through) and works in a similar way to TCP - the stateful NAT device is aware you recently sent a UDP packet from a certain end point internally to a certain end point outside and for a period will accept UDP packets from the same outside endpoint and forward them to the same internal end point. I always prefer the IETF docs than the plethora of conflicting information out there (including on this site): http://tools.ietf.org/html/rfc5128

Categories : Networking

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

C# HttpListener and Windows Firewall
This is because HttpListener is built on top of http.sys which will listen on the port you specified on behalf of your program. I haven't found a way to allow only a single program using HttpListener through the Windows Firewall, but you might want to limit your inbound rule to system components only by: Entering typing system in the field "This program" in the tab "Program and services" Selecting protocol type TCP in the tab "Protocols and Ports" together with the port you will be listening on

Categories : C#

Symfony2 - Logging out of one firewall
Logging out clears the security-context in the session, therefore you are logged out of your second firewall aswell. You should be using roles instead of two different firewalls. ROLE_ADMIN and ROLE_CLIENT - i don't see the need for a second firewall here :)

Categories : Security

Karaf works with spring camel routes but not with java DSL camel routes
See this page http://camel.apache.org/spring at the section Using Java Code how to from the spring xml file to refer to a < bean > which is the Java RouteBuilder class. That is the way to have it work in OSGi.

Categories : Spring

How can I log into a firewall first before running fabric commands?
Creating a new task and fabric role should do the trick: from fabric.api import run, task from fabric.decorators import roles from fabric.state import env env.roledefs = {"firewall": ["mybox"]} @roles("firewall") @task def do_stuff_on_firewall_server(): run("some-cmd") You can run this command pretty easily: fab do_stuff_on_firewall_server

Categories : Python

How do I make my program ask for firewall permisions
Basicly, Firewall supposed to pop up automatically (in my programs it did), but if it don't you can add firewall rules programatically, as explained here or here. Also, consider asking Administrator authentication: <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> Good luck!

Categories : C#

How can I install Leiningen packages behind a firewall?
Dependency Tree In order to figure out which jars your project needs you can do: $ lein deps :tree Which will show you something that is called a "dependency tree". It will look similar to: [clj-time "0.5.0"] [joda-time "2.2"] [clojure-complete "0.2.3"] [org.myproject/some-proto "0.0.1-20130523.145830-9"] [org.flatland/protobuf "0.7.2"] [ordered-collections "0.4.0"] [org.flatland/schematic "0.1.0"] [org.flatland/useful "0.9.0"] [com.datomic/datomic-free "0.8.3862"] ... Installing Jars with Lein One simple way to install manually downloaded jars would be to use "lein-localrepo": $ lein localrepo install [-r repo-path] [-p pom-file] <filename> <[groupId/]artifactId>

Categories : Clojure

C# MYSQL - "Tunnel" past firewall
Microsoft Windows include a firewall which specifically blocks ports. If you plan on using MySQL through a network port then you should open and create an exception for this port before performing the installation. To check and if necessary add an exception to the firewall settings: First ensure that you are logged in as an Administrator or a user with Administrator privileges. Go to the Control Panel, and double click the Windows Firewall icon. Choose the Allow a program through Windows Firewall option and click the Add port button. Enter MySQL into the Name text box and 3306 (or the port of your choice) into the Port number text box. Also ensure that the TCP protocol radio button is selected. If you wish, you can also limit access to the MySQL server by choosing the Change scope butto

Categories : C#

Creating firewall rules using iptables
Yes and no. No because: iptables works by defining how to treat packets based on their categorization into chains (INPUT, OUTPUT, FORWARD, ...) first and only then also on specific characteristics (source or destination address, protocol type, source or destination port, etc). You can never define an iptable rule that does not apply to a specific chain. INPUT, OUTPUT, and FORWARD are the default chains of the iptables system. INPUT addresses everything with destination localhost (i.e. that is addressed to your network device); OUTPUT applies to everything with source localhost (i.e. that comes from your computer). Yes because: You can define custom chains. You can do that like so sudo iptables -N MYCHAIN then you can send packets from both the INPUT and the OUTPUT (and if you like t

Categories : Linux

How to add an application as Firewall exception in WiX installer
heat accepts an XSL transform argument to modify its output in any way you need. A simple XSL stylesheet can add an element to a particular File element selected via XPath. This assumes that there is only test.exe in your heat run. If that's not the case, modify the XPath in the match attribute: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wix='http://schemas.microsoft.com/wix/2006/wi' xmlns:fire='http://schemas.microsoft.com/wix/FirewallExtension' xmlns='http://schemas.microsoft.com/wix/2006/wi' exclude-result-prefixes='wix' > <xsl:output method="xml" indent="yes" /> <xsl:template match="//wix:File[contains(@Source,' est.exe')]"> <wix:File>

Categories : Wix

display login form inside firewall
I finally fixed it, I was just confusing firewalls and access control list. As shown in the question, I had created 2 firewalls on the home page, and in symfony2, you cannot be logged in 2 different firewalls - in no way that I know - In this case, if you want to have the login form inside any firewall page, you do not manage it with the firewall, but with the access control list. # Security.yml firewalls: members_area: pattern: ^/ provider: <any_working_entity-based_provider> anonymous: ~ # To allow unauthenticated users to access the firewall --> The login form form_login: login_path: / check_path: /login_check post_only: true default_target_path: / use_referer: false logou

Categories : PHP



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