Archive for September, 2009

To not allow any dot files or directories (hidden in unix) to be seen if they are in a directory available to the webserver, add the following to the httpd.conf file.

# The following lines prevent any .files from being viewed by web clients.
<Files ~ "^\.">
Order allow,deny
Deny from all
</Files>

We don’t really have any hidden files (like .svn) on our website, but this should protect us in case someone accidentally puts on there.

By default, we have banner pages off, but if someone wants to print a banner page, do this:

lpr -o job-sheets=standard file_to_print

Here’s a screenshot of the relevant cups manual.
cups_banner

First of all, note that scipy requires python >= 2.4. SC4 comes with python version 2.3. So, a newer version of python needs to be installed first. For us, it was installed in /code/hep/bin.

Numpy can be installed for either python 2.3 or 2.5. For 2.3, use yum.

yum install numpy

For the 2.5 version, download the tar file, extract and run:

/code/hep/bin/python setup.py build --fcompiler=gnu
/code/hep/bin/python setup.py install --prefix=/code/hep

This will put the libraries in /code/hep/lib/python2.5.

For scipy, download the file, extract and run:

export PYTHONPATH=/code/hep/lib/python2.5
/code/hep/bin/python setup.py install --prefix=/code/hep

Then, to use the 2.5 version instead of the 2.3 version, put in your .bashrc file:

export PATH=/code/hep/bin:$PATH
export PYTHONPATH=/code/hep/lib/python2.5

On one computer, I was having some problems running yum upgrade. It would complain that a dependency wasn’t installed. However, I could rpm -q that dependency and it showed up fine. To fix this, simply uninstall the package that was the dependency and then run upgrade. That should cause the dependency to be automatically downloaded and installed.

[root@server rhn]# yum upgrade
Loaded plugins: rhnplugin, security
Skipping security plugin, no data
Setting up Upgrade Process
Resolving Dependencies
Skipping security plugin, no data
--> Running transaction check
---> Package dmraid.i386 0:1.0.0.rc13-53.el5 set to be updated
--> Processing Dependency: dmraid-events for package: dmraid
---> Package fetchmail.i386 0:6.3.6-1.1.el5_3.1 set to be updated
---> Package firefox.i386 0:3.0.14-1.el5_4 set to be updated
---> Package net-snmp.i386 1:5.3.2.2-7.el5_4.2 set to be updated
---> Package net-snmp-libs.i386 1:5.3.2.2-7.el5_4.2 set to be updated
---> Package nspr.i386 0:4.7.5-1.el5_4 set to be updated
---> Package xulrunner.i386 0:1.9.0.14-1.el5_4 set to be updated
--> Running transaction check
---> Package dmraid-events.i386 0:1.0.0.rc13-53.el5 set to be updated
--> Processing Dependency: sgpio for package: dmraid-events
--> Finished Dependency Resolution
dmraid-events-1.0.0.rc13-53.el5.i386 from rhel-i386-server-5 has depsolving problems
  --> Missing Dependency: sgpio is needed by package dmraid-events-1.0.0.rc13-53.el5.i386 (rhel-i386-server-5)
Error: Missing Dependency: sgpio is needed by package dmraid-events-1.0.0.rc13-53.el5.i386 (rhel-i386-server-5)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest
[root@server rhn]# rpm -e sgpio
[root@server rhn]# yum upgrade
Loaded plugins: rhnplugin, security
Skipping security plugin, no data
Setting up Upgrade Process
Resolving Dependencies
Skipping security plugin, no data
--> Running transaction check
---> Package dmraid.i386 0:1.0.0.rc13-53.el5 set to be updated
--> Processing Dependency: dmraid-events for package: dmraid
---> Package fetchmail.i386 0:6.3.6-1.1.el5_3.1 set to be updated
---> Package firefox.i386 0:3.0.14-1.el5_4 set to be updated
---> Package net-snmp.i386 1:5.3.2.2-7.el5_4.2 set to be updated
---> Package net-snmp-libs.i386 1:5.3.2.2-7.el5_4.2 set to be updated
---> Package nspr.i386 0:4.7.5-1.el5_4 set to be updated
---> Package xulrunner.i386 0:1.9.0.14-1.el5_4 set to be updated
--> Running transaction check
---> Package dmraid-events.i386 0:1.0.0.rc13-53.el5 set to be updated
--> Processing Dependency: sgpio for package: dmraid-events
--> Running transaction check
---> Package sgpio.i386 0:1.2.0_10-2.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================
 Package                  Arch            Version                         Repository                     Size
