Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development
  • Check Java processes on Linux with the jps command | Opensource.com

    On Linux, there are commands to view processes running on your system. A process is any ongoing event being managed by the kernel. A process is spawned when you launch an application, but there are also many other processes running in the background of your computer, including programs to keep your system time accurate, to monitor for new filesystems, to index files, and more. The utilities, such as those included in the procps-ng package, that monitor these processes tend to be intentionally generic. They look at all processes on your computer so you can filter the list based on what you need to know.

    On Linux, you can view processes with the ps command. It is the simplest way to view the running processes on your system.

  • How to remove special characters using sed

    Sed command is a Linux utility that can be used to perform lot of operations that includes insert and delete operations, find/search and replace operations. The sed command allows Linux users to edit and apply several functions on files without opening them directly. The sed command support editing functionalities that vary from beginners’ level to advanced level: For instance, inside a text file these operations can be performed on several datatypes: characters, numeric, special characters, alphanumeric et.,

    Keeping in view the importance of sed command; our today’s guide will explore several ways to remove special characters using sed command in Ubuntu.

  • How to use sed character classes

    Stream Editor (sed) is known as a powerful editor because of its wide range of supported functionalities like substituting, editing, deleting and many more. While Stream Editor has the long list of characters that provide assistance to manage the files automatically: these characters are enclosed in a set of similar characters known as Character Classes; these classes contain the characters of alike families.

    For instance, the digits while using sed are accessed through [[:digit:]] class and the alphanumeric characters are stored in the class named as [[:alnum:]]. Similarly, all the characters belong to some specific character class; knowing the importance of these classes, our today’s guide is focused to provide a deep insight into character classes in sed.

  • Bash Associative Array Explained With Examples In Linux - OSTechNix

    This is the second article as part of bash arrays. In the previous article, we have discussed how to work with Indexed arrays in Bash. In this guide, we will discuss about Bash Associative Array in detail with examples in Linux.

    Associative arrays work based on key-value pairs. In some languages, it is also called dictionaries or hash maps. The main difference between Indexed and Associative arrays is, Indexed arrays works based on index value, and each element in the array is mapped to a particular index position of the array. An associative array uses a "key" to map the value instead of index positions.

  • How to open URL in python

    Python is an interpreted language; it has different libraries to perform various functions. A Uniform Resource Locator (URL) is actually a web address to open a specific site. Sometimes while working in python we need to fetch data from a website, for this we have to open the url of a specific website. So, to open a URL in python we need to import the specified module and perform some steps to open that URL. In this article we will discuss how to open a URL in Python using “urllib.request” and “webbrowser” modules on Ubuntu (Linux OS) through a defined procedure.

  • How to use Python readline() function

    There are many useful methods of Python which we can use in our programs. One of the handy methods is python readline() method, it reads one complete line from a specified file at a time by default. You can also read more than one line or complete file using readline() method using different conditions like using size argument. The readline() method inserts a new line (\n) at the end of returned String.

    In this Article we discussed the usage of the readline() method in python and how to run it on a Linux system.

  • How to Rename File in Python

    We can rename files in Linux terminal using different approaches, one of the approaches is using Python which is discussed in this article. We cannot write Python code directly on the terminal, we create a separate file in a text editor. The “rename” is one of the operating system functions so we will use a Python OS module for this purpose.

  • Rakudo Weekly News: 2021.40 It’s here!

    With a MoarVM, NQP and Rakudo merge (at 922 commits and 335 files changed by 16 contributors), the work on the new-disp branch that started about 18 months ago, was finally made mainstream. Special kudos to everybody who was involved in what was the biggest internal change since the MoarVM backend was initially conceived. Jonathan Worthington reports about in The new MoarVM dispatch mechanism is here! (/r/rakulang, Twitter comments).

  • vrurg: Merging Symbols Issue
  • How to Remove Characters from Strings in JavaScript

    JavaScript provides users with various methods and properties for string manipulation, to transform those strings or to search useful information from those strings. Sometimes we have various lines of code in which we need to make changes, search for a character or replace a character or remove a character from a string.

    All these tasks become difficult to do and hence methods are provided by JavaScript that makes the job easier. Users can easily use these methods to manipulate a string and transform it. In this article we’ll discuss how to remove characters from strings in JavaScript, various ways and methods provided by JavaScript along with examples for your better understanding.

  • How to remove white empty spaces from Strings in JavaScript

    Manipulating string is a useful task while programming as it helps us in finding words, replacing words and especially for removing white spaces from string. JavaScript provides various built-in methods to users for manipulating with strings.

    Removing whitespaces from a string can be complex when it comes to tabs and line breaks and while you’re working with various lines of codes but JavaScript provides users with methods through which it becomes easier to manipulate strings and remove whitespaces from them and that’s why in this article we’ll discuss different methods and ways to remove whitespaces from a string in JavaScript, their explanation and how they’re used along with examples.

  • How to use git stash and git stash pop commands

    Git helps to control the version of your projects. Git is a well-known software used by programmers to work in a collaborative manner to achieve specific goals. The Git repositories are hosted by GitHub that helps to work online and assist the programmers to share their project or code files there. Moreover, Git is backed up by several operations or commands also like Git stash, Git stash apply, Git stash pop, Git stash drop. Inspired by the importance of Git, today’s guide will provide fundamental information about Git stash and Git stash pop; and use of both commands/operations in Ubuntu.

  • How to remove git remote

    Git is an open-source software with version control support that allows the users to store, edit and track the changes of projects.

    There are various benefits in using Git that include: fast and efficient processing on shared projects as well as monitoring the security of the projects. However, one of the major reasons for the emergence of Git is the remote repository access; the Git remote repository is available on the server and multiple contributors can make changes to it. Users can clone the remote repository to their machines and can retrieve required information from Git repository locally or it can help to do experimental analysis on the files of the repository without affecting its originality on the server. This cloning phenomenon allows to establish the connection between git remote repository and local repository; moreover, it also supports creating several clones of a single git repository so that multiple stakeholders can get access to the same project and can-do changes parallelly. The terminal support of Ubuntu can be used to add or remove the remote repositories as your local one.

  • How to make git local same as remote

    Git support of managing local and remote repositories has contributed to making computing a better experience. The remote repositories are managed on the server, whereas local repos are maintained on the machine and can be accessed without internet availability. Git offers two streaming supports: one is upstream, and the other is downstream; the upstream refers to where you clone your rep, and downstream allows you to integrate your work with other works.

    As Git is distributed version control software, working in a parallel manner may acquire the confusion state as there are several contributors making changes on a single project. Thus, it is recommended that the remote and local repositories must be synchronized to avoid any mishaps like you may require to fall back to some previous versions, which can be budget and time-consuming.

    While working in an environment where sometimes you have to make changes on remote, and you want that same changes must be present on your local repository as well. Keeping in view the importance of synchronization, we have prepared this guide to demonstrate the steps of keeping the local repository the same as remote...

  • How to output git log with first line only

    Git is one of the well-known repositories for version control systems and used widely among programmers to keep an eye on the changes being performed regularly. Sometimes, it is observed that fetching the history does not fulfill the purpose of it; so, you need to filter the content accordingly. Git provides this facility with its git log command; git log is used to display the content from history by filtering it according to the options provided.

    If you have a long list of commits and you want just basic information about commits; then the git log command provides a one line display of every commit. We have prepared this post to demonstrate the usage of git log command to get the output of commit in one line only: Let’s start this guide from general usage of git log followed by our targeted area:

  • Auto-Accepting in QSortFilterProxyModel

    In Qt 5.10, we added support for recursive filtering in QSortFilterProxyModel, which means keeping all parents of items matching the filter.

    One of the comments in the blog post about that feature was “Sometimes, you do not only want to show parents for a match (so the match is visible), you may (also) want to show children for a match”. This is indeed something I saw a need for, more than once. For instance, you filter a large tree for a project name but then you want to see all sub-tasks of that project as well, rather than see only those that contain the project name while those that do not are hidden.

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.