Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development
  • How does Google Authenticator work? (Part 1) [Ed: Surveillance in the name of 'security' is a bad compromise]

    We have to come up with an algorithm that will prove that the user has physical access to their smartphone running the app at the time of being authenticated. How can we do that?

    The 1st thing that comes to mind is, let’s embed a sort of secret – e.g. a password – in the app on the phone. Then, every time the user logs it, let’s ask the user to open the app and type the password that the app is showing.

    [...]

    The idea of combining the secret with a counter to produce a unique each time – yet predictable only to server and app – hash is tricky to get correctly in a way that is resistant to various attack vectors that would somehow make it easier to predict the next hash. The standard that addresses security around that concept is called HMAC (Hash-based Message Authentication Code). This algorithm describes a process of combining a key (in our example $3cr3tP4$$) with a message (in our case the counter) and calculating HASH in a safe and hard to predict way if you don’t know the key.

    Another way to think of HMAC is what the name actually stands for – signing a message (the counter in our case) cryptographically using a pre-shared secret (the super-secret password we’ve been using here: $3cr3tP4$$). So your app is signing the counter with that password. And only the server is able to verify the signature, because the only other entity that knows the password is the server.

  • Expand your possibilities with automation

    The first big challenge for automation is trust. Not in the sense of "do I trust people I work with," but trusting what we're doing with automation.
    Until you get started with the process of automation, there will be people who have doubts about automation. How do we know what's being done, who's doing it, where it's happening?
    Most importantly, what happens if something goes wrong? Those are valid questions, but notice that we don't ask the same questions about processes that are being performed manually and therefore are prone to mistakes every time a task is performed.
    Automation allows us to refine and improve how things are done, one-off tasks are new opportunities for mistakes each time they're performed. But because we've "always" done it that way, people are more comfortable.
    So the biggest challenge isn't technical -- even though automation is heavily technical -- it's the people element. It's establishing trust in what you're doing and getting started so that you can meet your objectives.

  • JavaScript Tops List of Most Commonly Used Programming Languages

    The recent Stack Overflow Developer Survey finds many relative newcomers in the world of software development, with more than 50 percent of respondents “indicating they have been coding for less than a decade, and more than 35 percent reporting less than five years in the trade.”

  • GSOC Printers: GDB Machine Interface - Ebuka's Blog

    GDB MI allows applications to connect to GDB without actually running it from the terminal, this is how frontends talks to GDB. Most of the time this is how users actually use GDB for debugging.

  • Review of MikroTik hEX (3rd rev.) as a home router

    The RouterOS scripting language is … unique. It can be difficult to develop and debug your scripts, though. The script interpreter just quits when it encounters a syntax error without returning any error messages.

    Similarly, RouterOS doesn’t support auto-updates out of the box. You can implement an auto-update service through a script that checks for updates, downloads, and reboots to install them. However, RouterOS updates aren’t meant to be performed unattended. You must read the changelog for each update and evaluate if the changes will impact your setup. Security advisories and updates are communicated through a syndication feed (yay, RSS!)

  • Development environment available to Linux developers

    Linux Studio is a development environment created particularly for native host development, making the features of SEGGER's top-rated Embedded Studio IDE available to all Linux application developers. With its smooth Visual Studio-style user interface, powerful project management and integrated source-level debugger, it greatly simplifies development on Linux.

    Its project manager provides clear organisation of all project resources. Multi-project solutions can retain all parts of an application together, such as an executable file, extra libraries and resources.

  • Elastic amends Elasticsearch Python client so it won't work with forks then blocks comments • The Register

    Elastic has modified the official Python client for its Elasticsearch database not to work with forked versions, and closed the GitHub issue to comments.

    Elasticsearch is a database manager and analytics engine, often used for log analytics. The elasticsearch-py client has over 202,000 downloads and is described as the "official low-level client for Elasticsearch. Its goal is to provide common ground for all Elasticsearch-related code in Python; because of this it tries to be opinion-free and very extendable."

    It is also used as a library by Elasticsearch DSL, a high-level library for running Elasticsearch queries.

  • Rust Firebird Client updated to v0.17.0 with a few features and enhancements.

    Rust Firebird Client updated to v0.17.0 with a few features and enhancements.

  • Two data formatting tweaks

    Nearly all the data files I audit are tab-separated plain text (TSV). Tabs are wonderful field separators but they're invisible, and sometimes it helps to see where one field ends and another begins. This post describes a couple of the methods I use to make TSVs more eye-friendly.

  • Dijkstra’s Algorithm

    We sometimes need to find out the links between two different corners, and then we need the graph. In a simple example, if we want to go from one place to another place, then the Google maps show all the different ways but highlight the shortest path to reach your destination. But, if you change your path while using Google Map, then it predicts a new path according to your current location to your destination. So, all these happens through the algorithm which we called Dijkstra’s Algorithm. Dijkstra’s Algorithm finds the shortest path among the nodes.

    In the graph, there are nodes and edges. The nodes are the values and the edges are the path or lines which create links between the two nodes. In Python, we can implement the nodes and edges using the nested dictionary. We can represent the nodes as a key and all the paths from that node to other nodes as a value of that particular key.

    Dijkstra’s Algorithm is used to find the shortest path between the source node and the target node. The approach this algorithm is used called the Greedy approach. So, in this article, we are going to understand the concepts of Dijkstra’s Algorithm and how we can implement it using Python programming.

    Dijkstra’s Algorithm as we said before, is using the concept of the Greedy approach. We can understand the greedy approach in a normal term which finds the optimal solution from the available options.

  • NumPy Polyfit

    Linear regression is the first step to learn data science. So even if you are new in this field, you have to understand these concepts because these algorithms are mostly used by data science researchers. These algorithms are also easy to understand to start the machine learning journey.

    In this tutorial, we are going to see the numpy(polyfit) regression model.

  • Web scraping using BautifulSoup

    Web scraping is a technique used to select and extract specific content from websites. For instance, when we want to monitor prices and how they change, we can use a web scraper to extract just the information we want from a website and dump them into an excel file. In this tutorial, we will be learning how to scrape the web using beautifulsoup.

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.