Tuesday, March 9, 2010

Compile and Install Star II (Ubuntu 8.04.4 LTS)

This is my second post about Star, a package of astronomy software for variable star research that some of my colleges use for their work. It was programmed by an astronomer at South African Astronomical Observatory (SAAO). My first post was how to get it compiled and running on CentOS 5.4. This post will show how to do it in Ubuntu 8.04.4 LTS.

I compilied Star using the Absoft (v8, 32-bit) Compiler. It's an older version of Absoft, but this is an old program. Follow the instructions as given with the software to install.

Be sure to download and install the patches (libfio in particular) or there will be epic FAIL.

To install the compiler on Ubuntu 8.04.4 LTS, be sure to also install libxp-devel:

sudo aptitude install libxp-dev
These instructions are for a basic install of Ubuntu 8.04 that has had sudo aptitude dist-upgrade run, hence it is version 8.04.4. The instructions are written assuming you are a sudo user.

To get builds to work for both Mongo and STAR, install the needed software:

sudo aptitude install build-essential
Ubuntu likes to reset environment variables for sudo commands. The fix to compile? Alias the sudo command so it will know enough about the environment to compile and install:

alias sudo='sudo env PATH=$PATH MONGODIR=$MONGODIR ABSOFT=$ABSOFT'

Mongo

We need to set an environment variable for everyone. Add the mongo directory in /etc/bash.bashrc:

# Export the path to mongo for everyone
export MONGODIR=/usr/local/mongo;
Log out and back in for the environment variable to take affect.

Unpack the source:

tar -zxvf mongo.tar.gz && cd mongo

Mongo and Friends

Edit the Makefile. Change:
$(FNTFILE):
mkfont
To:
$(FNTFILE):
./mkfont
Note: Makefile.absoft is older than Makefile. Use Makefile

Complile the FORTRAN subroutines, create the library libmongo.a, create the X-windows driver STARplot and create the font file Font.bin.

sudo mkdir -p /usr/local/mongo &&
sudo cp Fonts /usr/local/mongo &&
make realclean && sudo make;
Install mongo and friends on the system:

sudo mkdir -p /usr/local/man/man2 &&
sudo make install

Help Library

This needs to be compiled and installed, the make command does both.

pushd helpdir && sudo make && popd;

HPGL Converter

This needs to be compiled and installed, the make all command does both.

sudo mkdir -p /usr/local/man/man1 &&
pushd hp2xx314/sources &&
make realclean &&
sudo make all &&
sudo make install-bin &&
sudo make install-man &&
popd;

STAR

Unpack the source in /usr/local/:

sudo tar -zxvf src.tar.gz -C /usr/local/ && cd /usr/local/star
Note: Makefile.absoft is older than Makefile. Use Makefile

Edit the Makefile. There is an instruction missing after the spectrunc instruction, add:

spectrund: spectrund.f
$(FC) $(FFLAGS) $@.f -o $@ $(LIBS)
Note: Be sure it is a tab and not 8 spaces in front of $(FC)

Compile STAR:

sudo make realclean && sudo make;
We want to give everyone access to the STAR binaries. Add the star directory to $PATH in /etc/bash.bashrc:

# Export the path to star for everyone
PATH="$PATH:/usr/local/star"; export PATH;

Compile and Install Star (CentOS 5.4)

Star is a package of astronomy software for variable star research that some of my colleges use for their work. It was programmed by an astronomer at South African Astronomical Observatory (SAAO) in FORTRAN. From what I can tell it is not actively maintained and can be difficult to get compiled and installed correctly if you have never done it before. The following is the result of several nights of research with trial and error to get Star to compile and install properly on CentOS 5.4.

I compilied Star using the Absoft (v8, 32-bit) Compiler. It's an older version of Absoft, but this is an old program. Follow the instructions as given with the software to install.

Be sure to download and install the patches (libfio in particular) or there will be epic FAIL.

To install the compiler on CentOS 5.4, be sure to also install libXp:

yum -y install libXp
These instructions are for a basic install of CentOS 5.4 where yum -y update has been run. The only box checked for the installation is the "Gnome Desktop." The instructions are written assuming you are logged in as the root user.

Also note: SELinux is disabled

To get builds to work for both Mongo and STAR, install the needed software:

yum -y install gcc libX11-devel

Mongo

We need to set an environment variable for everyone. Add the mongo directory in /etc/profile:

# Export the path to mongo for everyone
export MONGODIR=/usr/local/mongo
Log out and back in for the environment variable to take affect.

Unpack the source:

tar -zxvf mongo.tar.gz && cd mongo

Mongo and Friends

Edit the Makefile. Change:

$(FNTFILE):
mkfont
To:

$(FNTFILE):
./mkfont
Note: Makefile.absoft is older than Makefile. Use Makefile

Complile the FORTRAN subroutines, create the library libmongo.a, create the X-windows driver STARplot and create the font file Font.bin.

mkdir -p /usr/local/mongo &&
cp Fonts /usr/local/mongo &&
make realclean && make;

Install mongo and friends on the system:

mkdir -p /usr/local/man/man2 && make install

Help Library

This needs to be compiled and installed, the make command does both.

pushd helpdir && make && popd

HPGL Converter

This needs to be compiled and installed, the make all command does both.

