Windows without admin rights…

Yay,  new work computer. Boo, Windows. Boo, no admin rights.

But

Cygwin

Install Cygwin via running the setup program in the CMD prompt:

setup-x86_64.exe -B -d

then use the same (maybe wrapped in a shortcut) to update it, and we can use it without admin. That gives all the software within Cygwin, which is a lot, including powerful GUI tools as well as the command line  (Inkscape, for example).

Java

OpenJDK zip file can just be unzipped in any folder (I have it in C:\Users\darren\installs\jdk-19.0.2) then you can add its bin to your path.

crgrep

crgrep needs Java, so once OpenJDK is in place, can be installed in much the same way, with JAVA_HOME created to point to where you want it.

pdftk

pdftk was a bit trickier, but if you have Java, then  put the jar file from https://gitlab.com/pdftk-java/pdftk into some folder, then put a small batch file in your path:

java -jar c:\Users\darren\installs\pdftk\pdftk-all.jar %*

%* means ‘all command line args’, so this basically just works like pdftk.

I put the Cygwin /bin folder on the END of my windows path, always on the end so if I am running in Windows nothing gets gazumped. I also go into the Cygwin bin folder and copy find to gfind, so I can use Windows native find and ‘gfind’ for find at the Windows prompt.

Of course I could install a bunch of portable Apps, and I will if I need them.

Install ImageJ without bundled Java (Windows)

Just a note to self. ImageJ with the bundled Java is 80M. Without, about 6M(!). There’s a good chance you already have Java.https://darrengoossens.wordpress.com/2020/05/02/install-imagej-w…out-bundled-java/

  1. Click the Windows button and type ‘Java’
  2. Choose the Java command (not the shortcut) and click ‘Open file location’ (if it shows up — if not, install the ImageJ with bundled Java); it may be something like “C:\Program Files (x86)\Common Files\Oracle\Java\javapath”
  3. Go to the address bar and copy the location of ImageJ
  4. Click on Windows menu, type CMD and open a command prompt
  5. type ‘cd Ctrl+v’ and paste in the Java address, and Enter
  6. dir should show java.exe
  7. Type ‘java -version’ — one hyphen! Check it is big enough to suit ImageJ (at present, 1.8 or greater).
  8. Download the ImageJ program without bundled Java (https://imagej.nih.gov/ij/download.html).
  9. Unzip it and copy the contents somewhere sensible — I use an ‘installs’ folder in my personal file tree.
  10. In the ImageJ folder, click on ImageJ.exe; it should automagically find the Java executables and ‘just work’. If not, it should still great a config file, something like this (ImageJ.cfg — note the dot on the first line; this file is in the same directory as the jar file):
.
C:\Program Files (x86)\Java\jre1.8.0_241\bin\javaw.exe
-Xmx640m -cp ij.jar ij.ImageJ

So you can see the address for your javaw.exe is given here. If you have several Java versions installed and ImageJ picks the wrong one, you can manually alter this file.

Dun.

Flesh — readability tool

This is an implementation of Flesch reading ease that processes “plain text, rich text, Word documents [.doc not .docx], and PDFs”. It is getting old (2007). Even so, here is how I installed it.

Download from https://sourceforge.net/projects/flesh/files/flesh/Flesh/

Got the file Flesh-Linux.zip

(Yes, I am on Windows, and I am using the Linux file.)

Unzipped it and found the location of Flesh.jar

Opened a command prompt (CMD.EXE)

Typed:

C:\> java

Yes, I have java installed. If not … I would have needed to install it.

OK.

Created a batch file in my path (put it in C:\Users\usern\bin). It is called flesh.bat, and has one line:

start /b java -jar c:\Users\usern\installs\flesh\lin\Flesh.jar %1

where the path is the path to Flesh.jar.

Screenshot showing the batch file and shortcut
The files to get Flesh to work how I wanted it

Then created a shortcut to the batch file to allow running from the desktop, and gave the shortcut an icon. There are icons inside the zip, if you prefer.

To run it, I double click the icon and open a file in the usual Windows-y way, then get an output screen something like this:

Screenshot of output, showing grade level and other stats
Output from Flesh.jar

It is quite handy and quick. I cannot say I have benchmarked it against other tools, though the research on this seems to suggest that various tools that notionally calculate the same metric often give different answers anyway. A couple of quick tests show it gives very similar results to the checker incorporated in Micro$oft Word.

 

Readability

crgrep on Debian — easy and powerful

(1) Downloaded from sourceforge

https://sourceforge.net/projects/crgrep/

(2) Put it in my ‘installs’ folder:

$ mv ~/Downloads/crg* ~/installs

(3) Went there and unzipped and followed the instructions…

$ cd ~/installs
$ unzip crg*zip
$ cd crgrep-1.0.5
$ view INSTALL.txt
$ cd bin
$ cp dot-crgrep ~/.crgrep

(4) Put link to script in my bin directory

$ ln -s /home/username/installs/crgrep-1.0.5/bin/crgrep /home/username/bin/crgrep

(5) Bit of a test:

$ crgrep -h

And then watch it work, searching everything.

Points to note: It really needs Java 1.8 or above. I had an older Debian install with 1.6 and it just did not work. Try:

$ java -showversion 2>&1 >/dev/null | head -3

openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-1~deb9u1-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)

(the bit of magic ‘2>&1 >/dev/null |’ is because the information goes to stderr; this directs stdout to /dev/null and stderr (stream 2 as in 2>) to stdout before piping the result (stderr) to head and just showing the top three lines. I don’t really know how it works but it does. )

Key flags include

-r = recursive
-i = case insensitive
-h = help

and so on.

It will throw the odd error. I do sometimes get

crgrep failed for an unknown reason, described as: Your InputStream was neither an OLE2 stream, nor an OOXML stream

but it’s still useful, and quick. Searches PDF, ODT, DOCX, DOC etc all at once.

Ta ta.