Skip to content

Author: jweisber

Show if a file is a link in Nautilus File Manager (but not whence [target])

Recently I discovered the following two ways to show if a file is a link in Nautilus List View. Sadly I have not been able to find a way for list view to show the link target, which Nautilus used to do. (For an individual file, one can determine it via File >> Properties .)

  1.  In list view , each file has an icon on far left, and a link superimposes onto that icon a “badge” that is a curvy arrow. The trouble is that this is faint, which is why I never noticed it before!  After a long time of trying to change the default badge for a link to something more noticeable, I gave up. I can do it for an individual file, but not for the class of all files having a link.
  2. FInally I figured out how to  denote all files that are actually links  in the list view, via the unix “permissions”  which include a leading ℓ if it is a link.  I think this is how:
    edit>>preferences>>list columns pane: I now place checks next to:
    Name
    Size
    Date  Mod
    Group
    Owner
    Permissions
  3. Sadly, I have not found a way for the list view to automatically show the link target (i.e. the name of the file that each link is attached to), as it used to. That is, I cannot create a column showing this information in the list view. As noted above, for an individual file, one can determine it via File >> Properties .)

pgplot is in multiple locations! caution!

We have been moving from centos6 (32bit OS) to centos7 (64bit OS)

One of the big things I had to do was make sure that pgplot and cpgplot would work on centos7

I now see (as I had already vaguely thought) that there are multiple pgplots in multiple places.So user beware!

As of 2021 Feb 12, we have (on thuban2 disk system) a
/var/share/astro/ which was used by centos6
/var/share/astro_centos7/ is to be used by centos7 after we upgrade the desktops to centos7. Note that at that time, /var/share/astro_centos7/ will look to the desktops as if it is the “default” /usr/share/astro/ thanks to Bruce’s wizardry. 

/var/share/astro:

As of right now, I have found pgplot in the following 3 directories:under /var/share/astro/:

[jweisber@thuban2 astro]$ pwd
/var/share/astro
[jweisber@thuban2 astro]$ find ./src/pgplot | wc
795 8745 77769

[jweisber@thuban2 astro]$ pwd
/var/share/astro
find ./psrhome/src/pgplot | wc
796 796 30909 mostly from 1990s

[jweisber@thuban2 astro]$ pwd
/var/share/astro
[jweisber@thuban2 astro]$ find ./psrhome/pgplot |wc
33 33 873 from 2016 by Yuping, some executables and libs

See also one 32 bit pgplot dirs and/or files under /var/share/astro/: (whereas astro_centos7 below has heaps)

[jweisber@thuban2 astro]$ pwd
/var/share/astro
[jweisber@thuban2 astro]$ find ./psrhome/psrchive-Carleton-install -ls  | grep pgplot_32bits | wc
32 352 4042 (2015 yuping files in ./psrhome/psrchive-Carleton-install/pgplot_32bits/)


/var/share/astro_centos7:

I have also found pgplot in the following 3 directories under /var/share/astro_centos7/:[jweisber@thuban2 astro_centos7]$ pwd
/var/share/astro_centos7
[jweisber@thuban2 astro_centos7]$ find ./src/pgplot | wc
795 795 24504 (files mostly from 1990s)
(apparently identical to standard old /var/share/astro/)

/:[jweisber@thuban2 astro_centos7]$ pwd
/var/share/astro_centos7
[jweisber@thuban2 astro_centos7]$ find ./psrhome/src/pgplot  | wc
798 798 30977 (files mostly from 2021 Feb [a few days ago!])

[jweisber@thuban2 astro_centos7]$ pwd
/var/share/astro_centos7
[jweisber@thuban2 astro_centos7]$find ./psrhome/pgplot |wc
284 284 7421 from 2021 mainly .o files dated Feb (recently) probably what I got running on phasshare, though rather skinny in number of files!

See also a ton of various 32 bit pgplot dirs and/or files under /var/share/astro_centos7:
First under ./psrhome32:
[jweisber@thuban2 astro_centos7]$ find ./psrhome32 -ls | grep pgplot | less
–A few files under ./psrhome32/pgplot_32bits/ , mostly dated Nov 8-9 2020 (which is the date many of them were copied to the   64 bit virtual  test machine “phasshare”)
–Pretty many under ./psrhome32/src/tempo2/, also dated 2020 Nov for same reasons as stated above.
./psrhome32/src/pgplot/ which has tons of mostly 1990s files and a few from Nov 8
./psrhome32/pgplot/  A bunch of almost entirely .o files, mostly dated Nov 8 for reasons given above
–the famous ./psrhome32/src/psrchive/packages/pgplot.csh which we eventually used in order to successfully build (pgplot make and other scripts and especially cpgplot make and other scripts) on phasshare, also dated Nov 8

Now under ./psrhome/psrchive-Carleton-install/pgplot_32bits/:
[jweisber@thuban2 astro_centos7]$ find . -ls | grep 32bits | less
./psrhome/psrchive-Carleton-install/pgplot_32bits/  has lots of files owned by Yuping  from 2015.

Yuck! They’re proliferated all over /var/share/astro_centos7!

change default postscript viewer (and other apps too) in nautilus file manager

to change default postscript viewer (or many other apps in nautilus) go to

/home/jweisber/.local/share/applications and
open mimeapps.list with kate or another text editor.

Go to default applications category (in mine it is the bottommost of 3 categories) and change the postscript viewer to

application/postscript=kde4-okularApplication_fb.desktop. if you’d like to change it to okular

I find okular great for a number of reasons – it will print the name of displayed file on the banner, show thumbnails of multiple pages, and more.  Evince is another nice one.  The default was gv which is ok but . . .

