Programming Leftovers
-
Rust projects open to denial of service thanks to Hyper • The Register
Security researchers at have identified multiple vulnerabilities arising from careless use of the Rust Hyper package, a very popular library for handling HTTP requests.
Security firm JFrog found that an undisclosed number of projects incorporating Hyper, like Axum, Salvo and conduit-hyper, were susceptible to denial of service (DoS) attacks arising from HTTP requests crafted to take advantage of the vulnerabilities.
Those three have fixed their code, but an undisclosed number of other vulnerable projects have not yet responded, according to JFrog. Currently, 2,579 projects listed in Rust's package repository crates.io depend on Hyper, which has been downloaded more than 67 million times.
-
Java front-end and library patches v2
Disclaimer: this does not currently work.
The front-end and library compile successfully, but fail to link at the very end. This is due to a regression caused by 1dedc12d186a110854537e1279b4e6c29f2df35a, which I have been unable to solve.
Nevertheless, I am posting this patch series for two reasons.
Firstly, to get feedback and reviews on the 56 already existing patches, even though most are just re-adding code or making idiomatic changes, so that when the final issue is solved everything has already been approved (hopefully) and the merge is good to go.
Secondly, to get assistance with the final issue, because it is simply beyond me, and history has shown that asking for help via gcc-patches will yield nothing.
You'll need libtool 2.4.7 and a bleeding-edge version of bdwgc to build it, in case anyone planned to do some testing. -
Bash Remove Last x Characters From String?
There are several ways or commands in Linux that we may use to remove the last characters from a string value in bash, including “cut”, “sed” “compliment”, “awk” and others. The “%” and “?” operators can also be employed to eliminate the ending element from a string. By utilizing the “cut” command in bash, we can also delete a specific character from a string that we want to eliminate. In this article, we will show a variety of techniques for deleting elements from sequences.
-
How to Export a Path in .Bashrc
When a command is launched on Linux, the operating system looks in the environment variable which is known as PATH for executable files. When we employ these paths, we can run the commands without having to provide a specific path.
-
Create Bash Functions with Arguments
To create efficient code, bash functions are used in shell scripts. In essence, these are a set of instructions that can be used again throughout the program. Additionally, it enables programmers to divide long, complex scripts into manageable chunks that may be invoked as needed. In this article, we will go through how to pass an argument to a bash function to build a function with an argument. The parameter may be a string, an integer, or something else entirely. Different methods of sending arguments to bash functions will be used in this article.
-
Bash Loop Through Files In A Directory?
Sometimes according to our requirements, we need to move and loop through all the files and directories in a given folder. Let us suppose we want to run a specific command in each folder and file of a directory. For that purpose, we will iterate through all directories using loops. Only a few CLI utilities or command line utilities allow us to run the same command for multiple files. But in our case, we use bash shell scripting and using for loop to speed up any command we want to make our work efficient.
-
Bash Cut Command with Examples
Linux provides us with many commands and utilities that allow us to cut out pieces and parts of specific files and process and filter those files. “cut” is also a command line utility in Linux that allows us to cut specific parts and sections of files and show us the data as standard output by printing it. We can use it to cut out the parts of files by delimiter, field, bytes, position, and characters.
-
Why Perl is making a comeback: 5 reasons why it's worth learning - Linux Careers
Perl is making a comeback, and for good reason. From its strong support for text manipulation and data processing tasks to its wide array of libraries and modules, Perl is a versatile and powerful language that's worth learning. In this article, we'll explore 5 reasons why Perl is making a comeback and why it's worth learning now. Whether you're a seasoned programmer or just starting out, Perl is a valuable skill to have in your toolkit.
Perl is a popular programming language that is widely used in the tech industry for tasks such as web development, data processing, and system administration. Its simplicity, flexibility, and power make it a good choice for those looking to pursue a career in the tech industry. In this article, we will explore the strengths of Perl and discuss why it may be a good choice for those looking to learn a programming language. We will also compare Perl to Python, another popular programming language that is often used for similar types of tasks, and discuss the situations where one language may be a better choice over the other.
-
nbdkit + libblkio | Richard WM Jones
Our plugin-based Network Block Device server, nbdkit, now has support for libblkio.
libblkio is a library written by Stefan Hajnoczi, Alberto Faria, Stefano Garzarella and others for accessing some somewhat unusual disk protocols including vhost-user, NVMe, vDPA, VFIO and io_uring which I’ll talk about below. It’s important to know that these are not disk formats (like raw or qcow2), but accelerated protocols for talking to virtual or real hardware.
The library is written in Rust (but offers a C API) and I believe it’s intended to replace various bottom-end parts of the qemu block layer at some point in the future.
-
Free PHP, HTML, CSS, JavaScript editor - Codelobster IDE
In this article, we suggest you to get acquainted with the free editor of web languages – Codelobster IDE. It is presented on the software market for a long time already, and it wins a lot of fans.
Codelobster IDE allows you to edit PHP, HTML, CSS and JavaScript files, it highlights the syntax and gives hints for tags, functions and their parameters. This editor easily deals with those files that contain a mixed content.
-
Excellent Free Tutorials to Learn Zig - LinuxLinks
Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
The language is designed for “robustness, optimality and maintainability”, supporting compile-time generics, reflection and evaluation, cross-compilation and manual memory management.
Zig also ships with a C/C++ compiler, and Zig can be used with either or both languages.
-
Bucket sort C++
Sorting is a method by which we order the items in a sequence. Bucket sort is one of the sorting algorithms but this algorithm is a bit different from the other algorithms. A bucket, as the name implies, contains something in a separate space like a container. This algorithm places the elements in the bucket according to the condition. The elements are divided into different buckets, and sorting is performed on each bucket. We can decide which algorithm is used to sort the buckets. The other names for bucket sort are bin sort and radix sort. The grouping of elements to be stored in buckets is done uniformly. Bucket sort is the algorithm that is good with small arrays. But when it comes to sorting the larger arrays, this algorithm is not preferred because the complexity increases and the performance decreases. This algorithm is applied mostly on the floating point values where we need to uniformly group the elements of the array.
-
Dynamic Memory Allocation in C++
Memory allocation is determined at the time of variable declaration. But in most cases, we don’t know how much memory is required for a specific variable. In that case, memory allocation has to be done on the runtime. The runtime memory allocation of the program is known as dynamic memory allocation. In dynamic memory allocation, we don’t know the actual size of the variable. We manually allocate the memory for that variable, and it can also be an array or object of a class. Pointers play a key role in dynamic memory allocation. When we dynamically allocate the memory, the “new” keyword is used to tell the compiler that we are dynamically allocating the memory. When we are done with allocating the memory, in the end, we need to manually “delete” that reserved dynamic memory. In other programming languages like Python and Java, we don’t have to dynamically allocate the memory because the compiler automatically does that. But in C and C++, we do this manually using the new (to reserve space) and delete (to free space) keywords.
-
Vulkan video shenanigans - FFmpeg + RADV integration experiments - Maister’s Graphics Adventures
Vulkan video is finally here and it’s a fierce battle to get things working fully. The leaders of the pack right now with the full release is RADV (Dave Airlie) and FFmpeg (Lynne).
In Granite, I’ve been wanting a solid GPU video decoding solution and I figured I’d work on a Vulkan video implementation over the holidays to try helping iron out any kinks with real-world application integration. The goal was achieving everything a 3D engine could potentially want out of video decode.