Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
  • 10 eureka moments of coding in the community |

    If you've written code, you know it takes practice to get good at it. Whether it takes months or years, there's inevitably a moment of epiphany.

    We wanted to hear about that time, so we asked our community to share about that time they sat down and wrote code that truly made them proud.

  • Announcing the new

    We are pleased to announce the launch of the new website!

    The design and content are roughly the same as the old website. The most notable changes are: [...]

  • Tech focus: Software tools | Scientific Computing World

    Software tools are an essential part of the HPC ecosystem, for both scientists and all potential HPC users. While there are a huge number of different categories of tools available to the HPC community, the exascale projects in the US and Europe are focused on the development of open source software, or software that can facilitate the use of a wide range of resources.

  • Complexity is killing software developers | InfoWorld

    The shift from building applications in a monolithic architecture hosted on a server you could go and touch, to breaking them down into multiple microservices, packaged up into containers, orchestrated with Kubernetes, and hosted in a distributed cloud environment, marks a clear jump in the level of complexity of our software. Add to that expectations of feature-rich, consumer-grade experiences, which are secure and resilient by design, and never has more been asked of developers.

  • How to use python csv writer

    In this blog, we will see how we can use the python csv writer to write the list data to csv.

  • I just want to run this one Python script |

    So I couldn't sleep the other night, and my brain wanted to think about odd problems…

    Ever had a script that's compatible with both, Python 2 and 3, but you didn't want to bother the user to know which interpreter to call? Maybe because the script is often used in environments where only one Python is available and users just expect things to work? And it's only that one script file, no package, no additional wrapper script, nothing.

    Yes, this is a rather odd scenario. And yes, using Python doesn't make it easier, but trust me, you wouldn't want to implement the same in bash.

    Nothing that you will read from here on should ever be actually implemented, it will summon dragons and kill kittens. But it was a fun midnight thought, and I like to share nightmares!

    The nice thing about Python is it supports docstrings, essentially strings you can put inside your code which are kind of comments, but without being hidden inside commnent blocks. These are often used for documentation that you can reach using Python's help() function. (Did I mention I love help()?)

  • Add to Array in Ruby

    When it comes to storing related and non-complex information in a program, arrays always come up. Arrays are a collection of an ordered list of items. Using arrays, you can store related values in a single variable, making your code efficient and easy to manage. In Ruby, arrays contain lots of built-in methods, making working with list data much more effortless.

    This article describes various methods you can use to add items to an array in Ruby.

  • PHP Strtotime() Function

    The UNIX timestamp value is calculated from 1st January 1970. The strtotime() is a built-in PHP function to convert human-readable date and time values into UNIX timestamp values. The way to use this function in PHP for different purposes has shown in this tutorial with examples.

  • PHP Sprint() Function

    The sprint() function of PHP works like the printf() function. Both functions generate the formatted output, but one difference between these functions is that the output of the sprinf() function is stored into a variable, and the output of the printf() function is displayed in the browser. How sprint() function works and the uses of this function is shown in this tutorial.

  • Split PHP String

    Sometimes we need to divide the string data based on the particular separator for programming purposes. Many ways exist in PHP to do this task. Three built-in functions of PHP that can be used to split string data are explode(), str_split(), and preg_split(). These functions create an array by dividing the string value based on the particular delimiter or pattern. How these functions work and the uses of these functions to split PHP strings have shown in this tutorial.

  • PHP If..Else Statements

    The conditional statement is used to execute the block of statements based on the particular condition. The ‘If..else’ statement is one type of condition statement that works with the particular condition(s). Different types of ‘if..else’ statements can be used in PHP for implementing conditional statements. These are mentioned below.

  • PHP Associative Array

    Mainly two types of the array can be created in any programming language. One is a numeric array and another is an associative array. Each value of an array is accessible by the index of that value. The index value is not required to define for numeric array and the sorted numeric index is generated automatically for this array if no index is defined. If it is required to create a particular string value for each index of the array, then the associative array is used to do the task.

    PHP associative array can contain a number or both number and string in the index value. The user-defined index is used in an associative array. The ‘=>’ is used to assign the key-value pair of the associative array in PHP. The way to define and use associative array in PHP was shown in this tutorial.

  • Peeking through logs

    Then, one part of the article caught my eye:

    I assume each and every message could itself be malicious. I treat inspecting the log files with care. If any system was compromised, an attacker could theoretically pivot to other systems via carefully crafted malicious syslog messages. Would anyone do this? I doubt it.

    Brace yourselves, for what follows is a recount of a case I've helped solve where the initial attack was performed via a carefully crafted syslog message and a tiny bit of social engineering.

    Before I go into details, I have to mention that I am not at liberty to disclose the exact details, I cannot go into deeper specifics. So read what follows with that in mind. If something isn't clear, that's probably because I cannot clear it up without breaching confidentiality.

    With that out of the way, lets set the stage!

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.