Pull to refresh
74.33

*nix *

A hub abot UNIX like OSs

Show first
Rating limit
Level of difficulty

Memory consumption of .NET applications on Linux

Level of difficulty Medium
Reading time 12 min
Views 5.2K

In this article, I will cover the memory consumption of .NET applications on Linux. Firstly, we will try to understand the idea of virtual memory. Then, we will examine the memory statistics that Linux provides, such as RSS (Resident Set Size), VmData, RES (Resident Memory Size), and SWAP. Following that, we will delve into specifics related to the .NET.

Read more
Total votes 3: ↑3 and ↓0 +3
Comments 0

Writing an interpreter (virtual machine) for a simple byte-code + JIT compilation

Level of difficulty Medium
Reading time 10 min
Views 1.2K

There are two articles on Russian, the author of which writes a virtual machine (interpreter) for executing a simple bytecode and then applies different optimizations to make this virtual machine faster. Besides that, there is a compiler of a simple C-like language into this bytecode. After reading this article and getting familiar with the compiler, I thought that it would be interesting to try writing a virtual machine for this language that would be able to apply JIT-compilation to this bytecode with the libjit library. This article describes the experience of doing that.

I found several articles online that describe the usage of this library, but those that I saw, describe the compilation of concrete programs with libjit, while I was interested in compiling arbitrary bytecode. For people interested in further reading, there is an official titorial, a series of articles and a series of comparisons (in Russian).

The implementation was done in C++ because we aren`t playing games here. All my code is in my repository. The "main" branch has just the interpreter of the PigletVM bytecode; "labels-with-fallbacks" has a partial JIT compilation implementation (that doesn`t support JUMP instructions), "full-jit" has fully working JIT-compilationl; "making-jit-code-faster" makes code generated by JIT work faster and "universal-base-vm*" branches merge the interpreter and JIT-compilation implementations, by implementing a base generalised executor, which can be used for different implementations of PigletVM (both the interpreter and libjit compilation)

Read more
Total votes 3: ↑3 and ↓0 +3
Comments 10

Making Java 8 aware of Let's Encrypt root certificate

Level of difficulty Easy
Reading time 3 min
Views 1.1K

When using older version of Java with not updated truststore, you may face an error while connecting to web hosts, that Java is unable to find a valid certification path to the requested target.

This happens because JRE truststore is unaware of the new root certificate that is being used by Let's Encrypt nowadays. Below I tried to clarify detail behind this issue and how to solve it. I hope newcomers might find this material helpful.

Read more
Rating 0
Comments 5

Wi-Fi internet radio from a router with station switching capability

Level of difficulty Medium
Reading time 8 min
Views 1.3K
Wi-Fi интернет-радиоприёмник.
ChatGPT was not used in writing this article.
The animated image uses the webp file format instead of gif.
In this article, you will find a complete description of how to make a Wi-Fi internet radio receiver from a router that can play mp3 streams from internet radio stations.
It is also possible to switch between two internet radio stations. We will use OpenWRT firmware installed on the router to create a Wi-Fi internet radio. It is possible to complete this project without using a soldering iron. All the components can be placed inside the router to create a finished device — a Wi-Fi internet radio.
To make this, you will need:
Read more →
Total votes 4: ↑4 and ↓0 +4
Comments 1

Wie ich ein einfaches Monitoring von Kanälen mit Benachrichtigungen an Slack ohne Erfahrung gemacht habe

Level of difficulty Easy
Reading time 3 min
Views 536

Arbeiten im technischen Support brachte zusätzlich zu allen Aufgaben die Pflicht mit sich, die Kommunikationskanäle zu überwachen. Dies wurde über den Grafana-Dienst realisiert, der die erforderlichen Metriken aus Zabbix bezog. Da die Art der Arbeit jedoch bedeutete, dass man nicht immer an seinem Arbeitsplatz sitzt, kam mir die Idee, dies ein wenig zu automatisieren und Benachrichtigungen auf das Telefon oder zum Beispiel in einen Messenger zu erhalten, falls ein Kommunikationskanal ausfällt. Allerdings hatte ich keinen Zugriff auf das Zabbix-System und auch keinen erweiterten Zugriff auf Grafana.

Read more
Total votes 5: ↑5 and ↓0 +5
Comments 0

gookit/goutil — released v0.6.10, an extension library of common Go features

Level of difficulty Medium
Reading time 5 min
Views 693

gookit/goutil An extended library of Go's common functionality. Contains: number, string, slice/array, Map, struct, reflection, text, file, error, time and date, test, CLI, command run, system information, formatting, common information acquisition, etc.

Read more
Total votes 1: ↑1 and ↓0 +1
Comments 0

Exploring a possible implementation of non-blocking IO by writing a server on pure syscalls

Reading time 11 min
Views 2.1K

How do people usually write a server if they don't really care about performance? A program starts, then starts accepting incoming connections from clients and starts a new thread for each client, which is engaged in servicing this client. If you use framework, like Spring or Flask or Poco there, then it does something like this inside itself - the only difference is the threads can be reused, that is, taken from a certain pool. It's all quite convenient, but not too effective (and Spring is bad). Most likely, your threads serving clients do not live long and most of the time they are waiting either to receive data from the client or to send it to the client - that is, they are waiting for some system calls to return. Creating an OS thread is quite an expensive operation, as is context switching between OS threads. If you want to be able to serve a lot of customers efficiently, you need to come up with something else. For example, callbacks, but they are pretty inconvenient (though there are different opinions on this).

Another option is to use non-blocking I/O in combination with some kind of implementation of user-space threads (fibers). In this article I will show you how to write all this with your own hands.

