Pull to refresh
86.38
Rating

Development for Linux *

Developing for *nix

Show first
  • New
  • Top
Rating limit
  • All
  • ≥0
  • ≥10
  • ≥25
  • ≥50
  • ≥100

Linux kernel turns 30: congratulations from PVS-Studio

PVS-Studio corporate blog Open source *C++ *C *Development for Linux *

On August 25th, 2021, the Linux kernel celebrated its 30th anniversary. Since then, it's changed a lot. We changed too. Nowadays, the Linux kernel is a huge project used by millions. We checked the kernel 5 years ago. So, we can't miss this event and want to look at the code of this epic project again.

Read more
Total votes 2: ↑2 and ↓0 +2
Views 1.2K
Comments 0

Finding Typos in the GTK 4 Project by PVS-Studio

PVS-Studio corporate blog Open source *Perfect code *C *Development for Linux *

0793_GTK_4_continue/image1.png


You may have already read a recent article about the first PVS-Studio run and filtration of warnings. We used the GTK 4 project as an example. It's about time we worked with the received report in more detail. Our regular readers may have already guessed that this article will be a description of errors found in the code.

Read more →
Total votes 6: ↑5 and ↓1 +4
Views 323
Comments 1

Configuring FT4232H using the ftdi_eeprom

System Programming *Development for Linux *Programming microcontrollers *
Tutorial


The FT4232H is USB 2.0 High speed to UART IC converter. The FT4232H has four UART ports and one USB port.


By connecting EEPROM memory to this chip, you can set specific operating modes or change the manufacturer's data.


Let's look at the example and configure FT4232H directly on a system running GNU/Linux. We will do this using the ftdi_eeprom.

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

Confusing extensions in Swift

Development for iOS *Swift *Development for MacOS *Development for Linux *
Sandbox
This post is a little bit the information aggregator. If you find a mistake, you could write to me about it I really appreciate that. Have a nice read.

Example with JSONDecoder


What would happen if we run the following piece of code?

struct Test<T>: Codable where T: Codable {
    enum CodingKeys: String, CodingKey {
        case value
    }
    
    let value: T
    let info: String
}

extension Test {
    init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: CodingKeys.self)
        self.value = try container.decode(T.self, forKey: .value)
        self.info = "Default init(from decoder:)"
    }
}

extension Test where T == String {
    init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: CodingKeys.self)
        self.value = try container.decode(T.self, forKey: .value)
        self.info = "Custom init(from decoder:)"
    }
}

let data = #"{"value":"Hello, World!"}"#.data(using: .utf8)!
let object = try? JSONDecoder().decode(Test<String>.self, from: data)
print(object.debugDescription)

Try thinking for 5 seconds about the result.

The result
Optional(
    Test<String>(
        value: "Hello, World!", 
        info: "Default init(from decoder:)"
    )
)


Read more →
Rating 0
Views 753
Comments 0

Using kconfig for own projects

Configuring Linux **nix *Development for Linux *

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
Views 2.3K
Comments 1

Boot Ubuntu via http/ftp server with pxe(diskless boot)

Configuring Linux *Development for Linux *
Tutorial

Intro


PXE is a great solution for booting a diskless computer (or a computer without an OS installed). This method is often used for terminal stations and OS mass installation.


Stock ubuntu (16.04) in pxe-mode can mount rootfs only from NFS. But this is not a great idea: any difficulties with the network/NFS server and the user gets problems.


In my opinion, it's best to use other protocols, such as http/ftp. Once booting, you will have an independent system

Read more →
Total votes 6: ↑6 and ↓0 +6
Views 7.2K
Comments 3

How to find errors in a C# project working under Linux and macOS

PVS-Studio corporate blog .NET *C# *Development for MacOS *Development for Linux *

Picture 8

PVS-Studio is a well-known static code analyzer that allows you to find a lot of tricky errors hidden in the source code. Beta testing of the new version has recently finished. It provides the possibility to analyze C# projects under Linux and macOS. The tool can also be integrated into the cross-platform IDE from JetBrains — Rider. This article will help you to get acquainted with these features using the example of checking the open source RavenDB project.
Read more →
Rating 0
Views 367
Comments 0

Single line code or check of Nethermind using PVS-Studio C# for Linux

PVS-Studio corporate blog Open source *.NET *C# *Development for Linux *

Рисунок 1

This article coincides with the beta testing start of PVS-Studio C# for Linux, as well as the plugin for Rider. For such a wonderful reason, we checked the source code of the Nethermind product using these tools. This article will cover some distinguished and, in some cases, funny errors.
Read more →
Total votes 3: ↑3 and ↓0 +3
Views 515
Comments 0

Porting packages to buildroot using the Zabbix example

Configuring Linux *Open source **nix *Development for Linux *Software
Tutorial


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
Views 1.8K
Comments 0

How I fix cups-printing in Buildroot

Configuring Linux *Open source **nix *Development for Linux *

image


Intro


Like I said earlier in previos articles, Buildroot is a great system for embedded Linux development. But sometimes strange things can happen.


Once upon a workday, I got the following task: add printing system in firmware (Kraftway terminal Linux next generation). Ok, so I had to add cups + cups filter and to build firmware. I set a postscript-printer and got an error "Filter failed". Trivial tasks turned into serious work.


In this article, I wrote my own way of solving this problem. It may be useful for other developers and IT-specialist and, also, for a deeper understanding of the Buildroot.