(I stole that from the top list which gave about 5 options, presumably the ones that appear in the nautilus menu when you go to file>>open with

–Joel

idl unix-like commands – see also 2023 11 03

OK.  idl has some built-in unix-like commands, but then others require a ‘$’ beforehand  which I think summons the unix shell.  The various unix-like commands that an idl user might like are a mixture thereof, so see below whether or not there is a $  (See also a third option, spawn, below.):

cd, ‘/data/psrdata/   note no $ : this is a native idl command made to look like its unix cousin

pwd                         ”       ”   ”     ”        ”  (This and previous command often go together ,
since this one returns the “present working directory” which should
verify that your cd command did as you wished! (There is supposedly a
way to get the idl prompt to show the pwd but I haven’t yet figured it out.)

printd or popd or pushd are all native idl directory-oriented commands made to look like their unix cousins (or in printd case, just print the current directory name – no unix cousin exists.)

$ls     Needs the dollar sign which I think invoked the unix shell.

The idl spawn command can also be useful: 

spawn,’ls -als | grep arecibowapp’ is a way to do the idl version of the unix  ls with flags, and even then pipe it into another command. This looks like the most flexible!.

spawn,’ps aux’  ditto

 

clear firefox cache cleanly to free up space and not overflow quota

A cleaner way to free up firefox cache space, was provided by Mike Tie via Bruce Duffy.

I noticed I couldnt log in to carleton email via astronet firefox and these guys said it was because of a carcass in cache. So this is the procedure for clearing cache, which can also often bring a user’s space down below their quota limit:

Firefox has cached the old info, and now you need to clear the firefox cache. To do that, Launch firefox, click the three bars in the upper right corner of the firefox window, click Preferences, click the lock icon (middle left of the window), scroll down to “Coookies and Site Data”, click on “Clear Data…”, make sure both items are checked, and click “Clear”, and then click “Clear Now”.

shutdown and reboot

One needs to be root or have sudo privileges to do this:

sudo shutdown -rv 2

-rv  2 means :

r is restart after shutdown;

v means verbose

2 means in 2 minutes

which python on which host?

we checked all 3 machines for which version of python on each

literally typing
‘which python’
gives me (at least on  all three hosts) /usr/bin/python      this is not super helpful because it doesnt say which version.

ls -als /usr/bin/python on all three hosts  is also not that helpful as it just spits back the python executable named python.

ls -als /usr/bin | grep python gives me every file in there with a name including python. Then I see that “python” and python2.6 have identical size and date on all three hosts

so the final answer is that all three are using 2.6 by default

Caution: Note that astropy is only on python 2.7 and so we should actually use 2.7  . Yuping  and/or Bruce installed 2.7 in order to “make” psrchive  .  (See Yuping’s post under “python” category.)

IDL manual breakpoint operation

using breakpoints on idlde over vncviewer (as opposed to chicken-of-the-vnc) was fraught.  The usual key combinations would not place breakpoints anywhere.  But I eventually learned that:

DOUBLE CLICKING ON GRAY BORDER AT VERY LEFT OF DESIRED LINE TOGGLES BREAKPOINT

Here is a harder way that I learned before above red easy way:

  1. select desired line
  2. shift control b toggles a breakpoint on that line.

Here is an even harder way to do it from keyboard:

help,/breakpoint  will give a list of existing breakpoints

cd, ‘full path to desired directory’ will change idl’s current directory from users home directory (the default) to another. remember apostrophes CASE SENSITIVE

printd   prints the current directory

IDL> printd
Current Directory: /data/psrdata/arecibopuppi/B1913+16/2019Aug
Directory stack is empty.

breakpoint,/set, ‘filename inside of current idl directory path [see printd above to discover current path value] ‘, 150   (use apostrophes, note final value is linenumber) CASE SENSITIVE

i think i did not see the red circle on line 150 of idlde until i recompiled.

check out help,/breakpoint to see a list of current breakpoints, including their “index” which can be used in some other breakpoint commands like breakpoint,/clear,1 (index 1)

IDL> help,/breakpoint
Index Line Attributes                                                 File
1         150      Pro=PLOTADAYSRMTOT       /data/psrdata/arecibopuppi/B1913+16/2019Aug/plotAdaysRMtot.pro

python how to find installed astropy: 2.7. Execute .py with “python2.7

The following red material is the newest guidance:
Note that since astropy is in 2.7, 2.7 should really be the default, not 2.6 as it now is. 
To run 2.7 on a program sitting in a file called “nameOfThisFile”,  Type:
“python2.7 nameOfThisFile” in command line, as Helen did in comments atop her IonRMdailyPlot.py  , which is in
/data/psrdata/usr5/rmiono/ionFR-Sobey/

Helen Du figured out the following for finding where (if) astropy is on our network:

/usr/local/lib/python2.7/site-packages (Joel changes this to 2.6 but that doesnt work. see helen’s and Joel’s update at bottom. Esp very top in red)
is where all the packages are.
Specifically, “David Hollander” pointed me to the right path. Here’s what he said:

For Ubuntu,

python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"

…is not correct.

It will point you to /usr/lib/pythonX.X/dist-packages

This folder only contains packages your operating system has automatically installed for programs to run.

On ubuntu, the site-packages folder that contains packages installed via setup_tools\easy_install\pip will be in /usr/local/lib/pythonX.X/dist-packages

The second folder is probably the more useful one if the use case is related to installation or reading source code.

If you do not use Ubuntu, you are probably safe copy-pasting the first code box into the terminal.

—————————————————————————–
additional information added by Helen shortly after the above:
Another note:
/usr/lib/python2.6/site-packages  seems to be where the packages that have the basic/initial/…(can’t think of the correct word…) packages for running Python 2.6,
while
/usr/lib64/python2.6/site-packages  has other stuff as well… including scipy, numpy, and matplotlib.