This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Setup the LDAP client (normally done via Spring context file). | |
| LdapContextSource contextSource = new LdapContextSource(); | |
| contextSource.setUrl("ldap://adserver.mycompany.com:3268"); | |
| contextSource.setBase("DC=AD,DC=MYCOMPANY,DC=COM"); | |
| contextSource.setUserDn("[email protected]"); | |
| contextSource.setPassword("password1"); | |
| contextSource.afterPropertiesSet(); | |
| LdapTemplate ldapTemplate = new LdapTemplate(contextSource); | |
| ldapTemplate.afterPropertiesSet(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //This sample is how to use websocket of Tomcat. | |
| package wsapp; | |
| import java.io.IOException; | |
| import java.nio.ByteBuffer; | |
| import java.nio.CharBuffer; | |
| import java.util.ArrayList; | |
| import org.apache.catalina.websocket.MessageInbound; | |
| import org.apache.catalina.websocket.StreamInbound; | |
| import org.apache.catalina.websocket.WebSocketServlet; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # | |
| # Video of this screencast: https://vimeo.com/57296525 | |
| # | |
| # | |
| from __future__ import print_function, division, absolute_import | |
| from PIL import Image as pImage | |
| import numpy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http { | |
| map $http_user_agent $limit_bots { | |
| default ''; | |
| ~*(google|bing|yandex|msnbot) $binary_remote_addr; | |
| } | |
| limit_req_zone $limit_bots zone=bots:10m rate=1r/m; | |
| server { |
NewerOlder