Skip to content

Category: Unix Hint

Login Hangs After CentOS/RedHat Kernel Update

June 15, 2015

A second incident of login getting hung after kernel update is found. The first incident was reported on Aug 2, 2014. As usual when users type in user name and password at the login window and hit login the login process gets frozen and cannot get to the desktop. It appeared to only affect tsch (using .cshrc) users.

The solution is to hit ctrl-c and then rm .history to get rid of the .history file. Note that if you do it from ssh, it might cause the host to reboot.

Canopus and Algol got updated over the weekend to kernel version 2.6.32-504.23.4.el6.x86_64. Hence it seems like it is only affecting these two hosts.

-Yuping & Bruce

mingw64-pkg-config.x86_64

I installed mingw64-pkg-config.x86_64

It seems like it need to pull in its sister package e2fsprogs before compiling dump by typing in the /root/ directory

$ git clone git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git

$./configure –enable-elf-shlibs

$ make

$ make check

$ make install

$ make install-libs

which puts the binary file in /usr/bin or /usr/local/…

then go to the dump source file, type

http://surf.ml.seikei.ac.jp/~nakano/dump-restore/dump-restore-mini-HOWTO.en.html

Compiling Old fortran programs(&link pgplot) on 64-bit system

This post is for the old fortran computing programs (except TEMPO)

The moral of the story to compile those old programs in 32-bit on the 64-bit machines, because I could not find any documentation online re how f77 compiles differently in 64-bit and 32-bit. However, we do know that programs compiled in 64 bit behave differently from those compiled in 32-bit (for example the size of some data type are different). Therefore, on the 64-bit machines we should force compile these old programs in 32-bit to ensure consistency. The steps are as follows.

1. Make sure that your $PGPLOT_DIR environmental variable points to /usr/share/astro/psrchive/pgplot_32bits

2. Look at the make file. Add “-m32” to FFLAGS (meaning force compile in 32 bit for fortran) and make sure that the f77 step says f77 $(FFLAGS)     in order that the FFLAGS be invoked.

Make sure that the LIBS line have all of the following especially $(PGPLOT_DIR)

LIBS = -L$(PGPLOT_DIR) -lpgplot -L/usr/X11R6/lib -lX11 -lpng

Then we should be fine

–Yuping

—————————————————————————-

Pulling in additional 32-bit compat library when the compiler complains about not having it:

