How long can I sit at a computer?
Computing has become literally a part of life. Computers and tablets - it’s impossible to imagine a single day when only a couple of minutes were spent in front of…

Continue reading →

Why you should never use a free VPN
Today virtual networks are very popular for solving personal security issues on the Internet - VPN. More and more people use them to circumvent network censorship in countries where there…

Continue reading →

Code optimization
In the process of writing code, it is impossible to detect all errors and correct them. Writing a code, especially in large volumes, is a monotonous thing, somewhat tedious and…

Continue reading →

Internet speed check (monthly statistics)

Checking the speed of the Internet is a fairly simple task if a single measurement is required. There are a ton of online tests on the Internet for this. But if the task is to measure the speed of the Internet connection within a month with a frequency of once per hour, in order to evaluate the quality of the service and use this data as an argument when communicating with the service provider, the task is somewhat more complicated.

About how I got out of this situation and received summary data for a month (the period and frequency can be any), read the article.

Checking the speed of the Internet should have been carried out constantly with equal frequency. Therefore, the use of a working computer was not suitable for this purpose, otherwise it would have to be kept on all the time. Therefore, I decided to connect an old computer based on the motherboard P4P800 SE to the local network. And put it in the pantry so that it doesn’t make much noise.

Since for today’s resource consumption the extremely modest power of this motherboard might not be enough, I had to install the very undemanding Slitaz Linux distribution on this computer. The benefit of using a separate PC to implement what was conceived in this matter is not very limited. The distribution with a graphical environment weighs only 40Mb and works on old hardware very fast. Checking the speed of the Internet is done through special software.

Checking internet connection speed using speedtest-cli script
Since Slitaz has a small set of built-in packages, I decided to use a script written in Python – speedtest-cli. Depending on which distribution (version) you will use, Python support may already be installed in it, or it will be absent and it will need to be installed. But these packages in the package manager will be anyway.

After checking (installing) Python support, you need to download a script for measuring Internet speed. In the distribution, we will only be interested in the file speedtest.py. This script uses the well-known online service Speedtest.net for verification. The measurement process is simple and consists of the following steps:

Running a control script at system startup.
Running the speedtest.py script with a control script with parameters.
Writing measurement results to a log file.
Re-running the script speedtest.py after the required period of time.
First of all, you need to write a control script that will command our main script using its parameters. I called it speed.sh. As you can see from the extension, this is a Shell script. There may also be no support for shell scripts in the distribution. But like Python support, it is installed from the package manager and does not constitute a problem.

The contents of speed.sh are as follows:

#! / bin / bash
# /home/admin/Desktop/Speed/speed.sh

sleep 30s

while [1 = 1]
do

date | tee -a /home/admin/Desktop/Speed/logfile.txt
/home/admin/Desktop/Speed/speedtest.py –simple | tee -a /home/admin/Desktop/Speed/logfile.txt
sleep 4h

done
In order not to be involved, if necessary, in searching for where everything lies and how it works, I placed the folder with scripts on the desktop in the Speed ​​directory. According to the help on GitHub, you need to solve the issue with the rights of scripts to run. The command is indicated there:

chmod + x speedtest-cli
Now the script will run without problems. The work of speed.sh starts with a wait of 30 seconds until the old PC loads the working environment in order to avoid possible problems when starting work. Next, the while loop starts. In the process of its execution, the date and time of the Internet speed measurement and the result of this measurement are recorded in the logfile.txt log file. Please note that I am addressing files from the / home user folder. It is important.

Then the script goes into standby mode for 4 hours and after this time is repeated. You can read the help for the sleep program and set your time interval for verification. The last question that needs to be resolved is autostart speed.sh when the system boots. About this below.

Internet speed measurement clearly
The Slitaz Linux distribution has a visual interface for managing autorun, so you will not need to create any new files for this. It will only be necessary to slightly correct the existing one. To do this, run the autorun control application. You can do this through the menu:

internet speed measurement

and in the configuration file that opens, make the following entry:
# Start Network speedtest
/home/admin/Desktop/Speed/speed.sh &
like this:

internet speed measurement

We save the configuration and reboot the PC. Immediately upon loading the PC, open the process manager and look: the process speed.sh should appear there – our control script. It starts immediately after the OpenBox graphical environment.

internet speed measurement

After 30 seconds, Python starts up and the speed measuring program runs. In this case, the log file at this moment should have a weight of 0 bytes, since it is empty. First, the date and time will be written to this file and its volume will increase. So you can indirectly monitor progress

Drivers & Firmware
Very often I come across a situation where I need to find and download drivers for various devices. Especially often this has to be done when repairing computers (reinstalling the…

...

Installing a cooler on a processor
Background to the experiment: CPU cooling (LGA775 socket) was provided by the CNPS7700-AICu cooling system. Intel Pentium D930 processor, was purchased in 2005. At that time, quite powerful and expensive.…

...

Capacitor Replacement
In the element base of the computer (and not only) there is one bottleneck - electrolytic capacitors. They contain electrolyte, electrolyte is a liquid. Therefore, heating such a capacitor leads…

...

Bat files, examples
You can perform all the examples published below not only by creating and running a BAT file containing these commands, but also copying them directly to the command line. To…

...