Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development
  • tee is broken?

    Just found a highly surprising behavior in a core tool I've used for decades, so clearly I'm making a note here.

    [...]

    Answer time! After a tee, a single writer parent feeds two reader children. If a child exits before reading all the data, then when the parent tries to feed that dead child, the parent will get a SIGPIPE. And apparently the default behavior of tee in GNU coreutils (and in the zsh multios redirection) is to give up and to stop feeding all the children at that point. So the second child (wc -l in the examples) ends up with incomplete input. No errors are thrown anywhere, and there's no indication at all that any data was truncated. Lots of the data is just silently missing.

  • 4 ways to control the flow of your awk script

    There are many ways to control the flow of an awk script, including loops, switch statements and the break, continue, and next commands.

  • Qt 5.14.0 RC released

    Qt 5.14.0 RC is released today. As usual you can get it by using online installer (for new installations) or by using maintenance tool (existing online installation). And in addition there is also offline installers in qt account or download.qt.io for users who can't use online ones. Delta to beta3 as an attachment.

    Target is to release Qt 5.14.0 12th December so please test RC now & report all new release blockers immediately. Also make sure those are visible in release blocker list (https://bugreports.qt.io/issues/?filter=21539). But remember that Qt 5.14.1 is also coming soon so we can fix most of findings there and fix only real blockers in '5.14.0'.

  • Qt 5.14 On Track For Releasing Next Week With New Scenegraph Renderer, Better HiDPI

    While missing the original release target of the end of November, The Qt Company is buttoning up Qt 5.14 for debut next week. Today, however, marks the release candidate availability for those wanting to test out this forthcoming Qt5 release prior to more of the development efforts shifting to Qt 6.0.

  • Rust 2020

    Technically speaking, it’s past the deadline for #rust2020 posts, but I’m running late this year, and I’m going to post something anyway. In this post, I am focusing on what I see as the “largest scale” issues, and not on technical initiatives. If I have time, I will try to post a follow-up talking about some of the key technical initiatives that I think we should focus on as well.

  • Automatically downloading nursery photos from ParentZone using Selenium

    My son goes to a nursery part-time, and the nursery uses a system called ParentZone from Connect Childcare to send information between us (his parents) and nursery. Primarily, this is used to send us updates on the boring details of the day (what he’s had to eat, nappy changes and so on), and to send ‘observations’ which include photographs of what he’s been doing at nursery. 

  • Auto-generating API specifications as OpenAPI, WSDL and Sphinx

    Let's consider the services below - they represent a subset of a hypothetical API of a telecommunication company. In this case, they are to do with pre-paid cards. Deploy them on your servers in a module called api.py.

    Note that their implementation is omitted, we only deal with their I/O, as it is expressed using SimpleIO.

    What we would like to have, and what we will achieve here, is a website with static HTML describing the services in terms of a formal API specification.

  • GUI Automation using Pyautogui, Python

    PYAUTOGUI is an automation module provided by Python for controlling keyboard and mouse functions via program. This module has almost all the functions which can be performed by keyboard and mouse. We can use these functions to automate mouse and keyboard actions.

  • Beautiful Soup: Build a Web Scraper With Python

    The incredible amount of data on the Internet is a rich resource for any field of research or personal interest. To effectively harvest that data, you’ll need to become skilled at web scraping. The Python libraries requests and Beautiful Soup are powerful tools for the job. If you like to learn with hands-on examples and you have a basic understanding of Python and HTML, then this tutorial is for you.

  • Tensorflow 2.0: Solving Classification and Regression Problems

    After much hype, Google finally released TensorFlow 2.0 which is the latest version of Google's flagship deep learning platform. A lot of long-awaited features have been introduced in TensorFlow 2.0. This article very briefly covers how you can develop simple classification and regression models using TensorFlow 2.0.

  • Two New Typosquatting Libraries Found on PyPI

    Two new malicious packages were found on the Python Packaging Index (PyPI) that were designed to steal GPG and SSH keys according to ZDNet. The packages were named python3-dateutil and jeIlyfish where the first “L” is actually an I. These two libraries mimicked the dateutil and jellyfish packages respectively.

  • Framework Patterns

    A software framework is code that calls your (application) code. That's how we distinguish a framework from a library. Libraries have aspects of frameworks so there is a gray area.

    My friend Christian Theune puts it like this: a framework is a text where you fill in the blanks. The framework defines the grammar, you bring some of the words. The words are the code you bring into it.

    If you as a developer use a framework, you need to tell it about your code. You need to tell the framework what to call, when. Let's call this configuring the framework.

    There are many ways to configure a framework. Each approach has its own trade-offs. I will describe some of these framework configuration patterns here, with brief examples and mention of some of the trade-offs. Many frameworks use more than a single pattern. I don't claim this list is exhaustive -- there are more patterns.

    The patterns I describe are generally language agnostic, though some depend on specific language features. Some of these patterns make more sense in object oriented languages. Some are easier to accomplish in one language compared to another. Some languages have rich run-time introspection abilities, and that make certain patterns a lot easier to implement. A language with a powerful macro facility will make other patterns easier to implement.

    Where I give example code, I will use Python. I give some abstract code examples, and try to supply a few real-world examples as well. The examples show the framework from the perspective of the application developer.

  • Django 3 taps Python async to speed web apps

    Django 3.0, the newest version of the Python framework that allows fast creation of database-backed websites and web services, now supports Python async, one of the most powerful new features in Python to make websites and network services faster.

    Async allows Python programs, especially networking apps, to run more efficiently, but existing applications must be rewritten to use it. Django 3 will only work with Python 3.6 and later versions, the better to work with Python’s async programming features. 

    A key way Django provides support for async is via ASGI, a protocol that serves as a standard interface between asynchronous Python applications and async-capable web servers. Previously, Django only supported WSGI, which only supported synchronous web applications. Django 3 will only allow async features to run in an app if it’s deployed as ASGI.

  •                    

  • CSS: An Art, a Science, a Nightmare (Overview of CSS Concepts)

                         

                           

    Some people think CSS is really hard and it's too much of a hassle to learn. Some people think that since it's not a programming language (or is it?), it's so easy that you don't even have to bother learning it. Ultimately, there's a lot to CSS, but it doesn't have to be overwhelming. If you learn a few key concepts, you should feel confident looking at or thinking of any design and turning it into reality.

                           

    I'm going to go over some of the parts of CSS that are important on a daily basis, and give some of tips and tricks I've come to learn over the years.

  •                    

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.