Author: Sohail Qamar

recover lv

Recover LV or VG after running lvreduce, lvremove, lvresize

Before applying a change to a logical volume (LV), it automatically creates a backup of the volume group (VG) and even an archive of the logical volume on which the operation is performed. This enables the restoration of the lost logical volume from the archive.

  • To restore the LV, first fund the LV in the archive. In the below command, [VG] is the name of the volume group from which you want to restore LV. This command will display all available backups for the VG.

# vgcfgrestore -l [VG]

  • Grep the string ‘command_executed’ from the output of the above command by appending the grep command as follows.

# vgcfgrestore -l [VG] | grep -A2 -B2 "<command_executed>"

  • Copy the filename of backup that is your logical volume. You can pinpoint your required LV by reading the description and timestamps.
  • Test the archive using the following command.

# vgcfgrestore --test -f <archive_file_path_here> [VG]

  • Finally, restore LV/VG as follows.

# vgcfgrestore -f <archive_file_path> <VG name>

  • Unmount the volume, reboot the server, and remount volume

e commerce

What is Dynamic Pricing & How It Works

Car drivers are all too aware of this. At the gas station, prices change several times a day, sometimes even while you are filling up gas in your car. This is one typical example of dynamic pricing, a tool that dates back to the dawn of commerce. Dynamic prices, which can be adjusted flexibly to any market situation, allow you to manage the revenue generated by your services and products.

Dynamic price management is currently gaining attention in online retail, but it has long been standard practice in pricing flights, travel, and lodging. For example, factors such as capacity utilization, season, time, and competitor behavior influence the price. Even in traditional retail, digital shelf displays are increasingly replacing traditional price tags, allowing pricing to become more flexible and automated.

How dynamic pricing works?

There are numerous other examples of dynamic pricing in everyday life: Fruit that has been left on the supermarket shelf for an extended time is usually sold at a reduced price. We can thank flexible prices when fuel prices rise just in time for holidays, and hill station hotels become more affordable in cold weather. A dynamic price adjustment can also be seen when regular customers receive a discount. Many ski resorts offer discounts to entice visitors in bad weather, and ticket prices for game matches, for example, often vary depending on a particular day, weather, chances of winning, or appeal of a game in the United States.

These examples mainly deal with well-known dynamic pricing models that almost everyone encounters daily. In all of these examples, the price fluctuates over time, depending on the competition or strategic considerations and factors that the retailer deems appropriate for increasing profit or improving customer retention – ideally both simultaneously.

The strategies vary, but the goals are usually the same: in addition to maximizing profit, providers use dynamic prices to increase customer retention – for example, through discounts. After all, customers are likely to return if they believe they are getting a good deal.

Big data and dynamic pricing

More significant opportunities for dynamic pricing are emerging as a result of digitalization. Big data is the key, and thanks to data-driven marketing, fully automated real-time analyses are no problem.

Dynamic price management in e-commerce is frequently based on algorithms that analyze customer data. Major online retailers do have access to the data of millions of customers, which analysis programs can use. When combined with current market events, this data can be used to adjust prices to supply and demand, either manually or automatically – on a broad scale, for specific target groups, or even for individual customers. A variety of different strategies can be used in this situation. The algorithms themselves are usually kept under wraps, which is understandable given their importance to business success.

Examples of dynamic pricing

According to the strategy, a look at the sales figures reveals which products are currently popular and purchased over others, leading to a price increase to maximize profit. The following is always a good question: What is the current level of the customer’s willingness to pay? This can be known by using the clues provided by big data.

Let us take a different approach. To beat the competition, a popular product is reduced in price so that customers buy it from the lower-cost provider. Accessories are frequently offered to the buyer simultaneously as dynamically raised prices (sometimes sharply). If a customer is in the middle of a purchase and finds a good deal, they are likely to buy an accessory as well – even if the price is significantly higher. Their incentive to compare prices with competitors who already offered the product they wanted at a higher price is low.

Ideally, this allows the merchant to sell more products using targeted, dynamic pricing models and increase profit by selling accessories at a higher price while the customer feels they have found a good deal. In most cases, this is the case, and it improves customer retention.

Prices for personalized services?

Prices can even differ from one customer to the next because every online customer’s habits, interests, demographic data, and behavioral patterns can all be used to draw valuable conclusions. A personalized price refers to the fact that different customers viewing the same product simultaneously receive their special price. The goal is to make the best possible use of their maximum willingness to pay at any given moment. This dynamic pricing is frequently based on data-driven marketing mechanisms.

