Delete command history with last command
this command will remove commands history with itself in an given offset as well
for h in $(seq 1968 1975); do history -d 1968; done; history -d $(history 1 | awk '{print $1}')
this command will remove commands history with itself in an given offset as well
for h in $(seq 1968 1975); do history -d 1968; done; history -d $(history 1 | awk '{print $1}')
Gzip
Compress a file with gzip
$ gzip filename
Compress and keep the original file
$ gzip -c file > file.gz
Compress all files in a folder
$ gzip -r foldername
Tar.gz
$ tar -czvf filename.tar.gz directory
ZSTD Compression
Install first the package,
$ sudo apt install zstd
(Debian/Ubuntu)
$ dnf install zstd
(Centos,AlmaLinux,Fedora,Redhat)
Usage:
to compress a file :
zstd example.txt
Using with tar:
tar --zstd example.tar.zst example/
ZSTD Uncompression
tar --use-compress-program=unzstd -xvf archive.tar.zst
A memory corruption vulnerability (CVE-2021-4034) in PolKit, a component used in major Linux distributions and some Unix-like operating systems, can be easily exploited by local unprivileged users to gain full root privileges.
Patch for Ubuntu is Available
https://ubuntu.com/security/notices/USN-5252-1
If you don’t have any patch please remove suid bit from pxexec tool with this command
chmod 0755 /usr/bin/pkexec
When you use lvm and still have free space on a virtual or physical disk,you can extend your lvm partition to use all free space.
Firstly you should be sure it exists.
Type “vgdisplay” command in root shell.You should see some free space in “Free PE Size”
After that you should type this command “lvextend -l +100%FREE /dev/volgroup/logvol”
After it finishes type resize command according to your file system.
For XFS : xfs_growfs /dev/centos/logvol
For EXT4: resize2fs /dev/centos/logvol
Attention : “logvol” word represents your logical volume.You can see its name in vgdisplay command output.
Install the quota tools on your server.(debian – ubuntu)
sudo apt install quota
Edit your fstab file under etc folder:
/dev/sda1 / ext4 usrquota,grpquota 0 0
and remount it to take effect immediately:
sudo mount -o remount / (or whereever you want to enable)
Enable quota.This command will create two files on file system like /aquota.user and /aquota.group :
sudo quotacheck -ugm /
Activate the quota
sudo quotaon -v /
If you use debian or ubuntu,you should install the package first.
apt-get install curlftpfs
After the installation,create a folder where will you mount to.for example /mnt/rftp
sudo mkdir /mnt/rftp
curlftp’s format and its parameters are simple.for example,we have an ftp account like olriss and password: 123x4P at 192.168.1.199
in local server,mount remote ftp with using this command
curlftpfs olriss:123x4P@192.168.1.199 /mnt/rftp/
curlftps is similar to nfs tools so you can review the mounted ftp area in your mounted drive list.so check it with “mount -a” command.
after your work is finished,you can unmount it with similar way as nfs unmounting.You won’t need all parameters to unmount,You just unmount the folder like below,
umount /mnt/rftp
On Vmware Esx server,You can increase size of your virtual hard disk easily.If you use lvm for your guest os,you will need to add new virtual hard disk or just increase the size of your current disk.This guide will help you to extend size of the disk after you resize of your virtual disk by using vsphere
After increased the size on ESX ,In Linux Terminal;
rescanning the device.host id can change and it depents to your system.you must do that if you dont want to restart your guest;
echo “- – -” > /sys/class/scsi_host/host0/scan
see your disk and partitions;
fdisk -l
lets add new partitions.after you create the partition,you will need to set type of disk to 8e (LVM)
cfdisk /dev/sda (please note your new partition name sample :sda3
see your disk&partitions status again;
fdisk -l
check for available space;
df -h
scan for new partition
partprobe
create physical volume by using new partitions.(disk name may differ.)
pvcreate /dev/sda3
see your volume group and check and confirm
vgdisplay
extend your volume group
vgextend centos /dev/sda3
recheck;
pvscan
extend your logical volume with using the new part
lvextend /dev/centos/root /dev/sda3
in this point,last step may change according to your file system.if you use xfs ;
xfs_growfs /dev/centos/root
for ext4
resize2fs /dev/centos/root
finally see your new available space
df -h
You can manage hosting limits or reseller limits by using lve manager extension (module) inside the plesk hosting control panel.It is useful because you can set some limits to your hosting accounts by using plesk ui.But if you login to plesk with using HTTP,some errors will be occur.Therefore, you must login to plesk with https protocol to work with this extension properly
Related Error Message
Platform error.It seems your session expired.Please login into the platform.You will be redirected to login page.
Error.Bad forgery protection token
For Centos Servers;
Please add these lines to the end of /etc/httpd/conf.d/ssl.conf file and restart httpd service
<IfModule mod_ssl.c>
SSLProtocol +TLSv1 +TLSv1.1 +TLSv1.2 -SSLv2 -SSLv3
</IfModule>
<IfModule mod_ssl.c>
#SSLCipherSuite HIGH:!aNULL:!MD5:!RC4-SHA:!RC4
#SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RS
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5::!RC4
</IfModule>
This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.
OKLearn moreWe may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.
Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.
These cookies are strictly necessary to provide you with services available through our website and to use some of its features.
Because these cookies are strictly necessary to deliver the website, refuseing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.
We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.
We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.
We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.
Google Webfont Settings:
Google Map Settings:
Google reCaptcha Settings:
Vimeo and Youtube video embeds:
You can read about our cookies and privacy settings in detail on our Privacy Policy Page.
Privacy Policy and Terms of Use