Introduction to Glances

There are many configurable widgets in Dashy, among which the most practical one is resource monitoring. Displaying CPU usage on the panel is not useful for me —— I am more concerned about which program is causing high CPU usage. However, the Glances software on which this feature depends is very practical.

Glances is similar to the top command, which can display system resource usage. However, it is better in the following aspects:

  • More comprehensive and user-friendly data display;
  • It can display the resource usage of each container —— in this respect, it surpasses Portainer. Portainer can only display the resource usage of one container in chart form.
  • It can run in server mode. We can monitor resource usage through a browser, which is very convenient.

image-20240408112645115

Glances is relatively lightweight, only displaying the current resource situation without recording historical data. And what I need is precisely this kind of lightweight yet comprehensive resource monitoring software.

Read more »

Preface

Dashy is an open-source customizable dashboard software that requires self-deployment. My use case is to place links of frequently visited websites. This post mainly documents some problems encountered during installation and usage.

Installation

Read more »

Preface

Recently, I’ve been using Python to write web crawlers for downloading manga (see previous posts on LANraragi). A typical page of a manga like this:

image-20240329132644183

All the data on this webpage can be retrieved using BeautifulSoup, and only one communication is needed per page. However, downloading images is different: each image requires a separate communication, and the response body is often quite large. Obviously, images don’t need to be downloaded sequentially, otherwise, it would waste a lot of time.

AIOHTTP is an asynchronous HTTP client/server module, which is very suitable for this scenario. Through asynchronous programming, it can maximize the performance of the network (and the server). This article focuses on introducing the basic usage of AIOHTTP, without going into details about how it works.

Read more »

Problem

Problem Source:889. Construct Binary Tree from Preorder and Postorder Traversal(Daily Challenge)

Problem Description

Given two integer arrays, preorder and postorder where preorder is the preorder traversal of a binary tree of distinct values and postorder is the postorder traversal of the same tree, reconstruct and return the binary tree.

If there exist multiple answers, you can return any of them.

Read more »
0%