Tag: Python
Unix : Shell script that performs log file analysis : Find the top 5 IP addresses
In this article we will explain a script will analyze an Apache web server’s access log file to find the…
Unix : Shell script that monitors the system’s CPU usage and free memory
Here we will discuss on a shell script that monitors the system’s CPU usage and free memory, and issues a…
Shell : Optimizes PNG images in a directory using optipng
Example of a shell script that scans a given directory, finds any PNG images, and optimizes them using a tool…
Shell : Bash shell script that will recursively traverse and replace the file or extension
Here’s a simple Bash shell script that will recursively traverse through the directory it’s run in and rename all .jpg…
Python : Generate Random 500 number between 101, 999 and exclude prime numbers from it
Here’s a Python code snippet that generates a list of 500 random numbers between 11 and 99: import random random_numbers…
Python : The Vital Role of Data Visualization and Top Python Libraries for Effective Visualization
Data visualization plays a pivotal role in the era of big data, enabling businesses to understand complex datasets and extract…
Python : How to recover python code from .pyc file
Recovering the exact Python source code from a compiled .pyc file is not straightforward. The .pyc file contains the bytecode…
Python : How to bind a function to an instance of a class in Python
from types import MethodType In Python, MethodType from the types module allows you to bind a function to an instance…
Python : set object is not subscriptable – Resolved
The “set object is not subscriptable” error occurs when you try to access a set element using indexing or slicing,…
Python : How to split a list into batch of specific number in python
Here I have a list of 5500 elements , I want to split in to batches of 1000. You can use…