Consider the following scenario: Anyone who surfs on the go with a high-end smartphone may pay an increased price for products when shopping online simply because of dynamic pricing. A similar analysis tool could classify users of expensive devices as having the ability to pay higher prices in general. If these users have previously purchased expensive products, this trend may continue, resulting in higher personalized prices.

Manufacturers and merchants have much leeway in terms of pricing models, and they can also undercut competitors. Free pricing is one of the fundamental pillars of the market economy. Only a few legal exceptions exist, such as set book prices. Prices that are dynamically adjusted, as well as individualized prices, are generally permitted.

How to avoid dynamic pricing?

Dynamic pricing models can be found in almost every industry. It is often impossible to avoid flexible prices – for example, seasonal factors like the run-up to Christmas cause prices to rise before falling. We also benefit from flexible pricing in many cases, such as discounts for loyal customers or the beach lounger mentioned earlier, which becomes cheaper in lousy weather. Therefore, dynamic prices can be beneficial to consumers, even if they appear to be beneficial only to businesses.

We cannot avoid dynamic pricing when shopping with large online retailers like Walmart. However, there are certain ways that can help to avoid paying peak e-commerce prices. The issue is that the algorithms’ inner workings are largely unknown. As a result, the advice provided here is based on observations and indicators. As a result, the success of the algorithms may vary depending on how they are designed and adapted.

Date and time of day

When shopping online, keep the time of day in mind. When many people are shopping on weekends and evenings, prices can skyrocket. When fewer customers are browsing during the day on weekdays, prices drop dramatically. They frequently differ from weekday to weekday.

Compare service providers

Compare the costs of various providers. Price comparison websites are a valuable tool for this, but they can struggle to keep up if providers change their prices too frequently or too quickly. If you go to a merchant through a price comparison website, you may get a lower personalized price – after all, the merchant wants to rank as high as possible on the comparison portal, so they may have to lower the listed price there.

Electronic vouchers or voucher codes are frequently used to entice customers by significantly lowering the purchase price of products and services. These vouchers can sometimes be found by using a search engine and entering the product and manufacturer’s names, as well as the word “voucher.” If you use a valid voucher with the appropriate online merchant, the generated price will be reduced. Any potential buyer who obtains these vouchers from third-party providers, on the other hand, usually pays with their personal information. You must, as always, balance the benefits and drawbacks.

Observe

Examine a product’s price over several hours, days, or even weeks – the differences can be significant. Ask your friend to look at the same product to see if there are any price differences due to personalized prices. If this is the case, the person with the lowest price can place the order.

However, be aware that if a third party purchases something for you online or if you purchase something for someone else, the database will be impacted. If you buy expensive items for someone else, an algorithm may mistakenly believe you are more willing to pay than you do. While shopping online in the future, you may see higher personalized prices for products and services.

image

How to grow an XFS filesystem with pvcreate, vgextend, lvextend and xfs_growfs commands?

The methods below show how to extend a Volume Group (VG), a Logical Volume (LV), and a filesystem with a Physical Volume designated /dev/sda. (PV).

  • Create a PV from a free disk or partition (e.g., a partition named /dev/sda1):

# pvcreate /dev/sda1

  • Extend the VG name vg. /dev/sda1 is the existing PV path.

# vgextend vg /dev/sda1

  • Extend the LV and resize the underlying filesystem at the same time (the existing LV path is /dev/vg/lv00), which will be expanded by 150 GB.

# lvextend -r -L +150G /dev/vg/lv00

If you don’t run resize2fs or xfs_growfs on the block device after growing the Logical Volume, the file system size will be the same as it was before. To make use of the LVM’s extra capacity, use resize2fs or xfs_growfs to fill the partition with the current file system. You can now see the extended size of the file system in the df command output after resizing the file system.

apache

How to change the ownership of httpd process?

  • The owner and group of httpd-related processes is “apache” by default, as set in the apache configuration file (httpd.conf) shown below.

User apache
Group apache

  • You can confirm the user name and group of httpd process by using the ps command as follows.

$ ps -aux | grep httpd
root 9773 0.0 0.0 4520 685 pts/3 R+ 19:19 0:00 grep --color httpd
root 9773 0.0 0.5 18564 5736 ? Ss Aug19 0:00 /usr/sbin/httpd
apache 9773 0.0 0.2 18564 3068 ? S Aug19 0:00 /usr/sbin/httpd
apache 9773 0.0 0.2 18564 3068 ? S Aug19 0:00 /usr/sbin/httpd

  • If you want to change the owner of the httpd, simply edit /etc/httpd/conf/httpd.conf and replace the User and Group directives with any other user/groupd.

User newuser
Group newgroup

  • Restart apache httpd service.

systemctl restart httpd

  • Confirm the modification as follows.

ps -aux | grep httpd

intel

