Download file with requests To download the file from web with requests module is the easiest, you just need to turn on stream while using get method. Then download the file chunk by chunk by using the iter_content method. Here is the example code on how to download file with requests. import requests from pathlib … Continue reading [python]Download file and use tqdm for progress bar.
I have a dev server which is running with http, however to minimise the need to change the code, I want to write a function to check. Here's an example:
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
Introduction I am using hashicorp vault to store secrets of devices, and I am writing my own functions in python for my personal usage. There is a hashicorp vault api wrapper module known as hvac, at first I attempted to use hvac but I found it to be extremely difficult to use and not enough … Continue reading [python]Usage examples of pyvault2
Background You have a VPN service running, but not sure if it is the VPN address or your real public address (supplied by your ISP of course), so you want to find out what is your public address and the locality of the address. Here is the code snippet.. actually to make it more fanciful … Continue reading [python]what is my ip address