[Python] – XML Validator against XML Schema (XSD)


This is the code:

from easyxsd import *
import sys

# Load XML Schema (.xsd file)
xsd = xsd_from_file(sys.argv[1])

# Load XML File
xml = xml_from_file(sys.argv[2])

# Validate
list_errors = validate_with_errors(xml, xsd)

# Open output file (validation response)
f = open(sys.argv[3],'w')

for error in list_errors:
    f.write(str(error) + '\n')


mime_exeDownload here an executable version for Windows

To execute:
validate_xml.exe C:\Documents\MyFolder\schema.xsd C:\Documents\MyFolder\myfile.xml C:\Documents\MyFolder\outputvalidate.txt

The shortcut works too:
validate_xml.exe schema.xsd myfile.xml outputvalidate.txt


Backup File Utility in Python [Tkinter application]

Hi readers,

This is a graphic software (tkinter) in Python to back up a file on your computer. A backup folder is created in the current directory of the selected file and then every x minutes a backup of the file is done, respecting the maximum number of files in the backup directory.





import hashlib, time, shutil, os, threading
from datetime import datetime
from Tkinter import Label, Spinbox, Listbox, Scrollbar, Tk, E, W, S, N, Button, Frame
import tkFileDialog
from os.path import expanduser
class App(Frame):
    def __init__(self, parent):
        Frame.__init__(self, parent)
        self.parent = parent
        # Class Variables
        self.directory_selected = ''
        self.filename_selected = ''
        self.backup_folder_name = 'backup'
        self.num_max_files = None
        self.time_for_backup = None
        self.full_file_path = ''
        self.backup_running = False
        self.hash = None
    def initUI(self):
        self.parent.title("Application to Backup a File")
        self.label_minutes = Label( text='Time for Backup (Minutes): ', height=2)
        self.spinbox_minutes = Spinbox( from_=1, to=100, width=5)
        self.spinbox_minutes.delete(0, 'end')
        self.label_numfiles = Label( text='Maximum number files in backup directory: ')
        self.spinbox_numfiles = Spinbox( from_=1, to=100, width=5)
        self.spinbox_numfiles.delete(0, 'end')
        self.scrollbar_loglist = Scrollbar()
        self.listbox_loglist = Listbox(yscrollcommand=self.scrollbar_loglist.set, width=70)
        self.button_file_choose = Button(text='Choose a file for backup ...', command=self.click_button_start_backup)
        self.button_stop_backup = Button(text='Stop Backup', command=self.click_button_stop_backup)
        self.button_stop_backup['state'] = 'disabled'
        self.button_exit = Button(text='Exit', command=self.click_button_exit)
        # Here the UI components are designed using grid layout
        self.label_minutes.grid(row=0, sticky=E)
        self.spinbox_minutes.grid(row=0, column=1, sticky=W)
        self.label_numfiles.grid(row=1, sticky=E)
        self.spinbox_numfiles.grid(row=1, column=1, sticky=W)
        self.listbox_loglist.grid(row=2, column=0, sticky=W+E+N+S, columnspan=3)
        self.scrollbar_loglist.grid(row=2, column=3, sticky=N+S)
        self.button_file_choose.grid(row=3, column=0)
        self.button_stop_backup.grid(row=3, column=1)
        self.button_exit.grid(row=3, column=2)
        # define options for opening or saving a file
        self.file_opt = options = {}
        options['initialdir'] = expanduser("~")
        options['parent'] = self
        options['title'] = 'Select a file for backup ...'
    def get_ask_open_file(self):
        return tkFileDialog.askopenfilename(**self.file_opt)
    def get_current_datetime(self):
        return datetime.strftime(datetime.now(), "%d%m%Y_%H%M%S")
    def get_current_datetime_formatted(self):
        return datetime.strftime(datetime.now(), "[%d/%m/%Y %H:%M:%S] - ")
    def log_action(self, msg):
        self.listbox_loglist.insert(0, self.get_current_datetime_formatted() + msg)
    def do_file_backup(self):
        curr_datetime = self.get_current_datetime()
        nom_arquivo = self.filename_selected.split('.')[0] + '_' + curr_datetime + '.' + self.filename_selected.split('.')[1]
        shutil.copyfile(self.full_file_path, self.directory_selected + os.sep + self.backup_folder_name + os.sep + nom_arquivo)
        self.log_action('Backup Done - ' + nom_arquivo)
    def get_file_hash_md5(self, file):
       md5 = hashlib.md5()
       with open(file, "rb") as f:
           for block in iter(lambda: f.read(128), ""):
       return md5.hexdigest()
    def listdir_fullpath(self, d):
        return [os.path.join(d, f) for f in os.listdir(d)]
    def delete_oldest_files(self):
        num_total_files_in_directory = len(self.listdir_fullpath(self.directory_selected + os.sep + self.backup_folder_name))
        num_files_to_be_removed = num_total_files_in_directory - self.num_max_files
        if num_files_to_be_removed > 0:
            self.log_action('Removing ' + str(num_files_to_be_removed) + ' old files')
        for i in range(num_files_to_be_removed):
            file_to_remove = self.get_oldest_file_from_directory(self.directory_selected + os.sep + self.backup_folder_name)
            self.log_action('An old file was removed - ' + file_to_remove.split(os.sep)[-1])
    def get_oldest_file_from_directory(self, dir):
        return min(self.listdir_fullpath(dir), key=os.path.getctime)
    def start_loop_backup_job(self):
        if not self.backup_running:
        if self.hash != self.get_file_hash_md5(self.full_file_path):
            self.log_action('The file was not changed since last check')
        self.hash = self.get_file_hash_md5(self.full_file_path)
        self.parent.after(self.time_for_backup * 1000 * 60, self.start_loop_backup_job)
    def click_button_start_backup(self):
        file_choosed = self.get_ask_open_file()
        if not os.path.isfile(file_choosed):
        self.log_action('Backup has been started')
        self.backup_running = True
        self.button_file_choose['state'] = 'disabled'
        self.button_stop_backup['state'] = 'normal'
        self.directory_selected = os.path.split(os.path.abspath(file_choosed))[0]
        self.filename_selected = os.path.split(os.path.abspath(file_choosed))[1]
        self.full_file_path = self.directory_selected + os.sep + self.filename_selected

        if not os.path.exists(self.directory_selected + os.sep + self.backup_folder_name):
            os.mkdir(self.directory_selected + os.sep + self.backup_folder_name)

        self.time_for_backup = int(self.spinbox_minutes.get())
        self.num_max_files = int(self.spinbox_numfiles.get())
        self.backup_running = True
    def click_button_stop_backup(self):
        self.button_file_choose['state'] = 'normal'
        self.button_stop_backup['state'] = 'disabled'
        self.log_action('Backup has been stopped')
        self.backup_running = False
    def click_button_exit(self):