Read more
Total votes 1: ↑1 and ↓0 +1
Comments 2

Make first deb-src package by example cri-o

Reading time 9 min
Views 1.9K


Overview


Once every true-linux engineer gets a trouble: there is no any software in his distro or it's built without needed options. I am keen on the phrase: "Only source control gives you freedom".


Of course, you can build this software on your computer without any src-packages, directly (with simplification: configure, make, make install). But it's a non-reproducible solution, also hard for distribution.


The better way is to make distro-aligned package that can be built if needed and that produces lightly distributed binary-packages. It's about debian-source packages(debian,ubuntu,etc), pkgbuild (for arch), ebuild for gentoo, src-rpm for red hat-based, and many others.


I will use cri-o like a specimen.


Before reading the text below I strongly recommend to get familiarized with the official Debian policy manual placed here and debhelper manpage.


Also you will be required to setup some variables like DEBMAIL and DEBFULLNAME for proper data in changelog and other places.

Read more →
Total votes 1: ↑1 and ↓0 +1
Comments 2

An Antidote to Absent-Mindedness, or How I Gained Access to an OpenShift Node without an SSH Key

Reading time 6 min
Views 5.2K

Typically when a Node falls out of the OpenShift cluster, this is resolved by simply restarting the offending element. What should you do, however, if you’ve forgotten the SSH key or left it in the office? You can attempt to restore access by using your wit and knowledge of Linux commands. Renat Garaev, lead developer at Innotech, described how he found the solution for this riddle and what was the outcome.

Read more
Rating 0
Comments 0

Introducing into calamares bootloader

Reading time 13 min
Views 4.5K


Overview


Sometimes all of us need to make a graphical installer for one's own linux distro. It goes without saying that you are able to use a distro-specific installer like Anaconda for RedHat-based or DebianInstaller for debian-based. On the other hand Calamares is a graphical installer which is not aligned with only one package manager.


I want to share my experience how to make a universal install solution with GUI. I did not find any complete article about it, hence, I reinvented the wheel.

Read more →
Total votes 2: ↑2 and ↓0 +2
Comments 0

Windows and Linux (Fedora KDE): difference, configuration, dual-boot

Reading time 31 min
Views 2.8K

I reinstalled both Windows and Linux (Fedora) recently on a notebook PC, and I decided to write the summary article about my experience with both OS. I'm also going to describe how to configure each OS via command-line and set up a dual-boot system.

Read more
Total votes 3: ↑3 and ↓0 +3
Comments 0

Controlling Brushless Motors using a Linux computer or a PLC

Reading time 5 min
Views 2.6K

In this video, we will look at how to connect brushless motor controllers to a Linux computer. Specifically, we will use a computer running Debian. The same steps would work for Ubuntu Linux and other Linux distributions derived from Debian.

I've got a small sensorless brushless motor, and a bigger brushless motor with a built-in absolute encoder. Lets look at how to control those from my Debian Linux computer. Servosila brushless motor controllers come in several form factors with either a circular or a rectangular shape. The controllers come with a set of connectors for motors and encoders as well as for USB or CANbus networks.

The controllers can be powered by a power supply unit or by a battery. To spice up my setup, I am going to use a battery to power the controllers and thus their motors. The controllers need 7 to 60 volts DC of voltage input. If I connect the battery, the controllers get powered up. The small LED lights tells us that the controllers are happy with the power supply.

We need to connect the brushless motor controllers to the Linux computer. There are two ways to do that - via CANbus or via USB. Lets look at the USB option first. A regular USB cable is used. Only one of the controllers needs to be connected to a computer or a PLC.

Next, we need to build an internal CANbus network between the controllers. We are going to use a CANbus cross-cable to interconnect the controllers. Each controller comes with two identical CANbus ports that help chain multiple controllers together in a network. If one of the interconnected brushless motor controllers is connected to a computer via USB, then that particular controller becomes a USB-to-CANbus gateway for the rest of the network. Up to 16 controllers can be connected this way via a single USB cable to the same control computer or a PLC. The limit is due to finite throughput of the USB interface.

Video & Read more
Total votes 4: ↑3 and ↓1 +2
Comments 0

The Implementation of a Custom Domain Name Server by Using С Sockets

Reading time 5 min
Views 3.6K

We describe the implementation of a custom Domain Name System (DNS) by using C socket programming for network communication, together with SQLite3 database for the storage of Internet Protocol (IP) for Uniform Resource Locator (URL). Then we provide a performance analysis of our implementation. Our code is available publicly [1].

Read more
Total votes 5: ↑4 and ↓1 +3
Comments 0

Using kconfig for own projects

Reading time 4 min
Views 8.8K

Intro


Every Linux professional write scripts. Someеimes light, linear. Sometimes complex script with functions and libs(yes, you can write your bash-library for use in other scripts).


But some of the scripts need a configuration file to work. For instance, I wrote a script that builds the ubuntu image for pxe, and I need to change the build process without build-script changes. The best way to resolve this task is to add configuration files.

Read more →
Total votes 2: ↑2 and ↓0 +2
Comments 6

Porting packages to buildroot using the Zabbix example

Reading time 16 min
Views 4.6K


The basics of porting


Originally, Buildroot offers a limited number of packages. It makes sense — there is everything you need, but any other packages can be added.


To add a package, create 2 description files, an optional checksum file, and add a link to the package in the general package list. There are hooks at different stages of the build. At the same time, Buildroot can recognize the needed type of packages:

Read more →
Total votes 2: ↑2 and ↓0 +2
Comments 0
1

Authors' contribution