Tag Archives: python

[python]DNS resolution webapp with flask

Very simple webapp, I still need to do some styling with CSS… this is a simple concept. here’s an example: The output will be: Here are the jinja2 templates: Here’s the code. Advertisements

Posted in Python, Scripting | Tagged , , | 2 Comments

[python] resolve a list of items from file

The list can be ip address, ip address range, ip subnet, firewall objects or hostname. The objective: If item is resolvable, resolve it and collect the ip address. If item is unresolvable, will collect it as it is. The list … Continue reading

Posted in Python, Scripting | Tagged , , | Leave a comment

[python]Resolve dns if hostname is resolvable else send as is

There are times which you need to try to resolve valid hostnames, however on user’s input there could be a possibility that the input contains ip addres, firewall objects or firewall object groups that are not resolvable. here’s a solution … Continue reading

Posted in Python, Scripting | Tagged , | Leave a comment

[python]Remove duplicates from a list

I have learned something interesting… removing duplicates in a list is actually quite easily achieved without using iteration… The output is self explanatory, you use set if you do not bother about the order, you use Ordereddict if you need … Continue reading

Posted in Python, Scripting | Tagged , , | Leave a comment

[python]List comprehension and map method

I want this output in string: [‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ’10’, ’11’, ’12’, ’13’, ’14’, ’15’, ’16’, ’17’, ’18’, ’19’, ’20’] Method one: List comprehension: Method two: Map method. map(function, iterable)

Posted in Python, Scripting | Tagged , , | Leave a comment

[python]Sending access request to Tufin SecureChange

Required improvements/Bugs IP address checking required, situation such as this 192.168.1.1/24. Dynamically update the action field, right now all request is assumed Accept. Dynamically update comment field on each access request, right now the script does not check comment Optimize … Continue reading

Posted in Python, Scripting | Tagged , , , , | Leave a comment

[python]Collecting values from xlsx

This script collects data from each column on each worksheet. The script has to be modified if used in real MS Excel. This is the result: Sheet 1 [‘192.168.1.1’, ‘10.1.1.1’] [‘10.1.1.1’, ‘192.168.1.100’] [‘tcp80’] Sheet 2 [‘1.1.1.1’] [‘2.2.2.2’] [‘Tcp80’]

Posted in Python, Scripting | Tagged , , | Leave a comment