Category Archives: Scripting

[python]Using cx_Oracle module

This is a try out for using cx_Oracle module maintained by Oracle. The version I am trying is version 12.2 Here’s the same code: The above is a test out code, to test on how to connect to the oracle … Continue reading

Posted in Database, Python | Tagged | Leave a comment

[python]Trying out AWS SDK

I got myself a free basic account to do some hands on try outs. It is not necessary to use the AWS SDK to invoke the API. This try out is to write a simple static script to create a … Continue reading

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

[python]Comparing missing ip addresses between original inventory with object group

An inventory list is kept to record hostnames and ip addresses, this inventory list (inventory.xlsx) is currently maintained by automation. For every virtual machine created, the hostname and its corresponding ip address are recorded in the list, automation will update … Continue reading

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

[python]Excluding ip addresses belonging a subnet

suppose if you need to enumerate ip addresses from a list, but want to exclude ip addresses belonging to a subnet here’s a solution which you can do with netaddr module. Supposed ip_from_inventory is the list of ip addresses you … Continue reading

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

[python]Writing to temporary file

Supposed you have collected a list item known as ip_collections, and you want to write the list to a temp file. Need to convert the string in byte, the tf.seek(0) is to re-wind the pointer back to the start of … Continue reading

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

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

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