def main():
    root = Tk()
    root.eval('tk::PlaceWindow %s center' % root.winfo_pathname(root.winfo_id()))
    app = App(root)
if __name__ == '__main__':

Implementation of Oracle SOA Middleware products in companies

Hi People, tonight i was invited by http://www.otechtalks.tv/ to participate of a Podcast Session, a community of specialists at Oracle World through the planet. I’m am very happy with this, thank you OTechTalks.

This is my presentation to them:


Title: Implementation of Oracle SOA Middleware products in companies

  • Where to start ?
  • What are the benefits ?
  • What are the difficulties ?
  • What needs to be modified ?
  • Really worth the change ?
benefits-sign-forweb change-in-business oracle_soasuite_logo images


This podcast is a reflection on the practical experience of implementing Oracle SOA Middleware products experienced by Victor Jabur (http://victorjabur.com) in some Brazilian companies. Let’s talk about the main difficulties, benefits, things that need to be modified to achieve success.

How you started journey with Oracle tech ?


I started my career at Oracle World in 2005 working as a developer in the Forms and Reports platform, using the PL / SQL language in a wholesale hypermarket company called Atacadão (http://www.atacadao.com.br/), later worked in a database integration project, joining two banks, REAL and Unibanco. working for TCS (http://www.tcs.com/). In 2007, I had my first experience of implementing Oracle SOA Products at the company Sem Parar (https://www.semparar.com.br), a pioneer in electronic billing passages in Brazilian toll through RFID tags in windshields of vehicles, with 12.5 million transactions a month and a turnover 1.68 billion reals in the same year. With experience acquired, I started to work in the SOA implementation of many companies, such as Fleury (http://www.fleury.com.br), a Laboratory Medicine company, Edson Queiroz (http://www.edsonqueiroz.com.br) a famous multi-brand group, WTorre (http://www.wtorre.com.br), a construction company, Port of Santos (http://www.portodesantos.com.br), development of a control system access for the main Brazilian port, Porto Seguro (http://www.portoseguro.com.br), vehicle insurance company, among other companies. Currently working as a Solutions Architect at Pernambucanas (http://www.pernambucanas.com.br), the famous Brazilian Retail company where many Oracle products are used, and the main ongoing project is the implementation of Oracle Retail, coexisting with the Legacy in Forms and Reports and communicating with other modules like EBS, BI, CRM, Government Systems, External Partners, and so on. SOA is being implemented too, along with mobile and big data initiatives, being considered one of the most innovative companies in 2014 (http://itforum365.com.br/noticias/detalhe/114416/correios-lideram-ranking-de-as-100-inovadoras-no-uso-de-ti), even with the age of 107 years old.

Brief topic of the day

DataOrProcess graphic039 Businessman looking at Innovation plan. Business background

For many years the Oracle sold in the market your product to Graphic User Interface development, launched in 1981 under the name Interactive Application Facility (IAF), changing its name to FastForms + IAG, becomes later SQL * Forms and more later Oracle Forms. Currently, Oracle is replacing the Forms for ADF technology (Advanced Development Framework), a new way of doing Screens in Java Language. Over all these years, many companies in Brazil and the world have used this tool, All the resources that was available were the database, PL / SQL, Forms/Reports and thus the entire business rules at the company were stored in the database through procedures or directly inside the Forms screens file. The world has evolved, competitiveness is much higher and companies need to be agile to keep up your market. You need to be close to the business, by changing its rules, making partnerships with other companies. The legacy left by Forms with all the business rule on the developer’s hand is not very good for the company, the business analyst does not know very well what rules are deployed, it is not easy nor quick for change them.

Fortunately Oracle followed the evolution acquiring partner companies, evolving their products and many of them focused in the business, implementing visual business flow (Business Process Execution Language – BPEL), business rules tools arrived, isolating business rules of the source code, making it very easy and fast editing. It’s not necessary implement your screen functions from scratch, a new paradigm emerged service-oriented-architecture (SOA), where there is a service bus that (Oracle Service Bus – OSB) exposes the enterprise service catalog and then, service is reused, saving up money with development, making it easy to maintain, starting new projects more easily, because with the reuse many things are ready when we need to build a new software in the enterprise. Partner companies could not communicate in the past because of the use of different programing languages and this is possible ​now by using WebServices over the internet, through the universal language called XML (Extensible Markup Language), new partnerships can be stablished, systems can be integrated and business leveraged. Manual processes made in the past by paper, email, phone calls, spreadsheets, tickets and text messages can now be computerized through the BPM (Business Process Management), the audit trail of approvals, analysis and comments are permanently saved, the information is protected, digitalizing process is saving the paper quantity used in times where the planet claims for help. Many governments have adopted processes digitalizing solutions, there is a product called Oracle UCM (Universal Content Management) that stores documents, even confidential, digitally signed with personal digital certificates, reducing fraud of manual signatures. Customers with mobile phones always is communicating with the companies: using the service channel to pay their bills, to buy products, ask for some support or share information. Smart shopping recommendation systems send messages to customers, encouraging them to buy. Really new times came, the technology has evolved, things are faster and who’s out of this process lose customers to the competitioners.

Said that, it is natural that many companies will want to apply these concepts, but where to start ? An important recomendation is that SOA is a concept, not a suite of tools that you can buy, install and all will be ok. Many companies are failing for not paying attention at this point. A cultural change is necessary, business leaders should take the lead and map very well their business processes, modelling the entities of your company, XML schemas known as Canonical Model, the developer no longer owns the business rules in the company, a renewal is required, the staff in many cases need to be replaced by others, with a more appropriated skills, if the company does not have an architecture team, this is a good start, create a team that advise the business people on how to things work, designing simple solutions to resolve complex problems. Oracle offers an excellent product, known as Soa Suite, a complete tool, with many effective resources, but alone it is not possible to cause any change at the company.

This work can start in a incremental way, with a little pilot of an important flow for the company and when the benefits have been demonstrated, the adoption can be increased for other projects of the company. You can start with the design of the business flows, modeling the corporate entities, electing candidates to become services, which in fact are reusable and increases value to the company, the business rules are created in the appropriated tool, then the previously flows designed can be implementated using BPEL languange for example, manual processes can be implemented in BPM, sensors measuring the business flows are installed, generating real time dashboards for business team, enabling them to act proactively to achieve the goals, for example, if the sale is not good and dashboards are indicating the bad scenario, promotions can be launched, actions are taken to encourage the sale in the shop and the situation can be reverted, as opposed to look at sales reports at end of the day or month and to check that the goal was not reached, proactivity is the keyword. Another common difficulty is that the SOA suite ships with many products (BPEL, BPM, OSB, BAM, ADF), people get lost, do not know what is the role of each product, implementing more things that should on a specific product. Here’s a tip on what and how to implement each module:

  • OSB: It should contain generic, reusable web services without any business rule, only routing and enrichment of messages.
  • BPEL: Light business flows, more complex rules must be implemented in any programming language and should be exposed as a service for a bpel flow orchestration, this flow represent the business, and not contain details of development implementation.
  • BPM: It must contain only the manual business flow, without business rules, it must rely on previously services made, almost never access directly the database, generally require notification services, whether e-mail, sms, social networking and others.
  • BAM: Monitoring Dashboards cannot cause overhead on the transactional database to generate the graphics, the necessary information should be used as an asynchronous messaging, sensors embedded in bpels or a replicated database to make the queries.
  • ADF: Framework that will replace Forms in the near future, screens are written in Java using Java Server Faces (JSF), all new Oracle products are already made using adf, enterprise manager for example. In BPM Suite, adf is widely used, because the screens are automatically generated in this product.

What is gained by doing this all worth it ?


The advantages are an I.T. department that speaks the language of business, saving money through reuse, automating manual processes that before were exposed to errors, agility for the company, fast changing their business rules reaching the necessary time to market, flexibility and high availability for all of these products work in auto scalable clusters ensuring maximum stability to the customer, ease of communication with external partners, security in communication and many other benefits.

What is needed to do this ?

A financial investment for the acquisition of software and hardware needed
Be aware that a culturally change is required in the company.
Relocate, demit, requalify and hire new people.
Rely on the expertise of qualified professionals to advise the company.
Breaking paradigms and accepting some risks.

What do you feel makes Oracle Users community special ?

Oracle is a large company present in many countries and special in this community is just it. The interaction with many cultures, and learning technology, you gain life experience.


If you could magically suggest all of your Oracle community members one thing in this world, what would it be, and why ?

I suggest that community members to create a personal blog, because of it i was invited to this podcast, invited to be a become a tecnical review of a book about Oracle ADF in last year and i often known people that come in at my blog of other countries. I feel very good about being helpful to people around the world.

For someone new to Oracle , how do they get the most out of it ? or how they should start a career in Oracle Middleware ?

There are many books about many products of Oracle Technology, mainly mostly books from Packt Publishing who is doing an excellent job around the world launching many books, written by members of the Oracle community around the world. For more senior people i recommend that they open schools and courses that offer Oracle Technology, my work friend try this here at Brazil (http://www.soaexpert.com.br/ and http://www.sciensa.com/) and it is success, training many people that offer more quality work for the Brazilian companies.

Thank you to OTechTalks to invite me for this Podcast Session. It was a pleasure to share my knowledge with the world, i am very happy with this.


Victor Jabur

Python – Unique Collection Class – HashCode and Equals – (Like Java Set)

Hi readers,

I will demonstrate in this post as we do in Python to have a collection of single objects (Set), implementing the standard methods key, hashcode and equals, so that the objects are not repeated.

class MyCustomClass:
    def __init__(self, at1, at2, at3):
        self.at1 = at1
        self.at2 = at2
        self.at3 = at3
    def __key(self):
        return (self.at2)
    def __eq__(x, y):
        return x.__key() == y.__key()
    def __hash__(self):
        return hash(self.__key())

my_object_1 = MyCustomClass('1', '2', '3')
my_object_2 = MyCustomClass('4', '5', '6')
my_object_3 = MyCustomClass('7', '8', '9')
my_object_2_dup = MyCustomClass('4', '5', '6')

set_collection = set()


for object in set_collection:
    print object.at2

The output of this script is:

Note that i added 4 objects, but only three is added because the second attribute is the Key.

See You,
Victor Jabur

Spring Batch Partitioner – Case Study with SourceCode – Best Practices

I’m writing this post because i report a bug at Spring Community Jira, this is the link:


I started a sample project which could reproduce the problem to show the community what I was experiencing, but to my surprise I was using the partitioner feature incorrectly. I am writing this post to share what I learned throughout this experience to help those who are going through the same questions.

My Goal: I wanted to use the resource partitioner for parallel processing but was worried to use the primary key of the table (column ID) because my table has gaps (id column is not incremental) and for this reason the partitioner would distribute number of different records for each thread, thus being inefficient in their distribution.

For example:

This is the good example partitioner:


Suppose that my table has the following records: Ids 1, 8, 9,10 11, 12, 13, 14, 15.

min: 1

max: 15

gridSize = number of threads = 2 in this example

target size calculation: int targetSize = (max min) / gridSize + 1;

(15 – 1) / 2 + 1 = 8

In this example:

Thread number 1 will receive to process: 1 to 8

Thread number 2 will receive to process: 9 to 16

The Problem: Thread 1 receives only two records to process (The Id’s 1 and 8) and the thread 2 will receive 7 records to process. At this case the partitioner to split incorrectly number of records between threads.

My Goal: I want to split the number of records equally between all threads.

Where I was going wrong: To achieve my goal I tried to use a query that makes use of rownum and / or ntile oracle feature, the goal was to use the split an id that is sequential, with no gaps in the id column table, so the load would be uniform among the threads. The JdbcPagingItemReader class can not be used with multithreaded characteristics using Oracle ROWNUM because the query is partially executed multiple times in the database and there is no guarantee that all records are processed because a confusion of Ids between threads occurs.

 The correct way: You can use JdbcPagingItemReader using the Primary Key column (may be single or multiple columns) or JdbcCursorItemReader can use both the PK column or  Rownum / NTILE to do division.

Why use JdbcCursorItemReader not cause problems of mistaken IDs or lost records ?

This class executes the query once the database and will use chunk mode to fetch the records as needed. If you use a rownum column in this case will not cause data loss because every query is processed only once in the database.

To illustrate and facilitate understanding, I created a design example set with various possible configurations available here:


GitHub Example Project:


Here are the sql scripts to create the database tables used in this poc:


  1. JdbcCursorItemReader-OracleNtile – It works
  2. JdbcCursorItemReader-OracleRownum – It works
  3. JdbcPagingItemReader-OracleNtile – It not works, don’t use this. PagingReader does not work with NTile
  4. JdbcPagingItemReader-OracleRownum – It not works, don’t use this. PagingReader does not work with Rownum
  5. JdbcPagingItemReader-TablePrimaryKey – It works, but the records aren’t distributed in an uniform way (same quantity for each thread)

What is Oracle NTile ?
This feature of Oracle Database can create a desired number of containers so that each thread can consume one. For example: I have 1000 records in the database to be divided among 10 threads:


With this query, you can use the column “CONTAINER_COLUMN”, values are already pre split into buckets ready to be divided among the various threads.

This is the documentation with more clarified explanation:


That’s it.

Any question or suggestion is very welcome.

Credits to this post:


Victor Jabur

How to consume a WebService that uses Ws-Security Authentication (UsernameToken) – OWSM – Oracle Service Bus (OSB)


The Oracle Service Bus (OSB) allows to enable OWSM authentication, there is many policies that can be applied to the Proxy Service to turn on security authentication. The most basic of this policies is:

oracle / wss_username_token_service_policy

Requiring only a username and password. Once enabled this security, following a tip on how to make a request using a Java Client.

File: MainPost.java – This is a main class to make a request

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;

import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.handler.Handler;

public class MainPost {

	public static void main(String[] args) {

		try {

			MyService service = new MyService();
			MyServicePort myServicePort = service.getMySoapPort();

			// This is the block that apply the Ws Security to the request
			BindingProvider bindingProvider = (BindingProvider) myServicePort;
			List<Handler> handlerChain = new ArrayList<Handler>();
			handlerChain.add(new WSSecurityHeaderSOAPHandler("myUsername", "myPassword"));

			RequestType myRequest = new RequestType();

			ResponseType response = myServicePort.searchSomething(myRequest);

		} catch (Exception e) {

File: WSSecurityHeaderSOAPHandler.java – This is a handler responsible for creating the header authentication.

import java.util.Set;

import javax.xml.namespace.QName;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPHeader;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;

public class WSSecurityHeaderSOAPHandler implements SOAPHandler<SOAPMessageContext> {

 private static final String SOAP_ELEMENT_PASSWORD = "Password";
 private static final String SOAP_ELEMENT_USERNAME = "Username";
 private static final String SOAP_ELEMENT_USERNAME_TOKEN = "UsernameToken";
 private static final String SOAP_ELEMENT_SECURITY = "Security";
 private static final String NAMESPACE_SECURITY = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
 private static final String PREFIX_SECURITY = "wsse";

 private String usernameText;
 private String passwordText;

 public WSSecurityHeaderSOAPHandler(String usernameText, String passwordText) {
 this.usernameText = usernameText;
 this.passwordText = passwordText;

 public boolean handleMessage(SOAPMessageContext soapMessageContext) {

 Boolean outboundProperty = (Boolean) soapMessageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);

 if (outboundProperty.booleanValue()) {

 try {
 SOAPEnvelope soapEnvelope = soapMessageContext.getMessage().getSOAPPart().getEnvelope();

 SOAPHeader header = soapEnvelope.getHeader();
 if (header == null) {
 header = soapEnvelope.addHeader();

 SOAPElement soapElementSecurityHeader = header.addChildElement(SOAP_ELEMENT_SECURITY, PREFIX_SECURITY,

 SOAPElement soapElementUsernameToken = soapElementSecurityHeader.addChildElement(SOAP_ELEMENT_USERNAME_TOKEN, PREFIX_SECURITY);
 SOAPElement soapElementUsername = soapElementUsernameToken.addChildElement(SOAP_ELEMENT_USERNAME, PREFIX_SECURITY);

 SOAPElement soapElementPassword = soapElementUsernameToken.addChildElement(SOAP_ELEMENT_PASSWORD, PREFIX_SECURITY);

 } catch (Exception e) {
 throw new RuntimeException("Error on wsSecurityHandler: " + e.getMessage());


 return true;

 public void close(MessageContext context) {
 // TODO Auto-generated method stub

 public boolean handleFault(SOAPMessageContext context) {
 // TODO Auto-generated method stub
 return true;

 public Set<QName> getHeaders() {
 // TODO Auto-generated method stub
 return null;

Xml Request: This is the payload request that Java Client request to the server.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
 <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
 <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">myPassword</wsse:Password>

Liberando Apache na porta 80 – Net Virtua – Modem Arris TG862 Bridge com TPLink

Oi Galera,

Utilizo Net Virtua aqui em casa e tive alguma dificuldade para disponibilizar um Apache na porta 80 exposto para a internet aberta e decidi escrever este post para ajudar a galera que tiver este mesmo problema no futuro. Seguem algumas considerações:

  • A Net não bloqueia a porta 80, vi muitos blogs, sites e até gente processando a Net no Reclame Aqui por bloquear as portas em sua internet doméstica, alegando que a operadora agia de má fé para vender sua internet com Ip Fixo.
  • Estou utilizando o modem da empresa Arris, modelo TG862 fornecido pela Net para os seus assinantes.
  • Decidi utilizar este modem no modo Bridge pois achei que sua console administrativa não tinha muitos recursos e o seu sinal de wireless é muito ruim por não ter antena.
  • Este aparelho da Arris TG862 faz o papel de modem e roteador, quando escolho trabalhar com ele no modo bridge estou desligando o papel de roteador dele e repassando para o roteador TP LINK desempenhar o papel de roteador.
  • É importante ligar o TP Link na porta número 1 do modem Arris.

Bom, dito algumas coisas vamos começar com a montagem do ambiente:

  1. Um fio de rede deve sair da porta número 1 do modem e ser ligado na porta WAN do roteador TP Link.
  2. É recomendável que todos os cabos de rede (televisão, computador e etc.) que estavam conectados no modem sejam ligados apenas o TP Link.
  3. Acessar a console administrativa do modem Arris no link
  4. O usuário padrão é “admin” e a senha padrão é “password”
  5. Clique na aba firewall
  6. Na aba Firewall, desative o firewall, desative as opções Block Pings e DoS Attack Protection, após todos este procedimentos clique no botão Apply que aparece no final da página.
  7. Na aba Wireless Setup é recomendável desligar o wireless para que apenas o do TP Link esteja ativo.
  8. Na aba Lan Setup, altere a propriedade NAT Mode para Bridged.
  9. fig1
  10. Ele pede um restart do modem para aplicar as configurações feitas.
  11. Entre no menu Utilities e faça um restart.
  12. Um comportamento muito esquisito é que após trocar para o modo bridge não consegui mais logar na console administrativa, ele fala que a senha é inválida, bom, mas também não precisamos mais dela.
  13. No modem é só isso.
  14. Agora vamos fazer algumas configurações no TP Link.
  15. Acessar a console administrativa dele:
  16. Usuário “admin” e senha “admin”
  17. Entrar no menu DHCP -> Address Reservation
  18. fig2
  19. Este passo é importante pois você vincula o seu Mac Address (Endereço físico da placa de rede) com um número de Ip qualquer que você escolhe. Para saber qual é o mac address do seu computador digite: “ipconfig /all” em um command do DOS. Cuidado, pois as vezes seu computador tem várias placas de rede, escolha a correta.
  20. Próximo passo entrar no menu Forwarding -> Virtual Servers
  21. fig3
  22. Neste ponto acima, você diz qual é a porta do seu computador que você quer expor para a internet, no caso a 80 que é a porta do meu apache. Deve-se colocar também o ip do computador onde o apache está instalado.
  23. Próximo passo Forwarding -> Port Triggers
  24. fig4
  25. Em cima você vincula a porta que o usuário digita na internet  com a porta do seu computador. Se eu quisesse que os usuários digitassem http://meuipexterno:12000/meusite para acessar o meu apache na porta 80, teria que alterar o Incoming Port para 12000
  26. Pronto, todas as configurações feitas no TP Link.
  27. A última coisa a ser feita é liberar a porta 80 no seu windows, adicionando uma regra de firewall.
  28. Na barra do windows digite: Firewall do windows com Segurança Avançada
  29. fig5
  30. Pronto, você já pode acessar o seu site hospedado no seu computador de qualquer lugar da internet
  31. Qualquer dúvida entrem em contato.
  32. Até Mais Pessoal.