14th-generation Intel Meteor Lake CPUs have already been spotted in an early photo

Meteor Lake processors, which will be Intel’s 14th-generation chips (following Raptor Lake) and are due in 2023, have already been spotted and photographed, or at least test versions of the chips have.

A close-up capture of a wafer of Meteor Lake test chips (see below), quite possibly of the M-Series, in this first sighting of Meteor Lake, which will be the first of Intel’s CPUs to blaze onto 7nm (finally) (low-power models).

meteor lake

Intel previously stated, manufacturing will begin in 2022, and shipping will begin in 2023 (recall that Meteor Lake was ‘taped in’ in May 2021, indicating that all separate design elements of the CPUs were complete at the time).

Sapphire Rapids’ next-generation Xeon Scalable processors for servers were also spotted during Intel’s Fab 42 in Arizona. We also learned about Sapphire Rapids-X high-end desktop (HEDT) chips earlier this week and how they’ll be available in Q3 of 2022.

Another exciting sign that Intel is on track for its Meteor Lake launch in 2023 is the discovery of test chips.

These 14th-gen processors will be based on the Intel 4 process (7nm EUV), which is expected to provide a significant performance boost of 20% over the Intel 7 (Enhanced SuperFin) used in current-gen Alder Lake chips. A refresh of the latter is expected to bridge the gap between Intel 7 and Intel 4, which, as previously stated, will be Raptor Lake 13th-gen.

Raptor Lake (along with Sapphire Rapids-X) is set to launch in Q3 of 2022, and it could be a significant step forward in terms of power efficiency.

How to connect to/setup VNC via tunnel over SSH

If you want to connect to vnc via an ssh tunnel, you must have a user account on the machine running vnc server. You should also know that which display the vnc server is running. These details can be found in /etc/sysconfig/vncservers or via the ps command output.

  • Use the following SSH command to connect to vnc server.

ssh -L 590X:127.0.0.1:590Y -N -f -l user-name server-name

  • Make sure to replace Y in the above command with the display number on which vnc server is running. With the new versions of vncviewer, you can create ssh-tunnel with the -via flag.

vncviewer -via user-name@server-name server-name:1

How to restrict the maximum simultaneous ssh logins from a specific user on AlmaLinux, CentOS

  • There should be pam_limits.conf module present in /etc/pam.d/system-auth. On older systems, this entry must also be in system-auth and password-auth files.

grep limit /etc/pam.d/system-auth
session required pam_limits.so

  • Add maxlogins entry in /etc/security/limits.conf as follows:

username hard maxlogins 'number of max logins'

  • Enable PAM in /etc/ssh/sshd_config file as follows:

UsePAM yes

vnc kali

How to Install and Configure VNC on Kali Linux 2020.2 and Debian 9

These steps have been tested to install VNC on Kali Linux and Debian 9. You may encounter errors in installing tightvncserver with apt-get. This guide covers this issue.

  • Login to your server as root.
  • Install VNC server with apt-get install tightvncserver
  • If you get the following error, then you can install tightvncserver from Debian 9 or Kali installation ISO image.

root@server:/home/user# apt install tightvncserver -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package tightvncserver is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'tightvncserver' has no installation candidate

  • To install tightvnc from ISO image, Mount Debian or Kali image on /media/cdrom with mount -t iso9660 /dev/sr0 /media/cdrom -o loop

tightvnc .deb packages [tightvncserver_1.3.9-9.1_amd64.deb xtightvncviewer_1.3.9-9.1_amd64.deb] is located in /media/cdrom/pool/main/t/tightvnc

  • Change directory to /media/cdrom/pool/main/t/tightvnc with cd /media/cdrom/pool/main/t/tightvnc
  • Install tightvncserevr with dpkg -i tightvncserver_1.3.9-9.1_amd64.deb
  • Edit xstartup in /home/youraccount/.vnc/xstartup with vi and add following code:

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey &
vncconfig -iconic &

  • Start vnc server by executing the following command:

vncserver

  • You will be prompted to enter and verify vnc password. Make sure your password is less than 8 characters else it will be truncated to 8 characters.
  • After vnc password is set you will have the option to set a view-only password which is optional.
  • You may kill any instance of vncserver by executing commands vncserver -kill :1
  • ~/.vnc/xstartup must have executable permission set. You may set these permissions with the command chmod +x ~/.vnc/xstartup
  • If you did the above steps correctly, TightVNC server is already running on your server waiting for an incoming connection.
  • To connect to vnc server from your local PC, install Tight vnc viewer. Open vncviewer and enter the IP address and listening port on the server 87.79.209.99::5906
  • If your vncserver is listening on port :1 then you should enter 87.79.209.99::5901