Posting code in WordPress

You can use the HTML pre tags around the code in the Text mode (aka the source mode).

public class HelloWorld {

    public static void main(String[] args) {
        // Prints "Hello, World" to the terminal window.
        System.out.println("Hello, World");
    }

}

You can use the WordPress code tag. You can read about that at https://en.support.wordpress.com/code/posting-source-code/

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello, World");
    }

}

Installing Chrome on Lubuntu

Since Chrome provides a Debian package, you can do:

s@s-Lubuntu:~/Downloads$ sudo dpkg -i google-chrome-stable_current_amd64.deb 
[sudo] password for s: 
Selecting previously unselected package google-chrome-stable.
(Reading database ... 118145 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (61.0.3163.91-1) ...
dpkg: dependency problems prevent configuration of google-chrome-stable:
 google-chrome-stable depends on gconf-service; however:
  Package gconf-service is not installed.
 google-chrome-stable depends on libgconf-2-4 (>= 3.2.5); however:
  Package libgconf-2-4 is not installed.
 google-chrome-stable depends on fonts-liberation; however:
  Package fonts-liberation is not installed.

dpkg: error processing package google-chrome-stable (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.7.6.1-2) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Errors were encountered while processing:

That didn’t work since dpkg can’t install dependencies. So I tried using apt.

s@s-Lubuntu:~/Downloads$ sudo apt install ./google-chrome-stable_current_amd64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 google-chrome-stable : Depends: gconf-service
                        Depends: libgconf-2-4 (>= 3.2.5) but it is not installed
                        Depends: fonts-liberation but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Now using the –fix-broken option

s@s-Lubuntu:~/Downloads$ sudo apt --fix-broken install ./google-chrome-stable_current_amd64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
Note, selecting 'google-chrome-stable' instead of './google-chrome-stable_current_amd64.deb'
google-chrome-stable is already the newest version (61.0.3163.91-1).
The following additional packages will be installed:
  fonts-liberation gconf-service gconf-service-backend gconf2-common libgconf-2-4
The following NEW packages will be installed:
  fonts-liberation gconf-service gconf-service-backend gconf2-common libgconf-2-4
0 upgraded, 5 newly installed, 0 to remove and 178 not upgraded.
1 not fully installed or removed.
Need to get 987 kB of archives.
After this operation, 4,185 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu zesty/universe amd64 gconf2-common all 3.2.6-3ubuntu7 [20.8 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu zesty/universe amd64 libgconf-2-4 amd64 3.2.6-3ubuntu7 [84.6 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu zesty/universe amd64 gconf-service-backend amd64 3.2.6-3ubuntu7 [57.8 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu zesty/universe amd64 gconf-service amd64 3.2.6-3ubuntu7 [2,038 B]
Get:5 http://us.archive.ubuntu.com/ubuntu zesty/main amd64 fonts-liberation all 1:1.07.4-2 [822 kB]
Fetched 987 kB in 1s (829 kB/s)           
Selecting previously unselected package gconf2-common.
(Reading database ... 118248 files and directories currently installed.)
Preparing to unpack .../gconf2-common_3.2.6-3ubuntu7_all.deb ...
Unpacking gconf2-common (3.2.6-3ubuntu7) ...
Selecting previously unselected package libgconf-2-4:amd64.
Preparing to unpack .../libgconf-2-4_3.2.6-3ubuntu7_amd64.deb ...
Unpacking libgconf-2-4:amd64 (3.2.6-3ubuntu7) ...
Selecting previously unselected package gconf-service-backend.
Preparing to unpack .../gconf-service-backend_3.2.6-3ubuntu7_amd64.deb ...
Unpacking gconf-service-backend (3.2.6-3ubuntu7) ...
Selecting previously unselected package gconf-service.
Preparing to unpack .../gconf-service_3.2.6-3ubuntu7_amd64.deb ...
Unpacking gconf-service (3.2.6-3ubuntu7) ...
Selecting previously unselected package fonts-liberation.
Preparing to unpack .../fonts-liberation_1%3a1.07.4-2_all.deb ...
Unpacking fonts-liberation (1:1.07.4-2) ...
Setting up gconf2-common (3.2.6-3ubuntu7) ...

Creating config file /etc/gconf/2/path with new version
Processing triggers for sgml-base (1.29) ...
Setting up fonts-liberation (1:1.07.4-2) ...
Processing triggers for libc-bin (2.24-9ubuntu2) ...
Processing triggers for fontconfig (2.11.94-0ubuntu2) ...
Setting up libgconf-2-4:amd64 (3.2.6-3ubuntu7) ...
Setting up gconf-service-backend (3.2.6-3ubuntu7) ...
Setting up gconf-service (3.2.6-3ubuntu7) ...
Setting up google-chrome-stable (61.0.3163.91-1) ...
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/google-chrome (google-chrome) in auto mode
Processing triggers for libc-bin (2.24-9ubuntu2) ...

Now you should see Chrome icon in the Internet menu. Enjoy.

Virtualbox and Windows 7 Sleep issues

I got Virtualbox Version 5.1.28 r117968 (Qt5.6.2), running in Windows 7 Ultimate. I installed Ubuntu 16.04 LTS as a guest in Vb. Works great but doesn’t let Windows go to sleep after the sleep timeout. I can put Windows to sleep manually but Windows cannot go to sleep on its own when Ubuntu is running in Vb. Any clues on how to fix this? I like to save power and want Windows to go to sleep on its own if a user forgets to put it to sleep manually.

So I switched to Vmware Player and the sleep works fine. Even the volume keys work in the guest OS (Lubuntu).

Vmware tools installation from Vmware Player CD load didn’t work. You can check by doing this:
s@s-Lubuntu:~$ /etc/init.d/vmware-tools status
vmware-guestd is not running

So install open-vm-tools instead. Here is the command for that:
sudo apt-get update
sudo apt-get install open-vm-tools open-vm-tools-desktop

More on that command here:
https://askubuntu.com/questions/670245/vmware-tools-not-working-14-04

s@s-Lubuntu:~$ /etc/init.d/open-vm-tools status
● open-vm-tools.service – Service for virtual machines hosted on VMware
Loaded: loaded (/lib/systemd/system/open-vm-tools.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2017-09-19 20:19:20 CDT; 9h ago
Docs: http://open-vm-tools.sourceforge.net/about.php
Main PID: 615 (vmtoolsd)
Tasks: 2 (limit: 19660)
CGroup: /system.slice/open-vm-tools.service
└─615 /usr/bin/vmtoolsd