Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development
  • C: execve function usage

    Execve() function is used for the execution of the program that is referred to by pathname. The exec family is used mainly in the C programming language and has many functions. These functions execute a system command in a separate process from the main program and print the output. In this article, we will discuss some of the main functions of the exec family and mainly execve functions with some elementary examples.

    Now let’s look at the exec family in the image attached. This picture shows the syntax of all possible functions of the exec family.

  • C: inet_pton function example
  • C: Connect Function System Call

    We cannot emphasize enough socket programming and all its use-cases. However, since it is a pervasive topic, each of its components or the functions used while doing socket programming holds a crucial value and needs to be studied separately. The connect function or system call is also an essential function used while doing socket programming in the C programming language. In this article, we will see how we can use this function in the C programming language.

  • C: CHDIR Function Usage

    We have already talked about the “CHDIR” function of the C programming language briefly while discussing the “getcwd” function. However, this article will specifically revolve around the “CHDIR” function mainly used to alter the current working directory of a system. We will especially try to explore how the behavior of this function changes once it is used within a C script. To do that, we will first introduce you to the purpose of this function, followed by its syntax. Then, we will discuss the impact of this function on the current working directory of the shell in Linux. Finally, we will conclude our discussion by talking about some of the errors that can be returned from executing the “CHDIR” function of the C programming language.

  • C: Basename Function Usage

    While dealing with the files in Linux, you need to manipulate their paths. There are certain functions of the C programming language that can operate on the file paths; however, as far as the scope of this article is concerned, we will talk in detail about the usage of the Basename function of the C programming language.

  • Eagle's Path: DocKnot 7.00 (2022-01-17)

    The recent 6.01 release of my static web site generator was kind of a buggy mess, which uncovered a bunch of holes in my test suite and immediately turned up problems when I tried to use it to rebuild my actual web site. Most of the problems were Unicode-related; this release hopefully sorts out Unicode properly and handles it consistently.

    Other bugs fixed include processing of old-style pointers in a spin input tree, several rather obvious bugs in the new docknot release command, and a few long-standing issues with docknot dist that should make its results more consistent and reliable.

  • The__repr__ in Python

    The __repr__() method of Python yields a textual or string depiction of an entity or an object. This process is termed whenever the entity’s repr() method is invoked. You can say that the “repr” method and “__repr__” can be used interchangeably for the same purpose. The text reverted must be a proper Python phrase that would be castoff to reassemble the entity if feasible. A “__str__” function of python does the same, but there is a slight difference between both the functions. The __str__ method is designed to produce a human-readable version, useful for tracking or displaying object information. The __repr__ method, on the other hand, is designed to provide an “official” textual image of the object that may be used to recreate it. We’ll focus on both key Python entity methods in our article today. Let’s have a fresh start.

  • The Python Sort List of Tuples

    In Python, we utilize tuples to store multiple elements in a variable. Tuple lists may be sorted similarly to any other list. However, tuples contain numerous elements, so we are free to rearrange the tuples based on item 1 or item i. In this guide, we will look at how to sort various lists of tuples using multiple examples. We will go over the various scenarios and the many strategies employed to accomplish this. We will mainly focus on some built-in methods and sorting procedures to achieve tuple sorting. The well-organized nature and invariant properties of tuples are dissimilar from those in regular lists.

  • How to Remove an Element From a Set in Python

    This article describes how to remove items from a set in Python. We utilize certain built-in features, several approaches to better understand this topic. Let’s take a look at a set of Python.
    Disordered records will have unindexed values. We cannot access the values of the set via the index number, such as we have done in a different list. The values of a set are unchallengeable. That is, we cannot change the value once it is created. The data in the set may remain of some type, such as integers, floating-point values, or integers.

  • How to Use Xrange in Python

    In Python, xrange is a commonly used function that gives a series of numbers from a given range. In Python 2, there is a function that returns an xrange object. When we need to iterate through a loop, we use the xrange function. As a result, the object created by xrange is mostly utilized for indexing and iteration. Keep in mind that the xrange method is only supported in Python 2 at this time. Because Python 2 is no longer supported, we recommend using Python 3 and the range() method instead of xrange(). The range() and xrange() methods can be used for loops to iterate a specified number of times, let’s say 10 times or 5 times. Although Python 3 does not provide an xrange function, the range function works identically to the xrange function in Python 2.

    If you want to develop programs that can be executed on both Python 2 and Python 3, you should utilize the range method. The range() returns a range object (a type of iterable), while xrange() returns a generator object that can only be used to loop through integers. The only specific range is presented on demand, leading to the term “lazy evaluation”. Both are used in various ways and have different qualities. The return type, memory, operation usage, and performance are all factors to consider. Let’s discuss each factor with a corresponding example for better understanding.

  • Sam Thursfield: Status update, 17/01/2022

    I am keeping busy at work integrating BuildStream with a rather large, tricky set of components, Makefiles and a custom dependency management system. I am appreciating how much flexibility BuildStream provides. As an example, some internal tools expect builds to happen at a certain path. BuildStream makes it easy to customize the build path by adding this stanza to the .bst file...

  • Entering the Job Market? Here Are the Most In-Demand Programming Languages for 2022 - Anto ./ Online

    As we enter 2022, you might be looking for a new job. The Great Resignation proves beneficial to job hunters or switchers, as employers are willing to provide higher pay and more benefits to stem labor shortages.

    Now is an excellent time for anyone wanting to launch, boost, and even future-proof their career. If you're looking to snag a job that is and will stay in demand, the World Economic Forum recently listed their top 10 jobs of the future.

  • GCC 12 Moves On To Stage 4 Development With Many New Compiler Features - Phoronix

    GCC 12 as this year's annual GNU Compiler Collection feature release has moved on to "stage four" development with likely releasing GCC 12.1 in April.

    This transition was known and marks the end of the stage 3 general bug fixing period now with just focusing exclusively on regression/documentation fixes. This is the final stage focused on getting the next GCC feature release ready for debut.

  • HTMLQ: Like JQ But To Parse & Query HTML - Invidious

    Parsing and querying HTML through pure Unix tools can be a massive pain and you're much better off using specialized tools, one of those specialized tools in HTMLQ, which is much like JQ. Between recording and upload, the dev added the ability to remove nodes so ignore that point.

