Found 1383 Articles for Open Source

Move all files except one on Linux

Satish Kumar
Updated on 03-Jan-2023 10:52:58

4K+ Views

Introduction If you're working with Linux, there might be times when you'll want to copy several files at once and then remove some of them later. We're going to take a closer at several different methods for achieving such results. Renaming The Unwanted File You can rename the unwanted file so that it becomes a “.” (dot) file means hidden files, which means that mv won't be able to see it. After renaming the unwanted file using the asterisks, we’ll then use the regular expression to remove the rest of the files. /source_dir$ mv file5 .file5 /source_dir$ mv * ~/target_dir/ ... Read More

Load Environment Variables in a Cron Job

Satish Kumar
Updated on 03-Jan-2023 10:51:02

5K+ Views

Overview When crontab runs a command, it doesn't read any environment variables from files like ~/.bashrc, ~/.bash_profile, etc. Because cron runs tasks from a non-interactive, non-login shell, it doesn't need an interactive user Some applications require environmental variables to function correctly. We’ll discuss different methods for loading environmental variables from a crontab. Setting the BASH_ENV Variable We can set environment variables for our shell scripts by using the BASH_ENV variable. We set it up so that when we run our jobs, they're executed by a shell script. We can set up our shell so that when we open a new ... Read More

How to use tmux on Linux?

Satish Kumar
Updated on 03-Jan-2023 10:48:43

346 Views

Overview Tmux is a terminal multiplexing utility for Unix systems. It provides an interface between several programs running simultaneously on one computer. Tmux allows us to detach from any terminal sessions without killing them. We can then reattached to any of the terminal sessions later on. We’ll learn the tmux terminal emulator in Linux. Specifically, we’ll examine some of its features and commands. Installation You can install tmui on Debian-based Linux systems using the apt-get package manager. $ sudo apt-get update -qq $ sudo apt-get install -y tmux We can also use the yum command line tool to download ... Read More

Top 10 Open-Source IoT Frameworks

Devang Delvadiya
Updated on 04-Jan-2023 13:26:01

1K+ Views

Introduction You might have heard about the internet of things (IoT), but what exactly is it? Simply put, IoT is the network of physical objects such as cars, appliances, industrial equipment, medical devices, and so on that are embedded with electronics, software, sensors, and connectivity that enables them to collect and exchange data. Overview of IoT Frameworks There are a few different ways to build your connected devices and applications when it comes to the Internet of Things (IoT). One option is to use a pre-made IoT framework, saving you time and effort in development. Let’s take a look at ... Read More

How to run Gunicorn on Docker?

Hemant Sharma
Updated on 28-Dec-2022 11:30:25

6K+ Views

In this article, we are going to learn about how to run Gunicorn on Docker. Before creating the docker container with the gunicorn functionalities, we must know some of the basics of web servers and gunicorn. Introduction to Gunicorn Let us suppose we have a web server that shows the output of a python code to the users. This web server will execute the python script each time a request came to it, this will cause it to restart, overload, and delay (heavy delay for huge scripts) in response. So the real problem here we have is a static server ... Read More

How to run amd64 Docker images on the arm64 host platform?

Hemant Sharma
Updated on 28-Dec-2022 11:34:07

9K+ Views

Before knowing how to run amd64 docker images on the arm64 host platform, we must know what this means. There is a term called multi-architecture or multi-platform docker container images. These images contain the ability to run on various base or host architectures provided at the time of containerization of the images. Need of Multiplatform images Suppose you are a DevOps engineer and you have to prepare a web-server for an IT company. You have an amd64 host platform but when you handed over the image to the company you came to know that the company only works on the ... Read More

How to pass command line arguments to a python Docker container?

Hemant Sharma
Updated on 31-May-2024 12:15:05

13K+ Views

Before getting into the docker container arguments we must know about python command line arguments and how they are accessed by the developer. Command line arguments are of great use when we want our python script to be controlled outside of the program. Access the python script’s command line arguments Step 1: Create a python script main.py Example # sys will allow us to access the passed arguments import sys # sys.argv[0] access the first argument passed that is the python script name print("File or Script Name is :", sys.argv[0]) # print arguments other than the file name ... Read More

How to Hot-Reload in ReactJS Docker?

Hemant Sharma
Updated on 28-Dec-2022 11:17:20

10K+ Views

Hot-Reloading is adding dynamic functionality to the react application on the web browser. This means if we change something in the code of the application it immediately reflects this change on the web application front. But before “reloading” anything we must know “loading”, that is to make some ReactJs project on the Node Docker container. Creation and Containerization of React App Step 1: React app Use the prebuild commands to create a basic react application. Example $npx create-react-app reactapp Output npx: installed 67 in 19.076s Creating a new React app in /home/hemant/project/reactapp. Installing packages. This might take ... Read More

How does the Docker network work?

Hemant Sharma
Updated on 28-Dec-2022 11:14:15

297 Views

The best feature of Docker is “Containerization and Networking.” Using containerization, we could create an independent and isolated environment for various use cases like web applications (“Apache”), database servers (“MongoDB”), and operating systems (“Ubuntu”). But the Docker network allows us to connect these containerized applications to communicate with each other or to the host operating system. Types of Docker Network present on Docker Daemon There are two types of networks on Docker − Default Docker bridge network User−defined network Default Docker bridge network This network is created on the host operating machine as soon as the Docker ... Read More

Exclude directories while using grep command?

Satish Kumar
Updated on 26-Dec-2022 12:07:25

4K+ Views

Overview We often run a grep command to look for specific strings of text within files. The grep command provides some additional functionality that makes the search even better. A feature that allows you to exclude certain directories from recurrence. This is useful when searching through large amounts of data. Grep can be used with the −r option which will allow you to specify multiple patterns and then use the −v option to show only those files that match your pattern. We’ll discuss the different ways to achieve this. Exclude Single Directory The simplest way to do this would be ... Read More

Advertisements