User Tools

Site Tools


bash_oneliners

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
bash_oneliners [2020/06/10 15:27] adminbash_oneliners [2025/08/06 12:07] (current) admin
Line 29: Line 29:
 <code> <code>
 free && sync && echo 3 > /proc/sys/vm/drop_caches && free free && sync && echo 3 > /proc/sys/vm/drop_caches && free
 +</code>
 +  * rescan all SCSI buses
 +<code>
 +for i in /sys/class/scsi_host/host{0..32}/scan; do echo "- - -" > $i; done
 +</code>
 +  * enlarge LVM
 +<code>
 +fdisk /dev/sdk
 +#set partition type to Linux LVM (type 8e)
 +pvcreate /dev/sdk1
 +vgextend VolGroupDB /dev/sdk1
 +lvextend -l +100%FREE /dev/mapper/VolGroupDB-data
 +resize2fs -p /dev/mapper/VolGroupDB-data
 +#for xfs use xfs_growfs /dev/mapper/VolGroupDB-data
 +parted -a optimal /dev/sdc mklabel gpt
 +parted -a optimal /dev/sdc mkpart p 0% 100%
 +parted -a optimal /dev/sdc set 1 lvm on
 +vgextend VGEXL /dev/sdf1
 +lvresize -l +100%free /dev/mapper/VGEXL-exllv
 +</code>
 +  * Enlarge LVM 2
 +<code>
 +echo '1' > /sys/class/scsi_disk/0\:0\:3\:0/device/rescan
 +yum install cloud-utils-growpart
 +growpart  /dev/sdd 1
 +pvresize /dev/sdd1
 +lvextend -l +100%FREE /dev/mapper/VGKUB-lv_kub
 +xfs_growfs /dev/mapper/VGKUB-lv_kub
 +</code>
 +
 +  * polkit logging for debugging 
 +<code>
 +
 +cat /etc/polkit-1/rules.d/50-apt.rules
 +
 +polkit.addRule(function(action, subject) {
 +    polkit.log("Evaluating action: " + action.id);
 +    polkit.log("User: " + subject.user + ", Groups: " + subject.getGroups());
 +
 +    if (action.id.startsWith("org.freedesktop.packagekit.") ||
 +        action.id == "org.debian.apt.update-cache" ||
 +        action.id == "org.debian.apt.upgrade" ||
 +        action.id == "org.debian.apt.remove" ||
 +        action.id == "org.debian.apt.upgrade-packages" ||
 +        action.id == "org.debian.apt.install") {
 +        polkit.log("Authorization granted for action: " + action.id);
 +        return polkit.Result.YES;
 +    }
 +
 +    polkit.log("Authorization denied for action: " + action.id);
 +});
 </code> </code>
bash_oneliners.1591802822.txt.gz · Last modified: by admin