Wednesday, December 27, 2006

Automated database backups via cron

Here is a quick and dirty script to do automated backups of a mysql database. If you want the script to be executed hourly (as is in my case), place it in your /etc/cron.hourly directory. In my case, I dump the backups onto /local/backups directory which happens to be mirrored via raid1.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/sh

x=`date +%d-%H`
abrcimsfile1="v2edclite${x}"
abrcimsfile2="abrcimsv1${x}"

mysqldump -u root -p v2edclite_v1 > /local/backups/$abrcimsfile1
mysqldump -u root -p abrcims_v1 > /local/backups/$abrcimsfile2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Tuesday, December 26, 2006

Packages required for PAM support with php and cryptocard

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
missing package 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For the cryptocard server 6.4 (build 39) and php4, I got some missing errors about libstdc++.so.6 . I checked out /usr/lib/ but the latest version I found was libstdc++.so.5.

Checked out that I needed the following package for Suse Enterprise 9 that I was running: compat-libstdc++-lsb

Easiest way is to do the online update with yast and select the "lsb" update.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
missing package 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ofcourse the pamauth package that takes care of the magic between php and pam authentication. Dont remember the dowload link but I'll post it back when I come across it again.

missing pam_start function errors

make sure you have the pam_devel package installed

phpize errors

Be sure to check your installation of the following packages and if any of them are missing, install it.

1. php-devel
2. automake and autoconf (if you dont have this and get the aclocal error message, its probably because of these missing packages).

pear upgrade pear issues

Have an old version of pear that just keeps tellin you that you need a more recent version of pear to upgrade pear (pear install PEAR)?

Try this:

1. Run the below command and save the output as "go-pear.php". By default it saves as "index.html" I think. You can rename it to "go-pear.php" after it gets downloaded.

$wget http://go-pear.php

2. Run this to upgrade to the latest version of pear

$php go-pear.php

3. Done.

Tuesday, December 19, 2006

'connection to 0:0 refused by server' errors

Try this. Most likely you've logged in as 'abcd' and then su'ed as a different user.

Run the command 'xhost +' in a terminal as the original logged in user. then su' back to whatever user you wanted to su to..Hopefully, it should work. If not, google :) as I just did.

Wednesday, December 13, 2006

Installing CRYPTOCard Server on Suse Linux 10.1

I had a bit of an issue when I tried to install the cryptocard server on a recently upgrade Suse Linux 10.1 server. I kept getting the below darn error messages every time I ran the installer:

error while loading shared libraries: libc.so.6: cannot open shared object file:
No such file or directory


This was a bit irrating because my libc.so.6 was right under the "/lib" path. I tried opening up /etc/ld.so.cof and added the "/lib" path to it and run ldconfig -v to update the cache. No luck. Upon googling, I came across a page that provided a suggestion about LD_ASSUME_KERNEL and it worked after I followed through it.

$perl -pi -e 's/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/' cryptcoserver_6_4_for_linux.bin


Here was the link that I got the perl command idea from:
http://www.mail-archive.com/jxplorer-users@lists.sourceforge.net/msg00132.html

Good luck,
Nefertitian.

Monday, November 20, 2006

Installing Suse Linux Enterprise 10 (SLES 10) with PERC 2/SC controller

I had a bit of an issue with the PERC 2/SC scsi controller on my dell power edge 2300/450 (Dell 440GX) where, during the installation of SLES 10, the installer refused to recognize my scsi controller and gave an (no hard disk found or something like that).

A bit of googling bought me to a place where a guy mentioned that you could change the emulation (under Objects, Host Adapter in the PERC configuration menu) from I20 to MASS HARDWARE. That I did and on rebooting, my system just froze and wont even proceed with the install. I then flashed the firmware for PERC 2/SC from 3.13 to the older 3.0 . Then proceeded with reboot and everything worked like a charm!

Wednesday, March 08, 2006

Unix/Linux Backup Strategies (Some useful links)

g4u - Harddisk Image cloning for PCs. Amazing little software and highly user friendly and very simplistic to use.
http://www.feyrer.de/g4u/

Dirvish, a very fast, disk based, rotating network backup system
http://www.dirvish.org/

Easy Automated Snapshot-Style Backups with Linux and Rsync
http://www.mikerubel.org/computers/rsync_snapshots/

Keith Lofstrom's disk-to-disk backup page (based on dirvish)
http://www.keithl.com/linuxbackup.html

Using Rsync and SSH (This document covers cron, ssh and rsync usage to backup files over a local network or the internet. By using
http://www.jdmz.net/ssh/

Cheap and reliable RAID 5 Network Attached Storage:
http://www.smallnetbuilder.com/content/view/27840/77/1/1/

Sunday, February 19, 2006

Installing Zope on SLES 9

My attempt to install Zope and Python on Suse Linux Enterprise 9 met with several errors including conflicting versions of python (SLES did not support readline 5.* and Zope 2.9 demanded readline 4.*, irritating SAXReaderNotAvailable errors when forcefully installing rpm binaries meant for suse linux 10, etc.). I finally decided to install zope and python from scratch, from their latest source distributions. Upgrading existing version of python was not a feasible option for me on SLES 9, so I had to do a custom installation of pyton that will preexist with the existing version of python supported by novell's SLES 9. Below are the steps that I undertook:

Custom Source Installation of Python 2.4.2

- Downloaded the latest version of python which happened to be Python 2.4.2 at the time of this installation.

http://www.python.org/ftp/python/2.4.2/Python-2.4.2.tgz

- Unzipped the source distribution to /home/software/Python-2.4.2 and executed the below steps to install python.

./configure --prefix=/opt/custom/python
make
make install exec_prefix=/opt/custom

All done there and thankfully no errors, and then I moved on to installing zope.

Source Installation of Zope

- Downloaded the latest version of Zope which was 2.9.0 at the time of this installation.

http://www.zope.org/Products/Zope/2.9.0/Zope-2.9.0.tgz

- Unzipped them to /home/software and executed the below steps. Since I had two versions of python, one that is supported by SLES 9 (2.3.*) and the other being my above custom installation version (2.4.2), I had to specifically tell zope which one to use.

./configure --prefix=/opt/zope --with-python=/opt/custom/bin/python
make
make install

- Next came the process of creating a default zope instance and to set its default directory to '/opt/zope/default'.

/opt/zope/bin/mkzopeinstance.py

- Next, I tried to start the default zope instance by typing '/opt/zope/default/bin/zopectl start'. Zope failed to start, and gave me some error about 'daemon manager running; daemon process not running' or something like that. After trying to run zope again as a foreground process (fg option), it mentioned about needing to specify the default user the zope process should run as.

Opened up the zope.conf file in /opt/zope/default/etc/zope.conf and set the 'effective-user' directive to a local username 'nefertitian'. I tried 'root' but it gave me some other funny error that I dont remember about. Since the zope process would run as user 'nefertitian', I needed to give 'nefertitian' user read/write permissions to the var and log directories and making sure the stick bet is set (as mentioned in the documentation):

chown nefertitian:root /opt/zope/default/var
chown nefertitian:root /opt/zope/default/log
chmod o+t var

Tried to run zope again, and this time it worked like a charm!


About Me

My photo
Princeton, New Jersey, United States
I am an Information Technology Analyst with extensive background in the Clinical Industry that includes working for CROs, Pharmaceutical and Medical Diagnostic companies.