==============================================================================================================
Updating:
 dmraid                   i386            1.0.0.rc13-53.el5               rhel-i386-server-5            718 k
 fetchmail                i386            6.3.6-1.1.el5_3.1               rhel-i386-server-5            527 k
 firefox                  i386            3.0.14-1.el5_4                  rhel-i386-server-5             12 M
 net-snmp                 i386            1:5.3.2.2-7.el5_4.2             rhel-i386-server-5            696 k
 net-snmp-libs            i386            1:5.3.2.2-7.el5_4.2             rhel-i386-server-5            1.3 M
 nspr                     i386            4.7.5-1.el5_4                   rhel-i386-server-5            119 k
 xulrunner                i386            1.9.0.14-1.el5_4                rhel-i386-server-5             10 M
Installing for dependencies:
 dmraid-events            i386            1.0.0.rc13-53.el5               rhel-i386-server-5             22 k
 sgpio                    i386            1.2.0_10-2.el5                  rhel-i386-server-5             11 k

Transaction Summary
==============================================================================================================
Install      2 Package(s)         
Update       7 Package(s)         
Remove       0 Package(s)         

Total size: 25 M
Total download size: 25 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): nspr-4.7.5-1.el5_4.i386.rpm                                                     | 119 kB     00:00     
(2/6): fetchmail-6.3.6-1.1.el5_3.1.i386.rpm                                            | 527 kB     00:00     
(3/6): net-snmp-5.3.2.2-7.el5_4.2.i386.rpm                                             | 696 kB     00:00     
(4/6): net-snmp-libs-5.3.2.2-7.el5_4.2.i386.rpm                                        | 1.3 MB     00:00     
(5/6): xulrunner-1.9.0.14-1.el5_4.i386.rpm                                             |  10 MB     00:01     
(6/6): firefox-3.0.14-1.el5_4.i386.rpm                                                 |  12 MB     00:01     
--------------------------------------------------------------------------------------------------------------
Total                                                                         5.3 MB/s |  25 MB     00:04     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : nspr                                                                                  1/16 
  Updating       : xulrunner                                                                             2/16 
  Updating       : net-snmp-libs                                                                         3/16 
  Installing     : sgpio                                                                                 4/16 
  Updating       : net-snmp                                                                              5/16 
  Updating       : fetchmail                                                                             6/16 
  Updating       : firefox                                                                               7/16 
  Updating       : dmraid                                                                                8/16 
  Installing     : dmraid-events                                                                         9/16 
  Cleanup        : nspr                                                                                 10/16 
  Cleanup        : net-snmp-libs                                                                        11/16 
  Cleanup        : firefox                                                                              12/16 
  Cleanup        : net-snmp                                                                             13/16 
  Cleanup        : xulrunner                                                                            14/16 
  Cleanup        : fetchmail                                                                            15/16 
  Cleanup        : dmraid                                                                               16/16 

Dependency Installed:
  dmraid-events.i386 0:1.0.0.rc13-53.el5                      sgpio.i386 0:1.2.0_10-2.el5                     

Updated:
  dmraid.i386 0:1.0.0.rc13-53.el5     fetchmail.i386 0:6.3.6-1.1.el5_3.1       firefox.i386 0:3.0.14-1.el5_4  
  net-snmp.i386 1:5.3.2.2-7.el5_4.2   net-snmp-libs.i386 1:5.3.2.2-7.el5_4.2   nspr.i386 0:4.7.5-1.el5_4      
  xulrunner.i386 0:1.9.0.14-1.el5_4  

Complete!
[root@server rhn]# 

We currently use WinEDT and MiKTeX to allow users to edit latex files in windows. APS provides the revtex4 package for their authors.

authors.aps.org/revtex4

To get this package to work with MiKTeX, make the following directory structure under your localtexmf tree.

mkdir /tex/latex/revtex4/

Then run,

Start -> All Programs -> MiKTeX -> MiKTeX Options and click the “Refresh Now” button in the “File name database” section. That’s it.

The APS website above has a sample file that can be used to test things out.

Edit the file wp-content/themes/default/sidebar.php. Right after this:

<li>
<?php get_search_form(); ?>
</li>
</pre>

add this:
<li>
<?php wp_list_bookmarks(); ?>
</li>

Edit ../wp-content/themes/default/index.php and archive.php.

Look for a line like this:

<small> <? php the_time('F jS, Y') ?> <-- by <?php the_author() ?> --> </small>

Edit to this:

<small><? php the_time('F jS, Y') ?> by <?php the_author() ?></small>

In archive.php, the by <?php the_author() ?> needs to be added.