du -hx --max-depth=1 xauth merge ~/.Xauthority 2>&1
Current kernel boot parameters
cat /proc/cmline
Find a running process The first character in brackets is the key, let's you avoid the grep -v grep, etc.
ps aux (or -elf) | grep '[a]ny_.*_process'
File/directory with spaces or special characters:
cd dir\ with \ spaces cd ./-dont_do_this
for i in item1 item2 item3 ; do something ; done for i in `cmd` ; do something ; done for i in {1..9} ; do something ; done for i in `seq start increment end` ; do something ; done for ((init, condition, increment)); do something ; done
Ext3 | fsck -y {mount point} |
GFS | gfs_fsck {mount point} |
Ext3
Look for state not equal “clean”
dumpe2fs {path_to_block_device} | grep state
set -o vi sets editor to vi set -vx sets command tracing (+vx to turn off)
select i in list ; do something ; done
Escape out of telnet or Xen console = Ctrl+]
awk -F{delim} '/search_pattern/ { print $1 }'
Background running job
vi from less/more = v
crontab: minute hour dayofmonth month dayofweek command
Calc (simple):
echo $[ a + b ]
Calc (better):
echo "a / b" | bc
Make big file:
dd if=/dev/zero of=bigfile bs=1k(1M) count=N
SSH tunnelling on gumstix:
ssh -L 443:192.168.1.100:22 -g localhost
remote:
ssh mtonneson.homelinux.org -p 443
HOST: RHEL AP 5.4 with KVM and libvirt installed.
RHCE Study Topics
Local users & groups Cron/crontab tcpwrappers SELinux NFS server vsftpd sendmail/postfix apache dhcpd
man1 | cmds all users can access |
man2 | kernel errors & system subroutines |
man3 | library of subroutines |
man4 | network protocols, devices and drivers |
man5 | formatting info |
man6 | games and demos |
man7 | misc |
man8 | cmds only root can access |
man9 | linux kernel |
man -a <keyword> = shows all pages matching keyword
program root - usually /etc/httpd/conf or /usr/local/apache web root - usually /home/httpd or /var/www/htdocs config file - httpd.conf
apachectl - control script
inetd
/etc/services - lists network services and ports /etc/inetd.conf - config file
xinetd
/etc/xinetd.conf - config file /etc/xinetd.d/ - service specific parameter files
Debian package mgmt
dpkg --install - install package --remove - remove package --print-avail - general info about package --list - list installed packages --listfiles - list files installed by package --status - full package details --search - which package owns/installed file
/var/lib/dpkg/available - available packages /var/lib/dpkg/status - package status
dselect - menu driven version of dkpg apt-get - cmdline package installer alien - package converter
RHEL3 local login w/o LDAP:
Try adding the following to nss_initgroups_ignoreusers line to the file /etc/ldap.conf:
Just assume that there are no supplemental groups for these named users nss_initgroups_ignoreusers root,ldap,named,avahi,haldaemon,dbus,radvd,tomcat,radiusd,news,mailman,ntp,smmsp,xfs
RH Virtualization
aws.amazon.com ec2 SPEC Virt overt.et.redhat.com
passwd: ldapsearch -x -v -h directory -b “o=domain.com” “uid=UID”
VM install = cdrom://hdc:/mnt/source
vmware-cmd -l | xargs -ipath -t -e vmware-cmd path getpid
Installing VMware Tools in a Linux Guest
Choose Settings > VMware Tools Install, then click Install. This step connects the virtual machine's CD-ROM drive to an ISO image file on the ESX Server machine.
In your Linux guest, become root, mount the VMware Tools virtual CD-ROM, copy the installer file from the virtual CD-ROM to /tmp, then unmount the CD-ROM.
mount -t iso9660 /dev/cdrom /mnt cp /mnt/vmware-linux-tools.tar.gz /tmp umount /dev/cdrom
Untar the VMware Tools tar file in /tmp and install it.
cd /tmp tar zxf vmware-linux-tools.tar.gz cd vmware-tools-distrib ./vmware-install.pl
Note: When installing VMware Tools in some versions of Linux, the installer will need to recompile VMware Tools. For this to work, you need to have a C compiler installed in the guest. In some cases you may get compiler warning messages during the VMware Tools installation. However, the control panel and drivers still work correctly.
Follow the remaining steps. Choose directories for the various files. Choose a display size for the virtual machine. Enter the number for the choice and press Enter. If you wish, start X and your graphical environment and launch the VMware Tools background application.
vmware-toolbox &
Note: If you created this virtual machine using the vmxnet driver, you now need to run netconfig or another network configuration utility in the virtual machine to set up the virtual network adapter.
During operation, the service logs events from the infrastructures on tty1 through tty10 (if available), as well as /var/log/messages. If this produces too much text on the screen, adding the option “-V0x0” to the hprsm startup script will silence the text.
Server rename
/etc/hosts /etc/sysconfig/network /usr/openv/netbackup/bp.conf Restart nscd service
smbclient //windows/share -W activedirectory.domain.com -U username mount -t smbfs -o username=user,workgroup=activedirectory.domain.com //server/share /mnt/smb
Upgrade VM RHEL4.0 → RHEL4.2