w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to have a observable collection that can be updated from two sources without causing a loop in knockout.js
You can do a peek. this.selectedItem.peek() as opposed to this.selectedItem() as you are propably doing. Both will return the fields value, but the first will do it without creating a dependency. In other words, peek will get the value, but it won't subscribe to it.

Categories : Javascript

Python-ldap ldap.initialize rejects a URL that ldapurl considers valid
You can programatically encode the last part of the URL: from urllib import quote # works in Python 2.x from urllib.parse import quote # works in Python 3.x url = 'ldap://192.168.2.151/dc=directory,dc=paralint,dc=com' idx = url.rindex('/') + 1 url[:idx] + quote(url[idx:], '=') => 'ldap://192.168.2.151/dc=directory%2Cdc=paralint%2Cdc=com'

Categories : Python

Java spring LDAP - Waring LDAP password expire
Credentials expiration date and time Getting the date and time at which the password was last changed: private final static long DIFF_NET_JAVA_FOR_DATE_AND_TIMES = 11644473600000L; long adDateTime = Long.parseLong(pwdLastSet); long milliseconds = (adDateTime / 10000) - DIFF_NET_JAVA_FOR_DATE_AND_TIMES; Date pwdLastSetDate = new Date(milliseconds); Getting the number of max days that could have the password: private final static int ONE_HUNDRED_NANOSECOND = 10000000; private final static long SECONDS_IN_DAY = 86400; long maxPwdAge = Math.abs(Long.parseLong(maxPwdAgeStr)); long maxPwdAgeSecs = maxPwdAge / ONE_HUNDRED_NANOSECOND; int maxPwdAgeDays = (int) (maxPwdAgeSecs / SECONDS_IN_DAY); Getting the the date and time at which the password will expire Calendar cal = Calendar.getInstan

Categories : Java

How do I find all the roles a user has in LDAP using the UnboundID LDAP SDK?
Use the following function. Assumption that you works with SUN LDAP (you use uid): Edited private boolean isGroupContainUser(LDAPConnection ldapConnection, String groupDn, String userDn) throws LDAPException { boolean ret = false; Entry groupEntry = ldapConnection.getEntry(groupDn); String[] memberValues = groupEntry.getAttributeValues("uniquemember"); if (memberValues != null) { DN ldapUserDn = new DN(userDn); for (String memberEntryDnString : memberValues) { DN memberEntryDn = new DN(memberEntryDnString); if (memberEntryDn.equals(ldapUserDn)) { ret = true; break; } } } return ret; }

Categories : Java

How to get "supportedControl" from LDAP with com.novell.ldap
You would need to add the control to the search request and be able to interpret the response. There are soem examples available: http://www.novell.com/documentation/developer/samplecode/jldap_sample/ -jim

Categories : Java

IIS SQL Server: Connection Pool: Why are new connections made instead of reusing existing connections?
If the connections are coming from a different machine, the connections can't be pooled. A connection required both endpoints to be a connection. If you are using connection pooling correctly, applications instantiate a connection (from the pool), use the connection, then drop it as soon as exchange is complete. If you a writing a single-threaded desktop app, another common and simple strategy is to open a connection, and just leave that connection open as long as the application is running. You can control how many connections are created, etc. see MS article for more details related to connection pooling. IIRC, connection pools are not shared unless the connection string is identical either.

Categories : Sql Server

external ldap client for wso2 Identity Server to authenticate external ldap users
You can check the IS documentation on how to connect to external LDAP server . If you have successfully connected to external store, then authentication will happen against that usertore.. What is the issue you faced when you authenticate with the external LDAP user store? You can file a bug report..

Categories : Wso2

DIVs refuse to be next to each other
See the following HTML code: <body> <div id="header"> <div id="logo"><a class="logoclass" href="index.html">DesignAtEase.com</a></div> <ul id="headerlinks"> <li><a href="index.html">Home</a></li> <li><a href="coding.html">Coding</a></li> <li><a href="graphics.html">Graphics</a></li> <li><a href="database.html">Database</a></li> <li><a href="support.html">Support</a></li> <li><a href="more.html">More</a></li> </ul> </div> <ul id="quicklinks"> <li><a href="quickstart.html">Quick Start</a></li> <li><a href="tagsmain.html">Tag Helper</a></li> &l

Categories : HTML

Is it possible to create different connections per client in SignalR? Persistent Connections
You could use my lib for this called SignalR.EventAggregatorProxy Install using nuget Install-Package SignalR.EventAggregatorProxy It takes care of the Hub and connection details for you under the hood, so that you only need to subscribe and publish events Check wiki for how to set it up https://github.com/AndersMalmgren/SignalR.EventAggregatorProxy/wiki Once set up all you need todo to get it to listen to a back end event from javascript is ViewModel = function() { signalR.eventAggregator.subscribe(MyApp.Events.TestEvent, this.onTestEvent, this); }; You can listen to how many events you want on only one connection and one hub