Do a google search to see what packages provide those libraries (theoretically “yum provides filename” should work but I never succeed on our computer. Useful stuff is “yum search keyword” which search through the available packages. Always pick the package ending with i686 (which stands for 32-bit) and devel if available

for example I see -lz and google tells me zlib is what I need. I run “yum search zlib” and just pick the one with “devel” and “i686″(meaning 32 bit). So I will type “sudo yum install zlib-xxxx-devel-i686

determine the libraries / files that an executable is using!!

ldd   <path/executablename>  lists what libraries it is looking for (or currently using)

ltrace <executablename programarguments>   traces what executable is doing with libs and other stuff and if it gets stuck there’s your problem.  (Note this actually runs program which is why input params are needed)

strace <executablename programarguments> show files opening and closing. This also requires running the program. Since the output is extremely lengthy you might want to save it to blablabla.txt by

$strace -o blablabla.txt <executablename programarguments>

If you want to just trace specific system calls (for example open,read since you are interested in what the program is using) you can type

$strace -e open,read <executablename programarguments>

This will give only open and read calls.

-Yuping Huang

Make Evince Display IDL PS Filename on Banner: JUST USE EVINCE!

AS OF 2020 Sep (and I believe much earlier), using the graphics displayer EVINCE automatically puts filename on banner, and furthermore the following did not work with other viewers. Therefore consider the following to be “deprecated” (withdrawn) –jmw

To  actually use evince from the command line, type evince <filename> &

To actually use evince in a nautilus file manager, select (click on) the desired file, and go to
file>>open with>>evince

Commonly when one prints plots to a postscript from IDL and open it with evince(as we always do), the banner of the evince window perennially shows “Graphics Produced By IDL”, which is not helpful at all especially when you’re plotting a thousand plots and trying to compare them.

Hence a pair of IDL routines (OPENPS and CLOSEPS )can be called now to make the output PS file display the file name at the banner and to make the plotting to file process slightly less complicated. The way to call them is as follows:

OPENPS, blablabla.ps      //Before you plot anything. This will set the output device to blablabla.ps and by default color plot

[ DEVICE, FONT_SIZE=9]  //This is the optional part if you want anything about the graph beyond color, see IDL documentation on DEVICE for more

//information. Note that you may overwrite the color attribute here by saying DEVICE,/COLOR=PS

plot,bla

overplot.bla //Plot and add labels and do whatever as you like

CLOSEPS //When you’re done with one graph, simply call CLOSEPS, it will save the file for you and set the plotting device back to xwindows

WARNING: DO CLOSEPS BEFORE YOU OPENPS A NEW FILE. IN OTHER WORDS, EACH PLOT FILE MUST BE ENCLOSED BY A PAIR OF

OPENPS-CLOSEPS statement.

For more information, the code locates at /usr/share/astro/idlshare/locallib, or email huangy@carleton.edu.

 

-yuping

tempo2,fftw3 and cfitsio setup

TEMPO 2 is the newer pulsar timing package. FFTW3 is a fast fourier transformation library. CFITSIO is the NASA library for reading FITS format images. All of them are installed under $PSRHOME.  there’s another installation documenting file 00READMECarleton under that folder. FFTW3 and cfitsio are the dependencies for some of the tempo2 plugins and psrchive.

1. FFTW 3.3.4 is obtained from http://www.fftw.org/download.html,  unzip the tar file then

./configure –prefix=$PSRHOME/FFTW3/
sudo make
sudo make check
sudo make install

This will install the double precision FFTW3 library for TEMPO 2. However, the single-precision fftw
library that psrchive might require is not installed yet.

2.CFITSIO 3.370 is obtained from http://heasarc.gsfc.nasa.gov/fitsio/, unzip, cd, then

./configure –prefix=$SOFTWARE_DIR
sudo make shared
sudo make install

3. TEMPO2 is obtained by CVS anonymous checkout
cvs -z3 -d:pserver:anonymous@tempo2.cvs.sourceforge.net:/cvsroot/tempo2 co tempo2

The installation requires an amount of modification of config files (pgplot compilation flag, fixing bugs).
See 00REAMECarleton for details. But basically you do

./bootstrap
 setenv TEMPO2 $PSRHOME/tempo2/
 ./configure --prefix=$PSRHOME/tempo2/ --with-cfitsio-dir=$PSRHOME/cfitsio/ --with-fftw3-dir=$PSRHOME/FFTW3/ F77=f77
 sudo make && sudo make install
 sudo make plugins && sudo make plugins-install

-Yuping

printing postscript images to printer with gv (ghostview) as backup to evince

Bruce installed the gv package for viewing and printing postscript.  It works great for viewing.  For printing, it has problems.  Bruce developed this workaround (with a few mods by Joel):

‘gv’ uses the ‘lpr’ command, and if a printer as set as the default in CUPS it will use that printer automatically.  You can hear the printer warm up, but nothing comes out of the printer.

Fortunately ‘gv’ is packaged with a set of file conversion utilities,
including ‘ps2pdf’.  On the command line you can issue this command:

# ps2pdf xxx.ps – | lpr

and that will convert the ps file to pdf (version 1.4) before sending it to lpr.  (You can also convert in place – ie turn your postscript file into a pdf on disk with ps2pdf, and then send the pdf to the printer whenever you want.)

To print a ps on the fly, though:
gv’s print command dialog window has a typein labeled ‘print command’
and it’s automagically populated with the string ‘lpr’.  However you
can change that string to ‘ps2pdf %s – | lpr’.  You can also change
the default print string from ‘lpr’ to whatever you want in
GhostScript options, but that would break printing of non .ps Here’s.

To change the default print string in ‘gv’, select:

State->Setup Options

… Look for the Print Command field, and change the value from
‘lpr’ to ‘ps2pdf %s – | lpr’ (w/o the single quotes).

The change is saved to ~/.gv as the line:

GV.printCommand:        ps2pdf %s – | lpr

 

–bruce via joel

To access weekly online backup on canopus last updated 2024 August

Newest update 2024 Aug to reflect that backups are have been stored on canopus: for several years:

Go to canopus:/thuban2-backups

Bruce has an automatic (cron) job do a weekly backup of thuban onto canopus.

On canopus,

df -h gives the various mount points, incl
“Filesustem” /dev/mapper/centos_canopis-thuban2–backups”\
” Mounted on”  /thuban2/backups

Navigate down to whatever file you’re looknig for, and copy over to a safe place (Careful: do not overwrite newer file of same name on thuban!)

See also post on root superuser privileges on thuban2  (although current post you are reading deals with canopus, which is where weekly backups are stored).

–joel