30 June 2020

Stop Netbeans downloading whole 1GB maven index

Netbeans for Java programming with Maven likes to download the Maven index that's over 1 GB in size.

There's basically three ways to stop that huge download for 3 different situations:

(1) Temporarily don't want auto updates

If you already downloaded the index, the updates are smaller but still sizable.  One way to to stop it re-downloading the updates is to go to:

Tools > Options > Java > Maven > Index > Index update frequency > set to never.

Then click "Index Now" in that window only whenever you want an update.

(2) Just don't want Maven at all

If you don't have the index downloaded yet (e.g. a new install) and basically never want to use Maven, then in that same window, you could instead check off:

Completely disable indexing

As it warns you, lots of features will be disabled, but if you're not using Maven, who cares?

(3) Want Maven index without the download

This is amazing, there's this plugin you should get and it'll solve this problem: Maven Remote Search plugin.

It's old and it says it's for Netbeans 8.2 (the super old Oracle version), but I tried it out and it works for the new Apache Netbeans 11 and 12!

It lets you search the Maven index online rather than downloading the whole index to your local disk (which is crazy).

The github repo for the plugin is active recently with a historical build, so hopefully it'll get its version bumped and put on the Apache Netbeans plugins web page (which I don't think exists yet...).


Bibliography:

21 June 2020

Migrating to Debian LXQt - great apps, tips and fixes

I like LXQt and use Lubuntu.  I'm trying out Debian LXQt because of... snap issues.  So here's the Debian LXQt edition of my previous Lubuntu productivity software to install and  migration notes.

TL;DR...

After installing the standard Debian testing distribution (currently bullseye), I like to:

# for building some kernel modules
sudo apt-get install build-essential dkms linux-headers-$(uname -r)

# enable contrib and non-free repos
sudo sed -ri 's/^(deb.*main)$/\1 contrib non-free/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get upgrade

# productivity software I like
sudo apt-get install chrony file-roller xournal evince nomacs graphicsmagick ghostwriter emacs gimp gimp-plugin-registry gimp-gmic default-jdk gcc make ttf-mscorefonts-installer ruby vlc  libsecret-1-0 libsecret-1-dev keynav gedit restic

# enable libsecret for git
sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret


# because where I am, it's hard to contact a time server except Apple's...
echo 'server time.apple.com iburst' >> /etc/chrony/chrony.conf

# make an icon for GraphicsMagic
cat > ~/.local/share/applications/GraphicsMagic\ display.desktop << EOM
[Desktop Entry]
Encoding=UTF-8
Name=GraphicsMagick display
Comment=GraphicsMagick display
Exec=/usr/bin/gm display %F
Icon=lximage-qt
Categories=Graphics;Viewer;RasterGraphics;2DGraphics;Photography;
Type=Application
MimeType=image/jpeg
Terminal=false
EOM

# install aws-cli 2 using curl,unzip,install, like this:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install


Note: ttf-mscorefonts-installer might require user interaction to install, so don't walk away from it overnight thinking everything will be done by morning.

Then install by hand VS Code, Chrome, Netbeans, and LibreOffice dictionaries and plugins etc.


Finally, also set up file-roller integration.


Software to Download and Install by Hand

The default package manager using the default Debian software sources (testing channel) are pretty good at keeping up with the versions.  I like doing that most of the time to reduce on maintenance.

Some things are worth the manual install though.

1. LibreOffice needs some extensions, dictionaries, and settings:
  • an extension I rely on a lot:  MultiFormatSave.  Let's you save a document to multiple formats at the same time, great for archival compatibility.

     
  • it needs a dictionary for spell checking!  For English, these dictionaries from LibreOffice are good.


  • this setting is essential to prevent previews of recent documents on the start screen, which is quite a privacy blunder:
    • Tools menu > Options > LibreOffice > Advanced > Open Expert Configuration > Search for RecentDocsThumbnail property > toggle to false.

2. Google Chrome is self-updating.  I prefer Firefox, which is installed by default, but sometimes you need Chrome.


3. Apache NetBeans.  This requires as a dependency the Java JDK at least version 8.
  • So use muon to install the default-jdk because the default is version 11, which works fine so far.

  • And get the "Maven Remote Search" plugin before Netbeans starts downloading and extracting the maven index that's apparently more than 1 GB in size (froze my computer since I have very little disk space...).

4.  VS Code.

    Screen Saver Lock Screen Madness

    It's madness, there are at least 3 places to set the screen saver / lock screen / sleep settings:
    1. Preferences > LXQt Settings > Session Settings
    2. Preferences > LXQt Settings > Power Management
    3. Preferences > Screensaver
    They seem to interact with each other, and each has slightly different settings and uses.

    My default Screensaver sometimes ran the CPU real hot, so maybe set that to something less energy intensive first.  I used Deco with settings reducing the framerate.

    I'd suggest using each tool for orthogonal tasks:
    1. use Screensaver purely for setting the screensaver and when it turns on.

    2. Set when the screen locks using Power Management (Idle tab).

    3. Use the Session Settings to set whether the screen locks before suspending the OS (I think it defaults to locking after suspending).

    File compression tool

    For reasons, I like file-roller.  So just install file-roller via apt-get.

    The default file explorer PCManFM-Qt has a preferences option to integrate with file-roller instead as well for ease of use.




    Explanation of certain software choices


    Basic graphics editing

    The default graphics viewer LXImage is actually a bit of a pain to use, especially coming from Mac Preview, which really has a great mix of UI, UX, and editing features for graphics and PDFs...

    There's no equivalent to Apple's Preview, but for graphic files, nomacs Image Lounge is pretty good.  nomacs has a UI UX reminiscent of Preview, and has some basic graphics editing features too.


    Little more graphics editing features

    The default graphics viewer LXImage has some annotation tools, I guess, but nothing more.  nomacs has some more graphics editing features, but I sure miss the Mac Preview tool.

    Anyway, ImageMagick or the more updated GraphicsMagick fork is quite useful (but beware it has a very... historic?... dated?... GUI).  It can be installed via apt-get, but it doesn't seem to install a default app launcher icon --- well, it's meant to be used from the terminal, but I like to deal with the GUI.

    So I added a blank file to ~/.local/share/applications called "GraphicsMagic display.desktop" with the following text saved to it:

    [Desktop Entry]
    Encoding=UTF-8
    Name=GraphicsMagick display
    Comment=GraphicsMagick display
    Exec=/usr/bin/gm display %F
    Icon=lximage-qt
    Categories=Graphics;Viewer;RasterGraphics;2DGraphics;Photography;
    Type=Application
    MimeType=image/jpeg
    Terminal=false


    Now you can use it like LXImage (in fact, it uses the LXImage icon because, why not?).

    If I need more intensive graphics editing, I'll use GIMP.


    Time Clock Auto Update Synchronization Problem

    Debian looks to use timedatectl by default for setting time, including synchronization via NTP Network Time Protocol.  It doesn't allow me to force a sync though.

    You could instead use chrony.

    It lets you do things like chronyc sources to see the currently available and selected time sources.  Perhaps your network is blocking NTP updates?

    Or chronyc sourcestats to see your clock's time offset from the various NTP sources.

    You could do a single time offset check, without setting the time: sudo chronyd -Q

    Or manually force a time synchronization with: sudo chronyd -q

    Oh, and I like to add to /etc/chrony/chrony.conf  : server time.apple.com iburst because where I am it's hard to get to a time server except Apple's.



    Microsoft Fonts

    Install ttf-mscorefonts-installer.  Some instructions for this but it's straightforward from the package manager.  Just use sudo apt install ttf-mscorefonts-installer.



    Markdown editor

    I like Ghostwriter so far.


    Backup

    For file backup, restic looks great.  Some people like borg.


    Remember Git passwords securely

    Git is great.  Remember Git passwords securely is even better, but requires manual install though.


    Misc

    keynav  ---  Didn't have it in Lubuntu, but it exists for Debian!!!!

    skippy-xd  --- It hasn't been updated and doesn't work anymore for Lubuntu (OpenBox, LXQt).  Debian LXQt uses Xfwm though, so somewhat similar functionality is already built in!