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: Technical
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…
VCP5 Certified!
I’m now a VCP5! The test was hard and I barely passed it, but I passed it on my first try which most people don’t do. The exam was pretty difficult, with a lot of specific and hardly worded questions. Lots of “Pick 3 answers that apply” kinds of questions. I recommend just taking VMware’s…
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
Enabling Round Robin and MPIO on vSphere4
The purpose of this article is explain how to enable round robin and multipathing on an ESXi4 cluster. Our environment consists of: 48 HP BL460cG1 servers running ESXi4 embedded with qlogic fc mezzanine cards(2 hba’s/host) 3 C7000 Chassis with VC-Enet modules and Cisco MDS9124 switches SAN fabric connected to an HP EVA 8400 These instructions…