Archive for April, 2007

Quick find/delete command 

Delete everything older then 6 hours old in current directory . . . find . -cmin +360 -maxdepth 1 -exec rm -rf {} ;

Quick Redirects 

JavaScript <script type=”text/javascript”> <!– window.location = “http://sitetogoto.com/” //–> </script> PHP <?php Header(“Location: http://sitetogoto.com/”); ?> HTML <META http-equiv=”refresh” content=”0;URL=http://sitetogoto/”> Perl use CGI qw(:standard); $cgiobject=new CGI; print $cgiobject->start_html(-script=>{-language=>’JavaScript’, -code=>’window.location.href = “http://sitetogoto.com/”;’});

Upgrade RH9 to CentOS 3 

rpm –import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-3 cd /etc/ cp yum.conf yum.conf.rh9 vi yum.conf ————————————— [main] cachedir=/var/cache/yum debuglevel=2 logfile=/var/log/yum.log pkgpolicy=newest distroverpkg=redhat-release installonlypkgs=kernel kernel-smp kernel-hugemem kernel-enterprise kernel-debug kernel-unsupported kernel-smp-unsupported kernel-hugemem-unsupported tolerant=1 exactarch=1 [base] name=CentOS-$releasever – Base baseurl=http://mirror.centos.org/centos/3.5/os/$basearch/ #released updates [update] name=CentOS-$releasever – Updates baseurl=http://mirror.centos.org/centos/3.5/updates/$basearch/ —————————————— rpm -vv –rebuilddb rpm -qa | grep config yum upgrade rpm kernel reboot rpm -vv […]

Software RAID Rebuild 

Verify Drive – Fix Errors – through controller utility or replace with new drive Check the numbers for the bad drive cat /proc/scsi/scsi Remove bad drive echo “scsi remove-single-device 0 0 2 0” > /proc/scsi/scsi Check to make sure it’s gone cat /proc/scsi/scsi Add good drive echo “scsi add-single-device 0 0 2 0” > /proc/scsi/scsi […]

Linux Kernel Files 

This is the normal locations for all of the kernel files: /etc/grub.conf /boot/ /lib/modules