Skip to content

Carleton Astronet Admin Log Posts

root sudo superuser privileges on thuban2

The only way I know how to get into thuban2 is to be on canopus or mirzam, and from there,

ssh thuban2

To do important stuff, one needs to have root (aka superuser) privileges.

I tried sudo blah blah blah with limited results.

Bruce says I need instead to do

sudo su –  (that’s a blank followed by a minus sign)

see also my entry for location of backups on canopus

Hitting disk space limit? Near disk quota?

If you see funny behavior on your account, it might be that you are running out of disk space.
A good citizen might do the following every few months, but that ain’t me babe.

The command :   quota         will tell you how close you are to your quota.

If you are close (or over!!!), then it’s probably junk files doing it, which can safely be trashed.

But how to find the culprits?  How to separate the chaff from the wheat?

(See update at bottom for some of Bruce’s tips on how to find offending files,
but immediately below this line are Joel’s less sophisticated directions.)

du -ak | sort -n | tail   will give you a list of the biggest dozen or so files.  That, of
course, doesn’t necessarily mean they are trash.  But common places
with lots of trash are (in my experience)

<your home directory>.Mathematica/Paclets/Temporary      (note the dot before Mathematica!)                                      This often has enormous garbage there. Clear out any contents (but
probably not the directory “Temporary” itself.). I had the courage to byte
this bullet after reading
https://mathematica.stackexchange.com/questions/64130/mathematica-appdata-folder-is-taking-up-too-much-space
Note that the comment there also makes the reasonable statement that
the contents of any directory called Temporary or the like are fair game!

<your home directory>.mozilla/firefox will have one or more directories with gibberish names.
(note the dot before mozilla!)
If there is more than one, than trash all but the newest.

For me at least, even in the newest, I had a cache2 directory whose enormous contents I
trashed.  I also googled how to force firefox to automatically clear its cache
whenever firefox is logged out so that this garbage doesn’t accumulate!


Here are Bruce’s more sophisticated directions from an email on July 15, 2024:

I ran this report:
du -hx /var/share/home/curtina | grep -P ‘^[^\s]+M’

 

 

 

IDL’s array index special handling, including the colon ( ‘:’ ) and the asterisk ( * )

Note that IDL 2-dimensional arrays are given as Z[A,B] where A is column ref; B is row ref

x[*] means take each element of x (separately), so

x[*] = y[*] means,
x[0] = y[0], x[1] = y[1], … up to all elements of the arrays

x[0:2] is essentially does the same but on a subset of an array; eg
take elements 0 through 2 of the array (and do “whatever”)

I read also that this notation, esp on lhs, is much much faster than
conventional looping etc.

link example ln -s

Here is a successful example of linking a file that really exists in subdir of PersArmNoIntarm,
up to a phake one in main PersArmNoIntarm.  Note I am doing it FROM desired location of
phake.  I say to ln -s the original, down in subdir, to “dot” which is current (main) dir:

PersArmNoIntArm> ln -s OutputFromLocBoots/PersNoIntArmvsLocSlopes.20240717_S.Summ.eps .

print idl’s path and see if it can find a file within it and note capitalization conventions

IDL> print, file_which(‘chjuldaytolmstGALFA.pro’)
/usr/share/astro/idlshare/locallib/chjuldaytolmstGALFA.pro

 

and more specifically:

from https://stackoverflow.com/questions/29986130/idl-procedure-wont-compile

IDL procedure won’t compile

But when I try to find the procedure using “Findpro” I get

Procedure CHLOADCT found in directory  /data/clh93/colortables/CH/

So my paths are right. I don’t understand why it won’t find my procedure, does anyone know what’s going on?

Answers:

Things to check in situations like this:

  1. you are consistent about whether the routine is a function or procedure, i.e., routine is procedure and you are calling it as a procedure
  2. routine you are calling is either compiled already or the last routine in a file named the same as it with a .pro extension; the case of the filename and routine call must match or the filename must be all lowercase (just use all lowercase in filenames!)
  3. quick check to see if my_routine.pro is in your !path:
    IDL> print, file_which('my_routine.pro')
    

    It will return an empty string if it can’t find it.

  4. make sure the file is not in your !path twice and you are getting someone else’s or an old version

Detect input (read) error without crashing program. Complicated fortran-like reads

Fortran has the ability to send one somewhere upon an I/O error:

read(43,100,end=50) x,y,z         in which case program will go to statement labeled “50′ upon a read error.

IDL does not have such a simple way to do it. But after many hours, I got an equivalent process to work.  An example is in the
/data/psrdata/rmgalprojs/rm2016/AO_Pulsars_RM/Longi_RM_Plots.pro file, specifically in
the PersArmNoIntArm data input section.

——————————————————————————

The same section of code illustrates painful read in of a complicated data file, where a single (long) row had been turned into six. It is similar to but not quite identical to fortran. I had to eliminate all format = ‘(sd;jkfsd;jkg)’ statements because idl and i (≡fortran) did not interpret them the same. Instead I had to force variables to have the right type before reading data into them, by initializing them.  For example, to read the following variables properly, i did things like:

ztext = ‘  ‘
xfloat = 3.5
ydoubleprecision=8.d0

Then when I read a file into those variables from a file , idl will treat those variables as the types given in the initialization statements.

When Mirzam can’t be ssh-ed into (usually after reboot)

When Mirzam can’t be ssh-ed into (usually after reboot):

/home and other NFS volumes exported by thuban2 probably aren’t mounted.
 
They should have automounted when mirzam was rebooted because they’re listed in /etc/fstab.

The fix is to login as root (which does not require /home) and then run the ‘mount -a’ command.

Bruce

Joel adds:  One needs root’s password in order to pull this off!