Line profiler is a 3rd party library available on GitHub.
Line profiler package helps in identifying the cause of CPU-bound problems in Python code.
Gives you a data driven approach on where to allocate your time in order to fix performance issues.
Understand the output of line_profiler by working through a simple code example.
Introduction
Python has established itself as a top tier programming language. As of late 2025 according to the TIOBE index, the top 3 languages as a measure of programming language popularity, are consistently Python, C, and C++, often with Python in the lead. This popularity and increase in use of Python has been driven by fields such as machine learning, artificial intelligence and data engineering. As these fields continue to grow and so does their use of Python, the performance of code matters more than ever.
A Merkle tree is a binary tree where the nodes stores hashes of data, rather than the data itself. The leaf nodes store hashes of the data and the parent nodes are the results of concatenating the left and right children and then applying a hash function on the result.
Server-Sent Events (SSE) technology is best explained by this article on MDN:
The EventSource interface is used to receive Server-Sent Events. It connects to a server over HTTP and receives events in text/event-stream format without closing the connection.
The connection is persistent and communication is one-way, from the server to the client, the client cannot push data to the server. This is unlike WebSockets where communication is bi-directional.
Some unique characteristics of SSE compared to WebSockets or long polling are:
Wireguard is a secure networking tunnel, it can be used for VPNs, connecting data centers together over the Internet, or any place where you need to connect two or more networks together in a secure way.
Wireguard is open source and it is designed to be much simpler to configure than other tools such as OpenVPN or IPSec.
Below, we are going to connect two computers together:
Machine A IP address 192.168.0.40
Machine B IP address 192.168.0.41
First, we need to install WireGuard on each machine:
If you need to access your PostgreSQL database from another machine, you need to edit the configuration, to make the database listen to incoming connections from other hosts. Below are the steps on how to do this.
Note: Do not do this on your production database environment, It will open up a potential security flaw. This should be fine to do on your staging environment for testing purposes.
On the machine running PostgreSQL, locate configuration file postgres.conf:
Recently I needed to upgrade the version of OpenVPN on my Raspberry Pi 3 Model B. Below are the steps needed to do this, here we upgrade to OpenVPN version 2.4.8.
$ cd /tmp
$ wget https://swupdate.openvpn.org/community/releases/openvpn-2.4.8.tar.gz
$ tar xf openvpn-2.4.8.tar.gz
$ cd openvpn-2.4.8/
$ sudo apt-get install libssl-dev
$ sudo apt-get install liblzo2-dev
$ sudo apt-get install libpam0g-dev
$ ./configure --prefix=/usr
$ sudo make
$ sudo make install
Recently I was using the python map-box api to generate static maps. I needed to
style the markers which pin pointed locations on the map. I found it difficult to
find the necessary documentation on how to do this. In the end it simply involved
adding the following fields:
maker-colour (hex value).
marker-symbol (Maki icon name. an integer, or a lowercase letter).
If you want to archive a directory (using the tar command), but not include the absolute path to the directory. You can use the -C option to the tar command, which essentially cd’s into the directory and then archives it. Here is an example:
$ tar czf /tmp/my_backup.tar.gz -C ~/home/coorp/my_files
When un-archived, the directory structure will be:
This is all well and good, but the output of the command can be hard to read if you have many directories in your path. What you want is a command that outputs the $PATH variable in an easier to read format. Luckily, this can accomplished with a little bit of bash code: