Servers

Learn and use fork(), vfork(), wait() and exec() system calls across Linux Systems

It is found that in any Linux/Unix based Operating Systems it is good to understand fork and vfork system calls, how they behave, how we can use them and differences between them. Along with these wait and exec system calls are used  for process spawning and various other related tasks.

Learn-fork-vfork-wait-exit-linux-systems

Most of these concepts are explained using programming examples. In this article, I will be covering what are fork, vfork, exec and wait system calls, their distinguishing characters and how they can be better used.

fork()

fork(): System call to create a child process.

[email protected] ~}$ man fork

This will yield output mentioning what is fork used for, syntax and along with all the required details.

The syntax used for the fork system call is as below,

pid_t fork(void);

Fork system call creates a child that differs from its parent process only in pid(process ID) and ppid(parent process ID). Resource utilization is set to zero. File locks and pending signals are not inherited. (In Linux “fork” is implemented as “copy-on-write()“).

Note:-Copy on write” -> Whenever a fork() system call is called, a copy of all the pages(memory) related to the parent process is created and loaded into a separate memory location by the Operating System for the child process. But this is not needed in all cases and may be required only when some process writes to this address space or memory area, then only separate copy is created/provided.

Return values:-  PID (process ID) of the child process is returned in parents thread of execution and “zero” is returned in child’s thread of execution. Following is the c-programming example which explains how fork system call works.

[email protected] ~}$ vim 1_fork.c
#include<stdio.h>
#include<unistd.h>
Int main(void)
{
printf("Before fork\n");
fork();
printf("after fork\n");
}
[email protected] ~}$ 
[email protected] ~}$ cc 1_fork.c
[email protected] ~}$ ./a.out
Before fork
After fork
[email protected] ~}$

Whenever any system call is made there are plenty of things that take place behind the scene in any unix/linux machines.

First of all context switch happens from user mode to kernel(system) mode. This is based on the process priority and unix/linux operating system that we are using. In the above C example code we are using  “{” opening curly brace which is the entry of the context and “}” closing curly brace is for exiting the context. The following table explains context switching very clearly.

Fork-vfork-system-calls-linux

vfork()

vfork –> create a child process and block parent process.

Note:- In vfork, signal handlers are inherited but not shared.

[email protected] ~}$ man vfork

This will yield output mentioning what is vfork used for, syntax and along with all the required details.

pid_t vfork(void);

vfork is as same as fork except that behavior is undefined if process created by vfork either modifies any data other than a variable of type pid_t used to store the return value p of vfork or calls any other function between calling _exit() or one of the exec() family.

Note: vfork is sometimes referred to as special case of clone.

Following is the C programming example for vfork() how it works.

[email protected] ~}$ vim 1.vfork.c
#include<stdio.h>
#include<unistd.h>
Int main(void)
{
printf("Before fork\n");
vfork();
printf("after fork\n");
}
[email protected] ~}$ vim 1.vfork.c
[email protected]i ~}$ cc 
0
Read More

The World Of Data

Whether big or small, data is undoubtedly a big part of our lives. And in this highly technologically-savvy world, data has become digital and proliferates the world both online and offline. With the growing number of data being shared on a daily basis, the issue on storage is a problem we always face especially if the storage capacity of your device can’t keep up with your data use. Gone were the days when devices have so little storage capacity, storage is much bigger now and you can always buy a secondary storage device if your device does not have enough storage space.

The use of flash drives and external hard drives have become the norm now. People usually purchase them for additional storage, so they can clear their device and add more files that will eventually be transferred to a secondary storage much later. Most tech users are always on the lookout for the best secondary storage at a reasonable price because it can free them of their constant worries of running out of storage space. Most external hard drives (EHDs) have bigger storage space now and they are generally reasonably priced too. They are fairly easy to use, so you won’t have any difficulty transferring your files from one device to the other.

The Seagate 8TB USB 3.0 desktop external hard drive is down to $129.99 on Amazon. This hard drive has been selling for around $150 since a drop in late September. Before that, it regularly sold for as much as $180. Today’s deal is the best price we’ve ever seen.

Seagate’s drive is meant to be as easy to use as possible. It has plug-and-play compatibility, so you can just immediately start using it, as well as drag-and-drop utility so it’s easy to get your data where you want it. It transfers at USB 3.0 speeds and is backwards compatible with USB 2.0. You’ll need to reformat it to get it to work with Mac. Users give it 4.6 stars based on 99 reviews.

(Via: https://www.windowscentral.com/thrifter-deal-grab-8tb-storage-130-seagate-desktop-hard-drive)

Data saved on a secondary storage will likewise stay safer because these devices are rarely used to connect to the web, so there is a slimmer chance that it will be infected by an online bug or a virus or the more popular malwares these days. Unlike your computer or smart device that you use in your day-to-day to connect to the web. Regular use can wear out your device that can lead to premature breakdowns and the dreaded data loss that follows. Many of your data are irreplaceable so saving it on a backup device is the most logical thing to do if you don’t want to deal with costly data recoveries that do not have a 100{c4f60b86d58bd0bb42d7d202d81274380459a85a5d81d139dd8bd0c48cc6a02e} assurance you’ll be able to retrieve your lost files.

Sometimes, there are always some important data on the external hard drive. Thus, you always ask these questions: is it possible to recover data from a formatted external hard drive? If it is possible, you may still ask: how to recover data from external hard drive becomes a recovery.

MiniTool Power Data Recovery is such a piece of data recovery software which can be used to recover data from different kinds of

0
Read More

Choose the Best WordPress Theme for your WordPress 5.0 Website

Content outline:

Intro
Review of the Best WordPress Themes for your WordPress 5.0 Website
Conclusion

Intro
Creating your own website is a finicky job that requires a lot of time and effort. No doubt, WordPress CMS greatly simplifies this process, making it accessible to any user with no coding skills. However, even in this case, you need to make sure you are choosing the right WordPress theme to meet your needs. You should consider not only its design but also compatibility, functionality, and some other parameters.
Since almost everyone is talking about WordPress 5.0 as the major version of WordPress with a new set of improvements and changes, let’s stop here and discuss WordPress 5.0 compatible themes. The new version of WordPress 5.0 uses a completely new editor – Gutenberg. The main features of this editor are delivering information in a form of blocks and enhanced editing. The new version of WordPress allows you to easily work with the widgets (shortcodes, comments, posts, and others) and experiment with the capabilities of the new editor.
How to choose the best WordPress theme for your WordPress 5.0 website? Collections of portfolio website templates offer various options to meet any need and budget. Sure thing, your WordPress theme should be Gutenberg-friendly to run smoothly on your site. Moreover, you should take care of 100{c4f60b86d58bd0bb42d7d202d81274380459a85a5d81d139dd8bd0c48cc6a02e} responsiveness to look great on any types of screens. Rich features and high customization options will help you bring your business to a new quality level.
Let’s check my list of the best WordPress 5.0 themes in details. Below each theme, I have included the most asked WordPress themes questions & answers. I am sure, beginners will find them useful. Let’s go. By the way, I would like to recommend another great resource for newbies MasterBundles has an excellent set of design bundles for all types of businesses.
Review of the Best WordPress Themes for your WordPress 5.0 Website

Monstroid2 – Multipurpose Modular Elementor WordPress Theme WordPress Theme

Details | Demo

Monstroid2 is a revolutionary solution to build a fully-fledged website with just a mouse in your hand. The theme is perfectly adaptable for mobile devices and cross-browser compatible. It is a great choice for both small business and corporate websites. The built-in Live Customizer will allow to easily change the available theme’s settings with a few clicks. You will be surprised by a high loading speed, numerous pages and ready-made section in Magic Button, lots of skins on different topics, and etc.
Main features:

Drag-n-Drop page builder
frequent and regular updates
user-friendly wizard
WooCommerce plugin
competent 24/7 support

***
Where to install WordPress themes?
In order to install a WordPress theme, take the following steps:
In your WordPress dashboard, go to Appearance > Themes > Add New.
From there you’ll see an option for “Upload” at the top of the screen. Click the “Browse” button, navigate your computer files and select the .ZIP file for your downloaded extension.

Hayford – Investment Consulting Services Responsive WordPress Theme

Details | Demo
Hayford belongs to the group of investment consulting services responsive WordPress themes. You will get access to numerous Google fonts and full control over the layout. Additional features include mobile compatibility, bonus images, WPML ready layout, and etc. Whether …

0
Read More

What’s New in WordPress 5.1

WordPress 5.0.3 version was released just a few months back. Putting a step further, the latest version of WordPress 5.1 is about to complete its initial 24 hours. Let’s check out all of the new features and updates!

The post What’s New in WordPress 5.1 appeared first on WPWebHost.

from WPWebHost.blog – WPWebHost https://wpwebhost.com/blog/whats-new-in-wordpress-5-1/…

0
Read More

WordPress Remote Code Execution Vulnerability

A remote code execution vulnerability has been detected in WordPress which is not an overnight issue but was unveiled for 6 years. Due to this, a hacker can grab the author privileges with the access to login credentials of the users.

The post WordPress Remote Code Execution Vulnerability appeared first on WPWebHost.

from WPWebHost.blog – WPWebHost https://wpwebhost.com/blog/wordpress-remote-code-execution-vulnerability/…

0
Read More

A New Look For The Apple Mac And iPads

For decades, Apple has reigned supreme in the world of technology and almost everybody is fine with it since they gifted us with some of the best and most advanced devices that are now widely used today and has been the inspiration for competitors to embrace smart technology. For many, Apple is synonymous with class, elegance, sophistication, luxury, you name it. People are always on the lookout for the next line of Apple products because it sets the bar in the industry that competing brands must either follow in order to stay relevant or overshadow to dominate the market.

When it comes to smartphones, it is still a close match between iPhones and the Samsung smartphones with the two brands having a loyal group of customers who patronize their products. Apple has maintained its edge in the field of smartphone but over the years has lost its edge in computers. The Mac is still a legend in its own right but many complain that its hardware is a bit outdated compared to newer Window models right now. It is about to change as Apple just recently launched new Macbook Air, Mac mini, and iPad pro versions.

As Apple rolled out updated products at its event in New York on Tuesday, analysts quickly noticed a pattern. New versions of the company’s iPad Pro, Mac mini, and MacBook Air all had impressively improved features—along with higher prices than what they replaced.

The new entry-level iPad Pro got a larger screen, faster processor, and lost its home button in favor of Apple’s high security facial recognition login system, Face ID. But its starting price jumped to $799 from its predecessor, which cost $599.

Likewise, the revamped MacBook Air got speedier and comes with a higher resolution screen than what it replaced, circa 2015. But the new laptop starts at $1,199 versus $999 for the older model, which Apple will continue to sell at that price—at least for now.

(Via: http://fortune.com/2018/10/30/apple-ipad-pro-higher-price-mac/)

The world is always attentive to any new releases coming from Apple and this is no exception especially that they are basically revamping their computing line with enhanced features to ensure they not only stay competitive in the computer and tablet market but still take the lead like they should have being the innovators that they are and all. All these hardware and software upgrades and fancy new features also come at a price, which is not surprising knowing these are Apple products. All three look differently and works way better than it used to and the only challenge here is its price considering that other brands enhance the features of their devices without significantly raising their prices.

According to Apple, the new Mac Mini will be around five times faster than its predecessor, though considering the age of the older one that’s not quite as impressive as it sounds. The Apple T2 security chip is present here too, as well as four Thunderbolt 3 ports, two USB-A ports, HDMI video and audio out, and the option of a 10 Gb Ethernet connection for the fastest internet speeds.

Despite all these improvements, the size of the Mac Mini stays the same as before – think an over-sized Apple TV. Prices for the

0
Read More

8 Things You Should Look for In a Managed WordPress Hosting Provider

What makes choosing the right one difficult is that it isn’t just about comparing statistics and tech advantages but also fitting the right one for your needs. Picking the wrong web host can bring you a whole slew of problems so what can you do to find the best fit for you?

The post 8 Things You Should Look for In a Managed WordPress Hosting Provider appeared first on WPWebHost.

from WPWebHost.blog – WPWebHost https://wpwebhost.com/blog/8-things-you-should-look-for-in-a-managed-wordpress-hosting-provider/…

0
Read More

Quick guide to Install and Configure Ceph (Distributed Storage) Cluster on CentOS 7

Ceph is free and open source distributed storage solution through which we can easily provide and manage block storage, object storage and file storage. Ceph storage solution can be used in traditional IT infrastructure for providing the centralize storage, apart from this it also used in private cloud (OpenStack & Cloudstack). In Red Hat OpenStack Ceph is used as cinder backend.

Install-Configure-Ceph-Cluster-CentOS7

In this article, we will demonstrate how to install and configure Ceph Cluster(Mimic) on CentOS 7 Servers.

In Ceph Cluster following are the major components:

  • Monitors (ceph-mon) : As the name suggests a ceph monitor nodes keep an eye on cluster state, OSD Map and Crush map
  • OSD ( Ceph-osd): These are the nodes which are part of cluster and provides data store, data replication and recovery functionalities. OSD also provides information to monitor nodes.
  • MDS (Ceph-mds) : It is a ceph meta-data server and stores the meta data of ceph file systems like block storage.
  • Ceph Deployment Node : It is used to deploy the Ceph cluster, it is also called as Ceph-admin or Ceph-utility node.

My Lab setup details :

  • Ceph Deployment Node: (Minimal CentOS 7, RAM: 4 GB, vCPU: 2, IP: 192.168.1.30, Hostname: ceph-controller)
  • OSD or Ceph Compute 1: (Minimal CentOS 7, RAM: 10 GB, vCPU: 4, IP: 192.168.1.31, Hostname: ceph-compute01)
  • OSD or Ceph Compute 2: (Minimal CentOS 7, RAM: 10 GB, vCPU: 4, IP: 192.168.1.32, Hostname: ceph-compute02)
  • Ceph Monitor: (Minimal CentOS 7, RAM: 10 GB, vCPU: 4, IP: 192.168.1.33, Hostname: ceph-monitor)

Note: In all the nodes we have attached two nics (eth0 & eth1), on eth0 IP from the VLAN 192.168.1.0/24 is assigned . On eth1 IP from VLAN 192.168.122.0/24 is assigned and will provide the internet access.

Let’s Jump into the installation and configuration steps:

Step:1) Update /etc/hosts file, NTP, Create User & Disable SELinux on all Nodes

Add the following lines in /etc/hosts file of all the nodes so that one can access these nodes via their hostname as well.

192.168.1.30    ceph-controller
192.168.1.31    ceph-compute01
192.168.1.32    ceph-compute02
192.168.1.33    ceph-monitor

Configure all the Ceph nodes with NTP Server so that all nodes have same time and there is no drift in time,

~]# yum install ntp ntpdate ntp-doc -y
~]# ntpdate europe.pool.ntp.org
~]# systemctl start ntpd
~]# systemctl enable ntpd

Create a user with name “cephadm” on all the nodes and we will be using this user for ceph deployment and configuration

~]# useradd cephadm && echo "[email protected]#" | passwd --stdin cephadm

Now assign admin rights to user cephadm via sudo, execute the following commands,

~]# echo "cephadm ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/cephadm
~]# chmod 0440 /etc/sudoers.d/cephadm

Disable SELinux on all the nodes using beneath sed command, even ceph official site recommends to disable SELinux ,

~]# sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux

Reboot all the nodes now using beneath command,

~]# reboot

Step:2 Configure Passwordless authentication from Ceph admin to all OSD and monitor nodes

From Ceph-admin node we will use the utility known as “ceph-deploy“, it will login to each ceph node and will install ceph package and will do all the required configurations. While accessing the Ceph node it will not prompt us to enter the credentials of ceph …

0
Read More

How Technology Affects Mother Nature

The planet is going through so many difficulties right now because of human abuse and misuse of resources. The continuously increasing human population is likewise putting too much strain on the planet and the rapid advancements in technology do not help either. While many of us feel relieved that manual labor is no longer a must in most of the things we do since almost everything is automated now, we fail to realize its negative effects to Mother Nature.

As our digital footprint increases, so does our carbon footprint. We burn fuel in running our tech devices and equipment and the more gadgets we use, the more fuel we likewise burn. It does not help that we are now heavily addicted to social media, online games, online streaming, etc. that we can’t just slow down with our tech use. We become increasingly reliant on these contrivances not only for work or study but to keep us entertained 24/7. More often than not we get stressed at technical difficulties we face like hardware failure or data loss and would not hesitate to spend hundreds to thousands of dollars on services like https://www.harddrivefailurerecovery.net/how-flat-rate-data-recovery-pricing-works/ and https://www.harddrivefailurerecovery.net/do-your-data-recovery-for-mac-a-nice-tool/ rather than worry about the hazards these new technologies pose to human life.

Watching your favourite show or listening to your playlist has never been easier.

A virtually endless supply of film, music and TV can be streamed and downloaded almost instantly.

But at what cost to the environment?

Vast amounts of energy are needed to keep data flowing on the internet and demand will only increase as our reliance on digital services grows.

Some of that energy is generated from clean energy sources, but much of it comes from burning carbon-based fossil fuels, which scientists believe is a contributing factor to rising global temperatures.

The latest report by climate scientists demonstrates the scale of the dangers faced from carbon emissions.

(Via: https://www.bbc.com/news/technology-45798523)

Most technologies burn fossil fuel for energy and they contribute to global warming and the increasing threats of global warming. This is the major issue these days as the world becomes addicted to all sorts of gadgets in our day-to-day. Even the mere act of charging your numerous devices daily contributes to the rise of the world’s carbon footprint and no need to look far just to see its extent because in your homes alone you can see the number of devices that need charging daily.

One of our favorite hobbies these days is online streaming as Internet advancements enable most homes to have a readily available WiFi connection. Keeping the WiFi all day long also eats up energy. Our new habits should warn us of these dangers and burden that Mother Nature has to endure moving forward.

What do you do when you love a blockchain project and also want to preserve the environment? This question has crossed the minds of many crypto enthusiasts who are also aware of the increasing global warming effect brought about by increased carbon emissions from power generating plants (coal and diesel plants). More so, when you consider that Bitcoin mining activities have on many occasions been highlighted as a contributor of Carbon Dioxide in the atmosphere due to the amount of electrical energy used to mine

0
Read More

VeePN Review – Quality VPN with Useful Features

VeePN is a popular VPN provider with unique features and location options. Read our detailed review here. About VPNs and VeePN We’re sure you already know what a VPN is. If you don’t, this page by VeePN will explain it well. Even if you don’t care about your privacy (you should!) you can still use […]

Source

from ThisHosting.Rocks https://thishosting.rocks/veepn-review/…

0
Read More