More in Tux Machines

digiKam 7.7.0 is released

After three months of active maintenance and another bug triage, the digiKam team is proud to present version 7.7.0 of its open source digital photo manager. See below the list of most important features coming with this release. Read more

Dilution and Misuse of the "Linux" Brand

Samsung, Red Hat to Work on Linux Drivers for Future Tech

The metaverse is expected to uproot system design as we know it, and Samsung is one of many hardware vendors re-imagining data center infrastructure in preparation for a parallel 3D world. Samsung is working on new memory technologies that provide faster bandwidth inside hardware for data to travel between CPUs, storage and other computing resources. The company also announced it was partnering with Red Hat to ensure these technologies have Linux compatibility. Read more

today's howtos

  • How to install go1.19beta on Ubuntu 22.04 – NextGenTips

    In this tutorial, we are going to explore how to install go on Ubuntu 22.04 Golang is an open-source programming language that is easy to learn and use. It is built-in concurrency and has a robust standard library. It is reliable, builds fast, and efficient software that scales fast. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel-type systems enable flexible and modular program constructions. Go compiles quickly to machine code and has the convenience of garbage collection and the power of run-time reflection. In this guide, we are going to learn how to install golang 1.19beta on Ubuntu 22.04. Go 1.19beta1 is not yet released. There is so much work in progress with all the documentation.

  • molecule test: failed to connect to bus in systemd container - openQA bites

    Ansible Molecule is a project to help you test your ansible roles. I’m using molecule for automatically testing the ansible roles of geekoops.

  • How To Install MongoDB on AlmaLinux 9 - idroot

    In this tutorial, we will show you how to install MongoDB on AlmaLinux 9. For those of you who didn’t know, MongoDB is a high-performance, highly scalable document-oriented NoSQL database. Unlike in SQL databases where data is stored in rows and columns inside tables, in MongoDB, data is structured in JSON-like format inside records which are referred to as documents. The open-source attribute of MongoDB as a database software makes it an ideal candidate for almost any database-related project. This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the MongoDB NoSQL database on AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux.

  • An introduction (and how-to) to Plugin Loader for the Steam Deck. - Invidious
  • Self-host a Ghost Blog With Traefik

    Ghost is a very popular open-source content management system. Started as an alternative to WordPress and it went on to become an alternative to Substack by focusing on membership and newsletter. The creators of Ghost offer managed Pro hosting but it may not fit everyone's budget. Alternatively, you can self-host it on your own cloud servers. On Linux handbook, we already have a guide on deploying Ghost with Docker in a reverse proxy setup. Instead of Ngnix reverse proxy, you can also use another software called Traefik with Docker. It is a popular open-source cloud-native application proxy, API Gateway, Edge-router, and more. I use Traefik to secure my websites using an SSL certificate obtained from Let's Encrypt. Once deployed, Traefik can automatically manage your certificates and their renewals. In this tutorial, I'll share the necessary steps for deploying a Ghost blog with Docker and Traefik.