How to launch jconsole from Ubuntu 18.04 on Windows 10 WSL - jconsole

I am trying to launch jconsole on Ubuntu 18.04 installed on WSL(Windows 10).
But it is just hanging there, like waiting for another input or argument.
/usr/lib/jvm/java-8-openjdk-amd64/bin$ ls -lrt jconsole
-rwxr-xr-x 1 root root 6336 Apr 16 02:48 jconsole
/usr/lib/jvm/java-8-openjdk-amd64/bin$ file jconsole
jconsole: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=ca8e0f8d1da13af7e272d6ac57781cab9d197b95, stripped
/usr/lib/jvm/java-8-openjdk-amd64/bin$ jconsole
<cursor blinking>
/usr/lib/jvm/java-8-openjdk-amd64/bin$ sudo jconsole
<cursor blinking>
Windows version:
C:\Users\username>ver
Microsoft Windows [Version 10.0.17763.1158]
Any help is appreciated, thanks!

Related

python virtualenv failure after upgrade fedora from 31 to 33

When I upgraded fedora from 31 to 33, I found out that the base python package had been upgraded from 3.7.9 to 3.9, and that python references in virtual environment folders were now pointing to the new version of python.
There were no problems activating my python 3.7 virtual environment
[bou#bous-fed33 avguide]$ source ~/py37/bin/activate
(py37) [bou#bous-fed33 avguide]$ which python
~/py37/bin/python
However the python version was no longer 3.7.9 but 3.9, which came with fedora 33
(py37) [bou#bous-fed33 avguide]$ python -V
Python 3.9.0
Now when I tried running jupyter notebook get errors ModuleNotFoundError
(py37) [bou#bous-fed33 avguide]$ jupyter notebook --port 7777
[W 09:14:02.710 NotebookApp] Error loading server extension jupyterlab
ModuleNotFoundError: No module named 'jupyterlab'
Also get errors for other packages like pandas, numpy etc which had all been fine before.
(py37) [bou#bous-fed33 avguide]$ python
Python 3.9.0 (default, Oct 6 2020, 00:00:00)
[GCC 10.2.1 20200826 (Red Hat 10.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as ps
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pandas'
I had tried to reinstall all the packages from existing requirements.txt file and manual reinstalls as well - all failed with errors. There was also no point in reinstalling python 3.7 as it was still there.
(py37) [bou#bous-fed33 avguide]$ pip3 install --force-reinstall -r requirements.txt
[bou#bous-fed33 avguide]$ sudo dnf install python37
Package python3.7-3.7.9-2.fc33.x86_64 is already installed.
I found a relatively simple FIX after a while.
The way python versions is managed is by using symbolic links in virtual env folders. So all we have to do is find the location of existing python binary for 3.7.9 or whatever python version your virtual environment uses and update the symbolic links to point to the correct python base packages.
These are the python versions installed in my fedora OS/base.
[bou#bous-fed33 ~]$ ls -ltr /usr/bin/python3*
-rwxr-xr-x. 2 root root 15536 Sep 22 19:23 /usr/bin/python3.7
-rwxr-xr-x. 1 root root 15536 Sep 25 23:37 /usr/bin/python3.8
lrwxrwxrwx. 1 root root 9 Oct 7 00:19 /usr/bin/python3 -> python3.9 <<<
-rwxr-xr-x. 1 root root 15536 Oct 7 00:20 /usr/bin/python3.9 <<<
Note how /usr/bin/python3 points to python3.9
Locate the symbolic links in virtual environment ~/py37/bin/ folder
[bou#bous-fed33 avguide]$ cd ~/py37/bin/
[bou#bous-fed33 bin]$ ls -ltr python*
lrwxrwxrwx. 1 bou bou 16 Dec 29 2019 python3 -> /usr/bin/python3
lrwxrwxrwx. 1 bou bou 7 Dec 29 2019 python -> python3
Note how python points to python3 and python3 in turn points to operating system package /usr/bin/python3 - which after the fedora python upgrade no longer points to /usr/bin/python3.7 but to the new version of python /usr/bin/python3.9
So all we need to do is remove existing softlinks
[bou#bous-fed33 bin]$ rm python3 python
And then create new files or symbolic links python3 and python that point to python3.7 binary in /usr/bin/python3.7
[bou#bous-fed33 bin]$ ln -s /usr/bin/python3.7 python3
[bou#bous-fed33 bin]$ ln -s python3 python
Activate virtual environment and check python version is correct.
[bou#bous-fed33 bin]$ ls -ltr python*
lrwxrwxrwx. 1 bou bou 18 Dec 2 10:03 python3 -> /usr/bin/python3.7
lrwxrwxrwx. 1 bou bou 7 Dec 2 10:04 python -> python3
[bou#bous-fed33 avguide]$ source ~/py37/bin/activate
(py37) [bou#bous-fed33 avguide]$ python -V
Python 3.7.9
(py37) [bou#bous-fed33 avguide]$ which python
~/py37/bin/python
(py37) [bou#bous-fed33 avguide]$ python
Python 3.7.9 (default, Sep 22 2020, 09:19:36)
[GCC 10.2.1 20200826 (Red Hat 10.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> quit()
We got the correct python version back for our virtual env and JupyterLab runs all right as well now.
(py37) [bou#bous-fed33 avguide]$ jupyter notebook --port 7777
[I 10:07:54.408 NotebookApp] JupyterLab extension loaded from /home/bou/py37/lib64/python3.7/site-packages/jupyterlab
[I 10:07:54.408 NotebookApp] JupyterLab application directory is /home/bou/py37/share/jupyter/lab
[I 10:07:54.410 NotebookApp] The Jupyter Notebook is running at:
[I 10:07:54.410 NotebookApp] https://bous-fed33:7777/
Hope this helps out someone running into similar problems with using their python virtual environment after base OS and/or python upgrade to a new version.
A better solution is to use pyenv, as it is specifically designed for this situation.
Pyenv will be available in your package repo... so yum search pyenv, then install.
See all available Python versions that pyenv can install for you:
$ pyenv install --list
Then pick form the list, eg. you'll see your missing Python 3.7.9. Install it to your local pyenv store, which will allow you to use it in your virtual environment:
$ pyenv install 3.7.9
You can then activate it in the directory containing your virtual env:
$ cd avguide
$ python --version
Python 3.9.0
$ pyenv local 3.7.9
$ python --version
Python 3.7.9
and it will automatically take care of you python binary links. See this tutorial and search for similar ones to get all the details.

An internal error occurred during: "Starting GlassFish 5 [domain1]". Can't find bundle for base name sun.util.logging.resources.logging, locale en_DE

I am using eclipse IDE, and Glassfish5. OS is MAC. Java version is 13.0.1.
I have just started with an EJB tutorial, and found that I need Glassfish. I downloaded and added to my server. Now when I am starting it, following error occurs-
An internal error occurred during: "Starting GlassFish 5 (2) [domain1]".
Can't find bundle for base name sun.util.logging.resources.logging, locale en_DE
I got following on console-
Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
-Djava.endorsed.dirs=/Users/kum/Downloads/glassfish5 2/glassfish/modules/endorsed:/Users/kum/Downloads/glassfish5 2/glassfish/lib/endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Attaching my screenshot of the error-
I have tried removing and downloading full version of glassfish. But keeps on getting same error.
Somebody help please.
As suggested above, I changed the java version from 13 to 8. The server has started successfully.
I did the following steps-
On terminal brew tap adoptopenjdk/openjdk
Once above step is completed I typed brew cask install adoptopenjdk8
Once adoptopenjdk8 is installed, I checked if it is correctly installed. So I did this- ls -la /Library/Java/JavaVirtualMachines
It gave me following lines-
drwxr-xr-x 4 root wheel 128 Nov 27 11:20 .
drwxr-xr-x 4 root wheel 128 Oct 24 14:09 ..
drwxr-xr-x 3 root wheel 96 Nov 27 11:20 adoptopenjdk-8.jdk
drwxr-xr-x 3 root wheel 96 Oct 24 14:09 jdk-13.0.1.jdk
Then I checked my JAVA_HOME by doing this- echo $JAVA_HOME This gave me following
/Library/Java/JavaVirtualMachines/jdk-13.0.1.jdk/Contents/Home
Here, it can be seen that I have jdk-13, which I need to change to jdk 1.8. That is, I have to change my JAVA_HOME.
Change JAVA_HOME by export JAVA_HOME=`/usr/libexec/java_home -v 1.8
After this, just check the java version by java -version I got the following-
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)
Thats it.
Dont forget to change the runtime environment in the glassfish server on eclipse.
Do it by-Eclipse-preferences-server-Runtime Environments-Select Glassfish-Edit-Change Java Location to your recent /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home

OPEN: Fedora 22, 32 bit machine. Unable to install/build mysql-workbench

EDIT: See comments.
.I am unable to launch mysql-workbench on my Fedora 22 machine. It is installed, or at least it seems so. Help is welcome.
[root#localhost /]# dnf info mysql-community-bench
Nome : mysql-community-bench
[root#localhost /]# uname -a
Linux localhost.localdomain 4.1.3-201.fc22.i686+PAE #1 SMP Wed Jul 29 20:36:37 UTC 2015 i686 i686 i386 GNU/Linux
I don't see installed MySQL Workbench, what you installed is MySQL benchmark (not Workbench). You can grab your MySQL Workbench rpm package from https://dev.mysql.com/downloads/workbench/
What i have done to install mysql-workbench on my Fedora 22 (64 bits),
was to install required libraries before :
sudo dnf install -y ctemplate tinyxml vsqlite++ python-paramiko
Then i downloaded the mysql-workbench .rpm here : https://dev.mysql.com/downloads/workbench/
Fedora 22 (x86, 64-bit), RPM Package 6.3.4 17.4M
and finally installed successfully the package.
So maybe you could try instaling the Fedora 20 package after installing the required libraries above.

How to substitute text from a line in bash

I have txt file like this one:
Linux Mint 17
Ubuntu 14.04
Debian GNU/Linux 7.0
Mageia 4
Fedora 20
openSUSE 13.1
Arch Linux
CentOS 7.0-1406
PCLinuxOS 2014.07
Slackware Linux 14.1
FreeBSD
I need to take version numbers and put it to the beginning of a line.
Whit awk you can do some like this:
awk '$NF~/[0-9\.]+/ {f=$NF;$NF="";$0=f FS$0}1' file
17 Linux Mint
14.04 Ubuntu
7.0 Debian GNU/Linux
4 Mageia
20 Fedora
13.1 openSUSE
Arch Linux
7.0-1406 CentOS
2014.07 PCLinuxOS
14.1 Slackware Linux
FreeBSD
If last field contain any number, move it to front position.

How upgrade to latest glibc on BeagleBone Black using opkg (or otherwise)

I have glibc version 2.15 on my BeagleBone Black. I want version 2.19, but I don't know how to upgrade to the newest version. opkg list-upgradable doesn't print anything. What should I do?
root#am335x-evm:/lib# ls -la | grep libc
-rwxr-xr-x 1 root root 888940 May 2 2013 libc-2.15.so
lrwxrwxrwx 1 root root 12 Mar 31 02:33 libc.so.6 -> libc-2.15.so
I know this part is not an easy task but here are few methods to upgrade package on linux embedded device.
1) Method:
Download glibc-2.19 debian package on to device (either directly using curl or download onto PC and scp to the device)
(download the debian package based on your architecture type 32/64 bit)
Use Opkg module to install the new glibc package,
opkg -f /etc/opkg.conf -d ram update
opkg -f /etc/opkg.conf -d ram install <package-name>
Note:
a) verify the opkg configuration file
b) below is sample of config file
src/gz repo <package-repository-url>
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
arch all 100
arch armv7l 200
arch armel 300
2) Method:
If you have internet on beagle bone then refer below links and you can find some command format examples.
http://wiki.openwrt.org/doc/techref/opkg
http://wiki.blue-panel.com/index.php/OPKG_%28en%29
3) Method:
Download the package source files on to your linux PC and cross-compile to beagle bone.
And then scp all required files of the package(binary,config files.....)