[python]Hand made cryptography with XOR method.

ord function is to convert a character to its equivalent integer representation. chr function is to convert the integer to its character representation. random.choice() method randomly picks a character from a series of characters to form a string of N length, this is the key for encryption and decryption. A message is taken from user's … Continue reading [python]Hand made cryptography with XOR method.


I do not like to write a python cli that accepts argument as I am an advocate of using wizard style to guide user on how to configure things easily. But it seems the time has come for me to write a CLI script in python, and in order to provide usage guide and data … Continue reading [python]Argparser

[python] Improving get_project_dirs method of SSHClient subclass

I noticed I did not have enough testing on my code for getting directories under base project directory. This is part of the code snippet of my SSHClient subclass: The problem The method gets all things under the base directory that is files and directories, that is because I have sliced and diced too much … Continue reading [python] Improving get_project_dirs method of SSHClient subclass

[python]Dissecting AggregatedResult

I felt it is worth to take some of my sleeping time to document how to dissect AggregatedResult object after a nornir task is executed. napalm_get with getters=["config"] This are my user inputs: example: After nornir task is executed an AggregatedResult object which looks like below: AggregatedResult is a dictionary like object, in this example … Continue reading [python]Dissecting AggregatedResult

[python]Cisco FMC REST API example – GET Server version and add device to Cisco FMC

Introduction The version used for this lab is Cisco FMC 6.4.0, and Cisco FTD used is 6.3.0. To access the Cisco FMC REST API, you need to ensure it is enabled. You can test it by going to https:///api/api-explorer if you can see the swagger like documentation then the REST API is enabled, you can … Continue reading [python]Cisco FMC REST API example – GET Server version and add device to Cisco FMC

[python]Download videos from youtube with pytube

Introduction I am finding a windows application which can use to download youtube videos like downie, I found out a python module known as pytube3 that can be used for this purpose. Basic usage So for my own purpose I download some videos which I need to listen while exercising, below is the code to … Continue reading [python]Download videos from youtube with pytube