Or counting files in any folder(s) for i in `ls -al /var/spool/postfix |grep ‘^d’|awk ‘{print $9}’|grep -v ‘\.$’`; do c=`find $i|wc -l`; echo “$c $i”; done;
Category: Linux
FreeIPA Server/Client setup on CentOS 6.5
So I’ve been dorking around with 389-ds a LOT at work lately and it’s a bitch to setup, especially when it comes to the certs. As a hackathon project I decided to setup FreeIPA, which is the Free version of Redhat Identity Manager as a more comprehensive and easy to manage solution. I have this…
Yum and kernels, removing old one’s and limiting how many kernels yum keeps around
Check installed kernels: # rpm -q kernel kernel-2.6.32-279.el6.x86_64 kernel-2.6.32-279.2.1.el6.x86_64 kernel-2.6.32-279.5.2.el6.x86_64 kernel-2.6.32-279.9.1.el6.x86_64 Remove old kernels: # package-cleanup –oldkernels –count=2 Make it permanent: #vi etc/yum.conf installonly_limit=2
Working with volume groups that have the same name (cloned disk, recoveries, etc)
First, we attach the vmdk to the vm and then scan the bus to see it in linux: # echo “- – -” > /sys/class/scsi_host/host0/scan In this scenario, /dev/sda2 and /dev/sdb2 have the same volume group name of VolGroup00, let’s rename /dev/sdb2 to VolGroup01: # vgimportclone –basevgname VolGroup01 /dev/sdb2 next let’s find the new VolumeGroup:…
Finding biggest directories in linux
find . -type d -print0 | xargs -0 du -s | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}
How to SSH tunnel a VNC connection and launch a Gnome desktop
For remote graphical access to a linux server I generally prefer to use NX aka nomachine, however I’ve been doing admin work on some shared servers that I don’t want to install NX on for a few different reasons. All of the other admins here use VNC with SSH tunneling to access these boxen so…
Working With LVM In Linux
Creating a new volume group, adding a disk to it and making it usable Scan HBA for new LUN’s: #echo ‘- – -‘ > /sys/class/scsi_host/hostX/scan #fdisk /dev/sda5 (or /dev/mapper/mpathx if multipathing) … create new partition, type lvm (8e), write changes to disk #partprobe #pvscan #pvdisplay #kpartx -a /dev/mapper/mpathX if it’s a multipathed device using dm-mulipath,…
How to find the scsi id of any device on linux
#scsi_id -g -u -s /block/sdx If it’s a vm #cat /proc/scsi/scsi if it’s a /dev/cciss device(HP SAS) then use #cciss_id /dev/cciss/cXdX -bb
Installing The Latest Deluge in Ubuntu 9.10 (Karmic Koala)
Torrent clients on Linux just don’t seem to stack up to uTorrent. I’ve tried all of them and deluge seems to be the most configurable and feature rich that I’ve found. Yes I’ve tried transmission, ktorrent, rtorrent and several others I don’t care to recall. My primary computer at home is a Linux Mint Helena…