Categories : Javascript

Why does Thinking Sphinx refuse to work?
I'm guessing Sphinx didn't correctly link up with MySQL when you installed it via macports (I generally would recommend homebrew over macports these days). What happens if you specify a host of 127.0.0.1 in your database.yml file for the appropriate environments? That might convince Sphinx to connect via TCP instead of file sockets. (Also: are you really using the same database for both development and test environments?)

Categories : Ruby On Rails

LDAP can't bind to server after turn on LDAP Server Signing Requirements
try This Code I am using that code for my Local LDAP SERVER <?php $ldapconfig['host'] = 'localhost'; $ldapconfig['port'] = NULL; $ldapconfig['basedn'] = 'dc=test,dc=example,dc=com'; $ldapconfig['authrealm'] = 'Nisarg'; function ldap_authenticate() { global $ldapconfig; global $PHP_AUTH_USER; global $PHP_AUTH_PW; //$PHP_AUTH_USER = "john"; //$PHP_AUTH_PW = "esparkinfo"; $PHP_AUTH_USER = $_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW = $_SERVER['PHP_AUTH_PW']; if ($PHP_AUTH_USER != "" && $PHP_AUTH_PW != "") { $ds=@ldap_connect($ldapconfig['host'],$ldapconfig['port']); $r = @ldap_search( $ds, $ldapconfig['basedn'], 'uid=' . $PHP_AUTH_USER); if ($r) { $result = @ldap_get_entries( $ds, $r); if ($result[

Categories : PHP

DB's long-live connections or on-demand connections?
You don't say what database access library you are using (ODBC, ado.net, other?). Opening and closing database connections is a relatively expensive operation. You should be using some sort of connection pooling scheme in your db access framework. A pool of connections is opened for a period of time, and when your app opens a connection it will get handed an already open connection from a pool. That will make it more efficient. Go read about connection pooling for SQL Server

Categories : Sql Server

Android App force closes on connection refuse
What i want is "how to handle the exception to stop application from getting closed". Add a catch for this Exception try { // Make the HTTP GET request to the Basic Auth protected URL response = restTemplate.exchange(url, HttpMethod.GET, requestEntity, Object.class); return response; } catch (HttpClientErrorException e) { Log.e("Network Error ", e.getLocalizedMessage(), e); } catch (ConnectException e){ // do your logging or print a message } I don't know what order they need to be in so you may need to adjust that.

Categories : Android

check if data already exist in database and refuse
You code is a bit off your question. Anyways you need to use the functon mysql_num_rows to check how much record does your query returns. Example: $query = mysql_query("SELECT * FROM users WHERE username='dave'"); if(mysql_num_rows($query) > 0){ echo "this user already exists in the database!"; }

Categories : PHP

C# Winform Desktop icon refuse to change on a particular computer
I had the same issue on my computer. I believe it's caused by the icon cache in Windows. What I usely do is removing the icon, cleaning up the PC (with CCleaner), then, add the icon. Or you can just delete /Documents and Settings/<username>/Local Settings/Application Data/IconCache.db (Windows XP) or /Users/<username>/AppData/Local/IconCache.db (Windows 7).

Categories : C#

refuse ajax submit if fields are empty jquery
you need jQuery validate plugin , and ...... $(document).ready(function() { $('#formId').validate({ submitHandler:function(form) { $(form).ajaxSubmit({ success:function(response) { //do stuff on success }, dataType:'json' }); }, errorLabelContainer: "#error_message_box", wrapper: "li", rules: { name:"required", category:"required" }, messages: { name:"name required", category:"category required" } }); });

Categories : PHP

Why does the WebView html in my Mac app refuse to load JQuery or any external script?
I changed https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js to http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js and now it works. If anyone knows why WebView doesn't like https, let me know in the comments.

Categories : Javascript

Too many connections Error due to many sleep connections
A good solution for this is to put your connection into a function, then add a destructor to close the connection for you. That way the connection automatically closes the after the last time the mysql connection is called. class DbConn { public $connection; public function __construct($host, $name, $user, &$pass) { $this->connection = mysql_connect(mysql_connect($host, $user, $pass); if(mysql_connect_errno) { echo mysql_connect_error; } else { mysql_select_db($name, $this->connection); } unset($pass); //Clear password for security. } public function __destruct() { mysql_close($this->connection); } } That should take care of most open connections as they will close before the end o

Categories : PHP

Visual studio package manager console migrations refuse to use connection string
Okay so it seems that overnight my visual simply decided to stop listening to -ConnectionStringName Because when I go into the app.config and add the exact same connection string but with the name of my dbcontext it worked right away. so using custom connection string, simply stopped working.

Categories : Dotnet

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

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

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

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

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#

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

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 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

Add firewall rules to a vApp Network with PowerCli 5.1
I found the answer, here is is for anyone else who needs it. $vAppNet = Get-CIVAPP 111 | Get-CIVAppNetwork vApp_Network $vApp = Get-CIVAPP 111 $networkConfigSection = (Get-CIVapp 111).extensiondata.GetNetworkConfigSection() $vAppNetwork = $networkConfigSection.NetworkConfig | where {$_.networkName -eq "vApp_Network"} $fwService = New-Object vmware.vimautomation.cloud.views.firewallservice $fwService.DefaultAction = "drop" $fwService.LogDefaultAction = $false $fwService.IsEnabled = $true $fwService.FirewallRule = New-Object vmware.vimautomation.cloud.views.firewallrule $fwService.FirewallRule += New-Object vmware.vimautomation.cloud.views.firewallrule #First Rule $fwService.FirewallRule[0].isenabled = $true $fwService.FirewallRule[0].description = "Allow all outgoing traffic" $fwServic

Categories : Powershell

Jenkins Slave port number for firewall
We had a similar situation, but in our case Infosec agreed to allow any to 1, so we didnt had to fix the slave port, rather fixing the master to high level JNLP port 49187 worked ("Configure Global Security" -> "TCP port for JNLP slave agents"). TCP 49187 - Fixed jnlp port 8080 - jenkins http port Other ports needed to launch slave as a windows service TCP 135 139 445 UDP 137 138

Categories : Jenkins

Can't update/install using composer behind a corporate firewall
I confirm being able to clone/pull/push a GitHub repo behind a firewall. And you do need https_proxy in addition of http_proxy: set http_proxy=http://<login_internet>:<password_internet>@aproxy:aport set https_proxy=http://<login_internet>:<password_internet>@aproxy:aport set no_proxy=.company (the no_proxy part is there to avoid using the proxy for internal url, internal to the company)

Categories : PHP

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

Symfony2 lock full site with firewall
You need to add an catch-all firewall that requires authentication, like this: - { path: ^/, roles: ROLE_ACTIVE_USER } That will make all pages that aren't explicitely listed to be accessible without authentication (i.e. with IS_AUTHENTICATED_ANONYMOUSLY) inaccessible. However, since you didn't list your homepage yet, you'll need to add that too. - { path: ^/$, roles: IS_AUTHENTICATED_ANONYMOUSLY } Make sure to put it above the catch-all entry, as Symfony processes entries from top to bottom, and stops when it found a matching entry.

Categories : Security

Forward ssh protocol via ssh tunnel | corporate firewall
Disclaimer: If this kind of connection is allowed ask your security people to enable it for you. If it is not allowed and you nevertheless use some tunneling to circumvent the security concept of your company you will get a lot of trouble! Be warned. You already managed to get to your router. In this case I would use ProxyCommand ssh router nc -w1 %h %p in your .ssh/config. This will first open a ssh connection to you router and connect to the actual target host and then start the actual ssh connection. Also git should work with this kind of setup.

Categories : GIT

php can only access from local machine, it does not result from firewall
nginx is only listening to localhost server_name localhost; you need to change that to either server_name *; or server_name youraddress.com;

Categories : PHP

how to get syslog messages from Cisco firewall completely in delphi?
I am disappointed when one of when I called one of my friends and asked about this matter. he said better to not use Indy in delphi, because it is bugy. so I searched for the other components. there is an open source one. ICS(Internet Component Suite) which is working very well. you can get this open source for any delphi version or C++ Builder! see this : http://www.overbyte.be/ in product part select ICS and you can download the latest version. fortunately it has many component and it has TSysLogServer. it doesn't lose any packet of UDP. it is true that UDP doesn't guarantee no loss for packets. but when I see other programs like kiwi and wiresharks get the packets properly I should know that the source of the problem in my program is the component. so the answer for my question is:

Categories : Delphi

symfony 2 add roles in an event listener before firewall check
Ok. I have decided to create A Firewall listener to achieve this. I followed the tutorial http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html but only created the Firewall LIstener. The token and provider I am using the one that I was already using.

Categories : Security

How to communicate between internal Git repo behind firewall with external machine?
You can of course use git pull from external PC on Internal PC, e.g. via SSH. Or you can use the Upstream Repo to push to. Or you can open a port in the firewall to access internal PC. Which ports are open, btw?

Categories : GIT

Using Google App Engine to Initiate Messages to a Device Behind Firewall
Since the secure data connector is deprecated, your best option is to deploy a service that will proxy the incoming requests. You have a number of options like configuring your firewall and setup port forwarding or apache reverse proxy. If your internal addresses change, then that is also the place to deal with this. For instance, you could let the DHCP server trigger a configuration change in your apache reverse proxy.

Categories : Google App Engine



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