Programming Leftovers
-
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.
- Login or register to post comments
- Printer-friendly version
- 2862 reads
- PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
digiKam 7.7.0 is releasedAfter 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. |
Dilution and Misuse of the "Linux" Brand
|
Samsung, Red Hat to Work on Linux Drivers for Future TechThe 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. |
today's howtos
|
Recent comments
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago