MATE menu shenanigans

So I’ve got lots of stupid entries in my main menu in MATE — lots of things that seem to have been added by wine or something. And I’ve tried mozo/alacarte to get rid of them and they did not work.

The wine-related .desktop files live in the directories within…

.local/share/applications/wine/Programs

Now, the menu system looks for .desktop files and creates a menu entry for each one. So… so if I go in there and change the ‘.desktop‘ files to ‘.nodesktop‘, what happens?

Used a clunky script (I know, I know, going via a temporary file to construct the script is amateurish at best; well, it works). It just renames within the current directory — it does not work recursively; I don’t want to be that destructive!

echo "#Rename .desktop files to .nodesktop" > tempfile
for f in *.desktop
do
g=$(basename "$f" .desktop).nodesktop
echo mv \"$f\" \"$g\" >> tempfile
done
bash tempfile
rm tempfile

I don’t know enough to know why I had to write the mv command out to make it work, but when I just tried to run 'mv \"$f\" \"$g\"' from inside the script it did not work. This works and does remove the entries from my menu. I can then selectively put them back if I so desire.

Anyway, this does work for the MATE menu.

I’m sure there’s a better way. I don’t know why the menu editors don’t work.

But they don’t.

Advertisements

Clink; making the Windows command line more functional

Clink makes the Windows command line 10× more useful. Command completion, retain history between sessions, and a lot more. Installation is trivial. I just have to mention it because of how handy it is. Some tools don’t work brilliantly though Cygwin, so I need to use CMD.EXE. And it’s GPL.

With Clink, I can type a letter at the CMD prompt and then hit Tab twice and I’ll get a list of possible commands to run.

I installed Clink using the default installer then opened a command window. In the image below, note the info at the top showing that Clink has started up. I then typed ‘gv Tab Tab’ (ie hit Tab twice) and got a list of the executables that begin with ‘gv’ — gvim, the graphical version of the vim editor, and gvwgs64.exe, part of the Ghostscript/GSview universe of PostScript tools.

Screengrab of Clink at work.

Anyway, it has lots of capability and is seamless. I’m very impressed.

Genuine productivity.

Updating my Debian box — a non-expert’s experience

My Debian desktop box was running the LTS (long term support) version (in other words, older than oldstable, getting minimal updates and getting outmoded and old and crufty), which is the 7.x series. Support for that even as LTS is scheduled to end May 2018, not far away.

So I bit the bullet and decided to update to current, which is 9.3 (‘stable’). I like Debian, rather than one of the many distributions derived from it. I’ve found for me it words pretty well. Most problems I have are with applications not the OS, and when I’ve fiddled around with other Linux distributions, I have generally found that they are different but not better, and often have fewer packages. So Debian it is.

I don’t have a great network connection where I live (in the bush in Australia, which has poor broadband even in towns), so rather than do a net install I downloaded the iso for the installation disk and burned it. This file: https://cdimage.debian.org/debian-cd/9.3.0/amd64/iso-dvd/debian-9.3.0-amd64-DVD-1.iso. I did not bother grabbing 2 and 3; I have enough internet to grab anything not on the DVD from the server, and eventually the DVDs get out of date.

I also made what I think is a good decision about backups. I began with a 1TB drive. Not big now, but  the computer is about 7 years old, I’d guess. Maybe more. It has an i7-2600K, which was a pretty good chip at the time. When I got it I was using it for numerical modelling, like here, but I don’t do much of that these days, and with 8 GB RAM it is still perfectly capable of running a responsive desktop, so I do not feel a need to upgrade the processing power or the RAM. Since then, I bought a 2 TB drive for storing media, and bunged it in the case and mounted it as /home/username/Music. Worked fine. So with that in mind…

    1. Went into VirtualBox and exported all the virtual machines I wanted to keep to an appliance, ‘Appliance.ova’ — this was a 34 GB file.
    2. Went into firefox and exported my bookmarks to a json file.
    3. Used rsync to copy /home/username (including the Music folder, since it was mounted at the time) to an external USB backup drive called SAMSUNG. Here is the rsync command, for reference:
      rsync -a -v -v -v --stats  --log-file=logrsync.log /home/username /media/SAMSUNG/home/
      

      and note that I have excluded nothing, since I want to keep my web history as well as the actual data. This command will grab stuff like .mozilla/firefox profiles and the like, though more on that later. The Appliance.ova file was also in a place where it would get backed up externally.

    4. Left the 1 TB drive in the case but disconnected power and SATA cables from it. Since I’d been getting some errors from the drives, I decided to use the second row of SATA sockets for the new install where previously I’d been using the first. So I plugged in the CD/DVD and the 2 TB hard drive into the second row of slots, the DVD into the white socket and the HD into the first blue socket. I made sure to use SATA cables with clips.

      Picture of the mother board and which SATA sockets I used.

      Using the right-hand set of sockets for the SATA drives instead of the left.

    5. Double-checked that the USB backup drive had all my data — /home from the 1 TB drive and Music from the 2 TB drive. Yes, it did. Also had the Appliances.ova and the .mozilla hidden directory with all my web history and stored passwords (more on that later). Disconnected it from the machine. So now only the 2 TB HD and the DVD drive were connected.
    6. Put Debian 9.3 DVD 1 into the drive and rebooted the computer.
    7. Pressed ‘Del during boot to bring up BIOS menu and selected CDROM as first boot device. BIOS menu showed that we’re using IDE channel 1, not channel 0 as previously. That’s OK.
    8. Let the machine boot off the DVD and selected Install, not graphical from the menu. Graphical is probably fine but I’ve been doing this for a while and I have no problem with ncurses. Wired internet connection was in and on.

      Picture of the menu.

      Menu to select the Debian install method.

    9. Clicked through the install (Language, Location, Keyboard map, Hostname, Domain, Root password, User account, Clock

      Picture of the menu.

      Menu to select language.

    10. Partitioned the HD. SCSI 2(010)(sda). Whole device. 16 GB swap (2 × the RAM), then rest of disk at ext4 Linux, mount point ‘/’, and set this partition bootable. Done.
      Picture of the partitioner screen.

      Partitioning — setting up swap space.

      Picture of the partitioning.

      Setting up the root partition.

    11. Write the partition information to disk.
    12. Start installing.
    13. Threw a corrupt file error while installing the base system and dumped me into a text menu. Selected ‘Install base system’ or whatever it was (ie, have another go, please) and it went through. I only installed the base system (ie, command line tools).

      Picture of the error screen.

      Red screen means error.

    14. Linux image was amd64, and the kernel image (it told me) was 4.9.0-4.
    15. Told it I was not scanning anymore DVDs.

      Picture of the apt configuration screen.

      Setting up apt (the package management).

    16. Yes, please set up a mirror.
    17. Chose a mirror and let it configure apt. It said something about ‘upgrading’ but I don’t want to toast my bandwidth so I turned off my router. For now I just want to use the DVD, so once apt was configures with the correct mirror, I figured it would be OK to turn off the internet.
    18. Chose some software, set it to install but it halted at one pointed — needed to get something from the net, should not have turned it off yet. Reran with net on and ok.
    19. Yes, GRUB to MBR, please.
    20. Rebooted with web off. Changed BIOS to boot from HD and left DVD in as a file repository.
    21. As root, edited /etc/apt/sources.list and commented out the web repositories for now.
    22. apt-get update
    23. apt-get –install-suggests install mate-desktop-environment.
    24. Chose gdm3 as my display/login manager, since MATE and Gnome should work well together.
    25. Added some other stuff using apt-get; xsane, libreoffice, that sort of thing.
    26. Plugged in backup USB HD and, with a command line open in /home/username/, coipied all the backed-up material into my new home directory:
      cp -irv /media/username/SAMSUNG/home/username/* .
      cp -rv .[^.]* .
      
    27. Edited /etc/apt/sources.list to remove comments from web repositories, now that the bulk of the software was installed.
    28. Downloaded VirtualBox installer from https://www.virtualbox.org/wiki/Linux_Downloads.
    29. As root, installed a few packages it needs:
      apt-get install dkms
      apt-get --install-suggests install linux-headers-amd64 linux-headers-4.9.0-4-amd64
      apt-get install  libqt5opengl5
      dpkg -i virtualbox-5.2_5.2.6-120293~Debian~stretch_amd64.deb
    30. Then ran VirtualBox and imported the Appliance.ova file, and there everything was. Once I installed the guest additions, it all worked smoothly.
    31. Ran Firefox. Despite the exact copy of the old profile directory, it remembered nothing. I tried running firefox -P and selecting the profile that matched the old one rather than the new one it had cfreated, but that did not seem to help either.
    32. Mounted the old 1 TB HD using a SATA to USB adapter and recopied old profile directory from the 1 TB HD to the new directory (profiles live in /home/username/.mozilla/firefox with filenames like brqhj45.default-1234456787655).
    33. That fixed my passwords but not the bookmarks.
    34. Within the bookmark manager of Firefox, imported the json file I created in step 2, and that fixed that. Done.

So at the end I had my old root drive (minus the Music folder) on the old 1 TB drive as emergency snapshot and backup, I had a current backup on the external USB HD (including the Music folder) and on the 2 TB drive, which used to be just the Music folder, I had everything, including Music.

Still got some issues with Windows progs installed under the old wine not working with the new one — but install media not working with new one either so cannot reinstall…

Relatively painless.

 

 

 

Changing a Word template to fix the dot leaders in the ToC

This is the second of two posts on the topic. The other is here.

(1) Open the template (.dotx file) in Word as if it were a document.

(2) Find an example of the type of thing you want to change (in this case, level 3 entry in the table of contents).

(3) Open the Styles pane.

(4) In the styles pane, right click on the style you want to change. Select ‘All instances’.

(5) In the styles pane, right click on the style you want to change. Select ‘Modify’.

(6) If you want to fix the ToC as noted in the previous post, see that post to see what you need to change. If you want to change other aspects of the template, I’m sure you can work that out.

(7) Save the changes and close the file.

(8) Open the word file and attach the template (see previous post), and styles should update. If not, check ‘Automatically update document styles’ when attaching the new template. Once the fix works, you may then want to reattach it without checking that box so that styles don’t get accidentally modified.

 

Comments.

Word: Dot leader sporadically missing from table of contents: Fixed

This is the first of two posts; other is here.

So I’ve got a Word file with a table of contents (ToC) that, every so often, is missing the dot leader (row of dots) between name and page number. Like this:

image grabbed from faulty Word file

Example of Word table of contents with dot leaders missing and page numbers in wrong place (see Mean and Mode).

Now, I checked that this is not just a display problem, and yes it does print like that too. The ToC was put in using Word defaults with the headings all styled as H1, H2, H3. Nothing out of the ordinary.

So of course I did a web search and found: https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_other/dot-leader-sporadically-missing-from-table-of/78038ac4-4df2-46a7-93c6-4939ef3056d2?auth=1 (hence the title of this post of mine).

But this page does not give an explicit fix, at least, not for the average user. But it does give the hint – note that the entries that are not working are short. For example, I can change ‘Mode’ to ‘Mode Mode’ and it is ‘fixed’:

Screen grab of the Word document with Mode replaced by Mode Mode (made longer). Now the spacing works properly.

If the entry is long enough, no problem (see ‘Mode’).

So the simplest solution is to rephrase the headings to be a little longer. Easy but suboptimal. Note that putting it back to just ‘Mode’ and updating the table recreates the error.

Here is the solution (at least in my context).

(1) On the Home ribbon, expand the list of Styles by clicking on the little arrow at the bottom right of the styles pane.

screeenshot from Word showing where to click to expand the Styles pane

Expanding the Styles pane.

(2) Then Go to TOC 3 in the Styles list

(3) Right click and select ‘Select All Instances’

(4) Right click and select ‘Modify’

(5) Select ‘Format’

(6) Select ‘Paragraph…’

(7) Change ‘Hanging’ indent to ‘(none)’

(7) On the same dialog, select ‘Tabs…’ (bottom left corner).

(8) Highlight the first tab stop (there will likely be two) and delete it by selecting ‘Clear’. There should now only be one tab stop, that giving the page number position (15.9 cm in the picture here).

(9) Make sure the button beside ‘2 …..’ is checked. Then OK all the way out and bingo, fixed.

(10) Caveats: I don’t know how this solution might interact with other ToC styles and formats. It worked for me, YMMV. Also, if the change is not saved back to the template (ie, this change is made permanent) then when the file is reopened and attaches the template, it will revert to the faulty version. Solution is to either do a manual fix each time (or at least each time you want to print the document) or to make a custom template and attach that.

The latter is better. The simplest thing is to find the template you are using (File → Options → Add-ins → Manage: [Select ‘Templates’ from the dropdown menu] then click OK and the template and its path will appear in a little text box in the dialog that comes up) and then find it in your file manager and make a local copy of it, either in your personal Templates folder or in the same directory as the Word .docx file you are working on, depending on whether the change is just for this document or for all future documents. Then use the ‘Attach…’ button beside the name of the template to browse for your copy of the template.

That will attach the copy to the Word file. Then do the changes noted above, but with one addition: The change will be stored to the template if you select ‘New documents based on this template’ in the ‘Modify Style’ pane. When you close the Word document, Word will/should ask you if you want to save changes to the template. Or, at least, that’s how it looks.

Alternatively, see post ‘Changing a Word template to fix the dot leaders in the ToC‘.

Wordy McWordFace

Try to forget The Sky Remembers

The Sky Remembers

by

Dan Brennan

NEL 1978

155 pages

This is quite possibly the worst book I have ever managed to finish. Doing so was an effort of will, undertaken for reasons that are not clear to me but may involve my desire to write this review.

Colour scan of the cover, front and back.

Cover of The Sky Remembers by Brennan; this is the best bit of the book.

The story is simple enough. A cocky fighter pilot, a real leader of men, has had the stuffing knocked out of him by a near death experience. He’s recuperating, he’s lost his bottle, but it’s the darkest days of the Battle of Britain and he’s needed in the air.

He battles through his overwhelming doubt and his many losses and proceeds to return to the fight.

It could be all right. But the prose…

extract 1

It’s relentless. It goes on like some kind of incantation. Here’s a bit more:

extract 2

And on it goes. It reminds me of Beckett’s The Unnameable, but not in a good way. It’s 155 pages but a well-written 50 could have made this an evocative little piece. Instead, the author flings words at the reader in a desperate attempt to convince and evoke. Why say something once when you can say it three times?

The longest 155 pages I have ever read.

Book bashing.

Acrobat Reader gives blank ‘Save’ or ‘Save As’ screen

Went to save an annotated document in Acrobat Reader DC (on Win 7) and got a blank dialogue box:

Screenshot of the blank and useless 'Save' screen Acrobat sometimes gives.

Acrobat’s blank ‘Save’ or ‘Save as’ screen.

Thought it might be to do with the comments, but it’s actually to do with Adobe’s obsession with driving custom online — fortunately, the fix is simple:

Go to

Edit → Preferences → General

and deselect anything to do with online storage — in the case below, it is ‘Show online storage when saving files’:

Screenshot of the Preferencesd menu and where to turn off 'Show online storage when saving files'.

Where to make the change.

Voila (as they say, which is odd ‘cos I thought it was a cross between a violin and a tuba).

Manually adding a dictionary to Notepad++

You can work this out yourself, but a blog is always in need to content…

Notepad++ is an excellent Windows editor.

The dictionaries with which it is installed seem to live in:

C:\Program Files\Notepad++\plugins\Config\Hunspell

(maybe Program Files x86 on some machines). The local ones are expected to be in:

C:\Users\username\AppData\Roaming\Notepad++\plugins\Config\Hunspell

if you do a conventional install, or the the Program Files directory if a USB-type install.

To add one, Plugins → DSpellCheck → Settings

I clicked Download Dictionaries, but it could not connect to any of the suggested servers. (‘Status: Can’t list directory files’; computer is accessing internet no worries, so that’s not the problem.

Dictionaries have names like ‘en_US.dic’, and are Hunspell ones. First, looked around on my computer to see if some other application had already downloaded them. LibreOffice, that sort of thing.

OK, no luck. Went back to the Download Dictionaries dialog and copied the address it was going to for dictionaries:

ftp://sunsite.informatik.rwth-aachen.de/pub/mirror/OpenOffice/contrib/dictionaries/

Yes, opened OK in browser.

Saved en_AU.zip to:

C:\Users\username\AppData\Roaming\Notepad++\plugins\Config\Hunspell

unzipped it; made sure the files were in the Hunspell directory, not a subdir of it.

Then back in notepadd++ Plugins → DSpellCheck → Settings

Clicked on ‘Language:” and the dropdown had AU in there as well; selected it.

Done.

Announcement – A Hand of Knaves TOC — David Versace

The table of contents for CSFG’s upcoming anthology A Hand of Knaves has just been released. I am pleased to announced that my story “A Moment’s Peace” is in the mix. (It’s a fantasy-world burglary featuring a point man with an unusual condition). You can see the full list of authors and titles here. A…

via Announcement – A Hand of Knaves TOC — David Versace

VirtualBox full screen goes grey

32-bit Win 7 VirtualBox virtual machine (VM) running atop Linux (Debian Old Stable, 7.11). VirtualBox version 5.1.30.

Boots fine, behaves well… here is the resulting desktop, captured using Host-E:

Desktop of Win 7 32-bit VM in VirtualBox.

Win 7 32-bit VM in VirtualBox.

Now, to get full screen, I hit ‘Host-F’ where the Host key is usually right Control. Here’s what happens when I do that (grabbed this screen using Gimp, since Host-E gave an image identical to the above, which was not what I actually saw):

A plain grey screen with no desktop.

The Win 7 machine on going to full screen using Host-F.

Now, if we look more closely at the second image, we can see a cursor (near the top):

Close up view of the four-pointed cursor

Close up of the cursor.

What seems to have happened is that the narrow border around the screen, drawn I think by VirtualBox itself, is covering the VM screen. Since VB is drawing the border itself, and knows it is a border and not the VM screen, presumably it doesn’t capture it when Host-E is used to grab the screenshot, which is why the Host-E screenshot actually looks OK — even though the user (me in this case) can’t see anything! But Gimp captured what was really there.

Now, the fix is easy — use the four-pointed cursor (yours may look different) to resize the bottom border by clicking and dragging it all the way to the bottom of the screen:

We see the four-pointed cursor being used to change the dimension of the bottom fram to something more sensible.

Dragging the top edge of the bottom border back down to the bottom.

So I guess this counts as a minor bug in VirtualBox, but not much of an issue. So now that’s sorted out I can get on with some editing.

 

Et seq.