If you are a Buildroot beginner, I recommend reading my previous articles.


Update 1 may 2020


Revisioned versions of this patches applied to master.

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

buildroot — my own experience with multi-platform distro creation

Configuring Linux *Open source **nix *Development for Linux *

Introduction


In my previous article (Monitor linux) I wrote, what is this distro and how it works. Now i will write how to do it. It's may be interesting for everyone, who want to study buildroot.


Target goals


The result we get from article is the following:


  • Firmware (non-volatile image with restorable config)
  • Easy management via web-interface
  • Cross-platform (qemu x86_64, arm-based SBC like rasberry 4, beagle bone black and asus tinker board)
  • Support without extra effort
Read more →
Total votes 8: ↑6 and ↓2 +4
Views 2.8K
Comments 2

Monitor linux — cross platform firmware with zabbix server

Open source *IT Infrastructure **nix *Development for Linux *Development for Raspberry Pi *

About


This is small cross-platform linux-distro with zabbix server. It's a simple way to deploy powerful monitoring system on ARM platfornms and x86_64.


Worked as firmware (non-changeable systemd image with config files), have web-interface for system management like network settings, password and other.


Who is interested


  • System admins/engineers who need to fast deploy of zabbix server.
  • Everyone, who want to deploy zabbix on ARM.
  • Enthusiasts
Read more →
Total votes 3: ↑3 and ↓0 +3
Views 1.3K
Comments 0

A Brief Comparison of the SDS Architectures for Virtualization

Open source *IT Infrastructure *Data storage *Development for Linux *Data storages *
Translation

The search for a suitable storage platform: GlusterFS vs. Ceph vs. Virtuozzo Storage


This article outlines the key features and differences of such software-defined storage (SDS) solutions as GlusterFS, Ceph, and Virtuozzo Storage. Its goal is to help you find a suitable storage platform.

Gluster



Let’s start with GlusterFS that is often used as storage for virtual environments in open-source-based hyper-converged products with SDS. It is also offered by Red Hat alongside Ceph.
GlusterFS employs a stack of translators, services that handle file distribution and other tasks. It also uses services like Brick that handle disks and Volume that handle pools of bricks. Next, the DHT (distributed hash table) service distributes files into groups based on hashes.
Note: We’ll skip the sharding service due to issues related to it, which are described in linked articles.

image

When a file is written onto GlusterFS storage, it is placed on a brick in one piece and copied to another brick on another server. The next file will be placed on two or more other bricks. This works well if the files are of about the same size and the volume consists of a single group of bricks. Otherwise the following issues may arise:
Read more →
Total votes 2: ↑1 and ↓1 0
Views 1K
Comments 0

Writing a laptop driver for fun and profit, or How to commit to kernel even if you're not that smart

Reverse engineering *Development for Linux *Computer hardware
Translation

Where it all began


Let’s start with our problem statement. We have 1 (one) laptop. A new, gamer laptop. With some RGB-backlight on its keyboard. It looks like this:

image
Picture taken from lenovo.com

There’s also a program installed on this laptop. That’s the thing that controls our backlight.

One problem – the program runs under Windows, and we want everything to work on our favourite Linux. Want LEDs to flash and those pretty colours to blink on and off and such. A natural question arises, can we do all that without reverse-engineering and writing our own drivers?

A natural answer arises, no. Let’s open IDA and get cracking.

Read more →
Total votes 5: ↑5 and ↓0 +5
Views 1.4K
Comments 0

Cool WSL (Windows Subsystem for Linux) tips and tricks

Microsoft corporate blog Configuring Linux *Visual Studio *Development for Linux *Development for Windows *
It's no secret I dig WSL (Windows Subsystem for Linux) and now that WSL2 is available in Windows Insiders Slow it's a great time to really explore the options that are available. What I'm finding is so interesting about WSL and how it relates to the Windows system around it is how you can cleanly move data between worlds. This isn't an experience you can easily have with full virtual machines, and it speaks to the tight integration of Linux and Windows.

Look at all this cool stuff you can do when you mix your peanut butter and chocolate!

Read more →
Total votes 5: ↑3 and ↓2 +1
Views 3.3K
Comments 1

Apply Nix-Shell environment in Visual Studio Code

*nix *Visual Studio *Development for MacOS *Development for Linux *
Tutorial


A lot of developers faced a problem with packages hell on their workstation. After a couple of months with experiments, including different languages and toolchains, I installed Elixir, Haskell-stack, Node.js/NVM, and other various stuff. Most exciting things happen when you need different versions of the same package for different projects. Humanity already invented a different solution for creating an isolated environment and switch them when needed. We are using NVM to manage Node.js versions, Python Virtual Env for selecting Python stuff versions or Docker for creating OS inside an OS. But none of the solutions satisfy all my requirements for the isolated development environment.
Read more →
Total votes 7: ↑7 and ↓0 +7
Views 2.9K
Comments 0

Regular Avalonia

Programming *.NET *C# *Development for Linux *Development for Windows *
Sometimes we don’t understand how the regular expression that we have composed works and want to check. There are many applications like regex101.com or vs code. I wanted to add one more to this list.

In this article we will see how you can wrap Regex in cross-platform graphics and create a simple application for testing regular expressions.


Read more →
Total votes 14: ↑13 and ↓1 +12
Views 3.4K
Comments 0
1

Authors' contribution