Command # du -hsx * | sort -rh | head 15
Description:
du -hsx * – check file sizes in directory
Sort -rh – sort files by highest size
head 15 – shows 15 line output or files with size
Thats it…!!
Command # du -hsx * | sort -rh | head 15
Description:
du -hsx * – check file sizes in directory
Sort -rh – sort files by highest size
head 15 – shows 15 line output or files with size
Thats it…!!
Remove Tomcat application WEB URL without context or application name.
Like,
URL : linuxsysad.abc.com/tomcatapp
tomcatapp name is example of our tomcat application. (Don’t take seriously ).
What we are going to do ?
We changed web URL linuxsysad.abc.com/tomcatapp to linuxsysad.abc.com (Without tomcatapp application name).
Tested in Centos7
nginx
tomcat 9
No changes required in existing Nginx tomcat configuration file.
Changes required in server.xml in tomcat server directory.
Tomcat server configuration file path: /website_dir/tomcat/conf/server.xml
Open server.xml file in your feveroit editor and
find below lines, (Moslty line number 152)
<Host name=”localhost” appBase=”webapps”
unpackWARs=”true” autoDeploy=”true”>
replaced with below line. Kindly make sure change path as per your configuration or path.
put your hostname and tomcat webapp path.
<Host name=”linuxsysad.abc.com” debug=”1″>
<Context path=””
docBase=”/web/tomcat/webapps/tomcatapp”/>
Save & exit file.
Now restart tomcat service.
All done..!
Issues occurred in Cantos 7, while terminating process.
Error: killall: command not found
Solution:
Install package.
For CentOS 7 :
# sudo yum install psmisc
For Ubuntu :
# sudo apt install psmisc
Done..!
Tested in CentOS 7
How to approve mailman pending moderated message or email to a moderated mailman list from the command line.
Go to mailman installed directory.
In our case it is /usr/lib/mailman
Go to Mailman bin directory located in installed mailman directory.
# cd /usr/lib/mailman/bin
In bin directory you can find list of command line scripts for mailman.
Now carefully run below commands.
We are going to use list_requests & withlist scripts to approve pending moderation emails.
All scripts run with ./ command. like ./list_requests.
To check pending moderated emails or messages from mailing list.
sample command : ./list_requests –verbose –list=LISTNAME
Were LISTNAME is the name of mailing list or mailng group where request are pending for moderation.
In our case mailing list name is AUDIT.
# ./list_requests –verbose –list=audit
It will shows pending request output as below. We have 2 pending post in audit mailing list.
Pending posts:
From: user01@gmail.com on Fri Aug 9 15:40:27 2021
Subject: Re: THIS IS LINXSYSAD BLOG
Cause: Post by non-member to a members-only list
237 <—– We need this id to release this mail from pending moderation.
Pending posts:
From: user2@gmail.com on Fri Aug 9 15:40:27 2021
Subject: Re: THIS IS LINUXSYSAD BLOG
Cause: Post by non-member to a members-only list
312 <—– We need this id to release this mail from pending moderation.
Next, we will run ./withlist script, it will open shell prompt for inputs.
# ./withlist -l audit
It will show below output
Next, type below line. output will be blank.
# from Mailman.mm_cfg import APPROVE
Next, type below command with pending mail unique ID
# m.HandleRequest(237, APPROVE)
237 is the mail unique ID, we get this ID from list_request command.
# m.HandleRequest(312, APPROVE)
312 is the mail unique ID, we get this ID from list_request command.
Next, save the state of the list with below command.
# m.Save()
Once save command is done pending mails will be sent. Press Control+D to exit terminal.
All above commands look like below image.
That’s It.. Pending mails should be sent after this all commands.
LVM – Logical Volume Manager
=======================
Tested in CentOS 7.
Physical Hard Drive ==> Physical Volume ==> Volume Group ==> Logical Volume ==> File-system ==> Mount point
LVM is disk management solution, to manage disk space more effectively.
LVM allow ADD , RESIZE , REMOVE volume size online in the existing volume without taking any downtime.
Basic idea about how to create LVM in linux.
Create Physical Volume.
# pvcreate /dev/sdb /dev/sdc
To view the physical volume (PV) information.
# pvscan
PVdisplay command to view physical volume (PV) size, physical extend size, free space etc.
only pvdisplay command shows all pysical volumes in system. if want to view saperate physical volume run below command.
# pvdisplay /dev/sdb
Create Volume group (VG) over physical volume (PV).
# vgcreate vgdata /dev/sdb /dev/sdc
Display newly created volumegroup vgdata.
Parameters used : -v for verbose
# vgdisplay -v vgdata
Please note, Physical extent PE default size is 4 MB
What is Physical Extents PE ?
Physical volume is divided chunks of data, known as physical extents, these extents have the same size as the logical extents for the volume group.
Create Logical Volume (LV) over Volume Group (VG).
Parameters used : -L for specify volume size in G(GB), M(MB)
-n for specify Logical volume name.
# lvcreate -L 1GB -n lvdata vgdata
Display Logical volume information. (in /dev vgdata direcotry created after lvcreate command. we need to spacify path to check LV info )
# lvdisplay -v /dev/vgdata/lvdata
Lets create filesystem or format our new logical volume(LV) for use.
Parameters Used: mkfs.ext4 for format LV in linux ext4 filesystem.
# mkfs.ext4 /dev/vgdata/lvdata
Lets mount our new LV on /mnt/data directory.
# mkdir /mnt/data
# mount /dev/vgdata/lvdata /mnt/data
Check mounted Logical volume using df -h command.
# df -h
🙂👍