mkdir -p /usr/local/man/man1 &&
pushd hp2xx314/sources &&
make realclean &&
make all &&
make install-bin &&
make install-man &&
popd;

Star

Unpack the source in /usr/local/:

tar -zxvf src.tar.gz -C /usr/local/ && cd /usr/local/star
Note: Makefile.absoft is older than Makefile. Use Makefile.

Edit the Makefile. There is an instruction missing after the spectrunc instruction, add:

spectrund: spectrund.f

$(FC) $(FFLAGS) $@.f -o $@ $(LIBS)
Note: Be sure it is a tab and not 8 spaces in front of $(FC)

Compile STAR:

make realclean && make
We want to give everyone access to the STAR binaries. Add the star directory to $PATH in /etc/profile:

# Export the path to star for everyone
export PATH="$PATH:/usr/local/star"
Hopefully some astronomers out there will find this useful.

Friday, March 5, 2010

2010 Book Reading: Linux Server Hacks

I have a long list of books I want to go through this year to increase my exposure and skill set with Linux and programming. I picked up Linux Server Hacks long ago and never read it. I was too busy taking astronomy courses and doing research. It is the first edition (and as of now the only edition), published in 2003.

It is amazing what happens over the course of seven years. While many of the concepts are as applicable now as they were then, the way they are being done has changed. For example in Chapter 1, the book talks about some great tricks using tar and ssh which I'm sure will come in handy in the future. But the chapter also talks about LILO which I have not seen since I switched from a pink and purple distro named Mandrake to a more exciting orange distro named Ubuntu. However these hacks are easily converted to use in GRUB.

Chapter 2 talks about version control, mostly CVS. I used CVS once in my travels through space and time, and I used Git while at Guru Labs. It was interesting to read, but didn't apply to anything I'm using at the moment. Chapter 3 talks about backups and combined together a few things I knew about like rsync and other tools. I've already used a few tips from this chapter. Chapter 4 discusses networking. Most topics that interested me I am already aware of and using from my previous experience, but review is always good.

Chapter 5 gets into system monitoring including system logs, finding programs which are holding a port open, network monitoring, and monitoring an aging disk. All good things to know about. The book even shows you how to display your load average in the titlebar of your command window. Chapter 6 goes over some ssh tricks, many which I was already using. However reviewing port forwarding with ssh is always good since every time I do it, I have to go relearn how. Chapter 7 has some tips for scripting. There is an example script that helps a user move all their preferences and settings onto a new user. I've plucked a few ideas from this for my own use.

Chapter 8 gives tips for information services such as BIND, MySQL, and Apache. The book shows how to configure BIND to run in a chroot jail. Although these days (at least in RHEL and Fedora), you just install the rpm. Talk about taking the fun out of it. For some MySQL and Apache tips, the book talks about setting up replication across multiple servers for these applications. Again time has caught up with the book since it was published. These days the high load applications servers I've seen use clustered file systems. Other tips in this chapter include creating and distributing your own Certificate Authority and distributing load with Apache RewriteMap.

Overall, the book is valuable even seven years after it was published. Some of the technologies and applications have changed over the years, but seeing how it is (was) done is still a valuable learning experience. Several of the tips are "this is a cool script that does X" (available online). Unfortunately, I felt explanation for some of the scripts is a bit lacking. Overall for me, it was a good read.

Next book: Learning the Bash Shell. Or maybe Sed and Awk.

Wednesday, December 9, 2009

CompTIA Security+ Certified

I am now officially CompTIA Security+ Certified. I was required to get a "security certification" for my new job (at their expense, yeah!). Now, given the choice I would have asked if I could get training as a Red Hat Certified Security Specialist, but that was a little over the top when it comes to funds.

Overall I enjoyed studying for the exam and in the end scored nearly 100%. In preparation, I read through CompTIA Security+ Deluxe Study Guide and used the Pass4sure practice exams provided by my employer.

While I was familiar with the basics of many of the concepts, the study guide went into some detail and discussion I had not looked at before. The book also helped with learning the endless sea of acronyms. There is an appendix in the back that is a good reference for these acronyms. There is also some further discussion in the appendix that is worth reading in preparation for the exam. However, I found the labs in the study guide pretty lacking in anything useful to me.

The biggest issue I've found taking the exam is if you have a lot of experience, sometimes it is difficult to reason between two good answers as to which one the exam thinks is "best." This is where the Pass4sure exams came in handy as they also had the same mentality as the exam. This helped in understanding what the exam thinks is best and why. Once I had the knowledge required and understood the thought process of the authors of the exam, it was fairly straight forward.

The most interesting part of this experience? I was approached at work by someone who was baffled as to how in the world I passed the exam. Four years experence of teaching astronomy at UVU kicked in and I said you need to study and understand the concepts if you want to pass the exam. When I said this, they freely admited to not really wanting to learn anything from the experience and just wanted to "learn how to pass the exam" by using the practice tests. A tip of my hat goes out to CompTia from making sure the exam is not passible by just studying the practice exams.

Question is, while I made this experience worthwhile, is this certification resume-worthy or worth anything in the real world?

Tuesday, October 13, 2009

Moving On

This Friday will be my last day at Heuristic Systems. It has been a fun nine months working with some great people. I've accepted a position much closer to home at NexOne, Inc. as a Linux Systems Administrator. The much shorter drive will be great, and I'll be working with a wonderful team. Alonsi!