Tuesday, August 31, 2010

VMware converter p2v from IDE to SCSI

My attempt to convert and old physical machine to an ESX environment was involving more work than I thought. Here is how I got it to boot after a number of kernel panics:

Old physical machine: IDE (hda1, hda2, hda3)
VM (converted): SCSI (sda1, sda2, sda3)

1 - I had to boot into rescue mode and edit /etc/modules.conf and add:  alias  scsi_hostadapter BusLogic
2 - Re-create initrd with: mkinitrd -v -f initrd-xxxx.img  xxxx (you should now what xxx stands for)
3 - Of course, re-install grub with grub-install
4 - Make sure grub.conf match the current hdd config (sda)
5 - Make sure my /etc/fstab converted to sda instead of sda stuff
6 - Modify ESX virtual hard disk to use BusLogic. VMware does not like this but it's the only way that I know the VM will boot.


Friday, August 6, 2010

Enable sendxmpp to alert load average

I thought this might be useful to have in addition to your monitoring system.


sendxmpp: You'll have to learn how to install this yourself :) I only tell you when you got it running. Here are some errors I had when I started:
ERROR: Authorization failed: error - not-authorized
Fix:  

Modifying the Protocol.pm of Net::XMPP (line ~1800). Mine is located at ./site_perl/5.8.8/Net/XMPP/Protocol.pm
Comment these lines out.
if($self->{STREAM}->GetStreamFeature($self->GetStreamID(),"xmpp-sasl"))
{
return $self->AuthSASL(%args);
}

Then use: echo "load is high"|sendxmpp -j 10.10.10.222:5222 -u foobar -p ###### -r home  recipient@domain

Friday, July 30, 2010

Puppet on Centos 5

Didn't think it would be so complicated that I have to blog it to remind myself  :)

Setting up puppet master:

1> wget http://puppetlabs.com/downloads/facter/facter-latest.tgz
2> wget http://puppetlabs.com/downloads/puppet/puppet-2.6.0.tar.gz
tar xzvf facter-latest.tgz  (then: ruby install.rb)
tar xzvf puppet-2.6.0.tar.gz (then: ruby install.rb)

Some spelling errors on code:

Run:  puppetmasterd --genconfig|grep factpath
Should look like this:  factpath = /var/lib/puppet/lib/facter:/var/lib/puppet/facts
Should not look: factpath = /var/lib/puppet/lib/facter/${File::PATH_SEPARATOR}$/var/lib/puppet/facts

If bad factpath, edit default.rb in lib/puppet directory and reinstall. Grep for PATH_SEPARATOR and replace the line with:

:factpath => {:default => "$vardir/lib/facter:$vardir/facts",

Go to the conf dir and copy the server.init to /etc/init.d

Make sure /etc/hosts on both client and server know how to ping each other.

Mount your vmware vmdk file(s).

Why do people make it harder than it should be in their howtos?

Here is how to mount your vmware vmdk files.


1. List your partitions:  
vmware-mount.pl -p Servername.vmdk

2. Mount the partition number you want(2):  
vmware-mount Servername.vmdk 2  /mount/point

Monday, August 24, 2009

ClipBucket installation

Add this to your yum repo.
----------------------------------------------------------------
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=0
enabled=1
 ----------------------------------------------------------------
Accept and install all dependencies for these:


#yum install ffmpeg
#yum install ffmpeg-devel
#yum install flvtool2

Then, download this:
wget http://mesh.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.3.1.tbz2

Extract it and then go to ffmpeg-php to compile and install it.

#cd ffmpeg-php
#phpize (this shold
./configure
#make

*** misspell problemat make:  mv ffmpeg_frame.loT ffmpeg_frame.lo   DO NOT make clean AFTER THIS. Just run 'make' again to finish the compilation step.

#make install

That's it. The hard part now is to import the database. Go here to download:

http://clipbucket.org/scm/viewvc.php/trunk/sql/?root=clipbucket

Make sure you're downloading the correct version number for your MySQL.

Import your database schema and edit the config environment to match your server. These are the important ones:
(3, 'baseurl', 'http://domain.tld'),
(4, 'basedir', '/home/user/public_html'),
(11, 'ffmpegpath', '/usr/bin/ffmpeg'),
(12, 'flvpath', '/usr/bin/flvtool2'),
(19, 'mencoderpath', '/usr/bin/mencoder'),
(22, 'mplayerpath', '/usr/bin/mplayer'),
(25, 'php_path', '/usr/bin/php'),

Tuesday, August 18, 2009

1001 days uptime.


My email server hits 1001 days of uptime!

Tuesday, July 7, 2009

Old LVM drive

What to do if you have an old LVM with the same VolGroup?

Using a liveCD. I am using Ubuntu. Must have internet access.
unplug the new drive(s) and leave the old drive that you want to recover files from.
Boot it up with the liveCD.
If you're like me who does not like sudo, do this:
# sudo passwd (to change to whatever password you want for root).
# su - (to get in as root).
# apt-get install lvm2
# vgscan
------------------
Found volume group "VolGroup00" using metadata type lvm2
------------------
# vgrename VolGroup00 VolGroupRecover

Shutdown your machine. Plug everything back. When you're back as root:
# vgscan
------------------
Found volume group "VolGroupRecover" using metadata type lvm2
Found volume group "VolGroup00" using metadata type lvm2
------------------
That's what you want to see. Now reactivate them.
# vgchange -a y
# lvscan
You should see the ACTIVE /dev/VolGroupRecover/LogVol--
Well, mount that one!