Showing posts with label installation. Show all posts
Showing posts with label installation. Show all posts

Thursday, 29 December 2022

Installing GraalVM on Linux using Alternatives

Was looking for how to install GraalVM on Linux using the Alternatives system.

I've already looked at sdk-man on my MacBook PRO, which works fine.

I found the references below.

References

[1] GraalVM - Installation on Linux Platforms
https://www.graalvm.org/22.3/docs/getting-started/linux/
[2] How to Install GraalVM Community Edition on Linux
https://gist.github.com/ricardozanini/fa65e485251913e1467837b1c5a8ed28

Thursday, 27 December 2018

Adding MariaDB JDBC Connector to Paraya 5

It's as easy as pie.

  1. start Payara
    $ cd ~/payara5/bin
    $ ./asadmin start-domain
    Waiting for domain1 to start ...............
    Successfully started the domain : domain1
    domain Location: /home/mrbear/payara5/glassfish/domains/domain1
    Log File: /home/mrbear/payara5/glassfish/domains/domain1/logs/server.log
    Admin Port: 4848
    Command start-domain executed successfully.
  2. install the database driver
    $ ./asadmin add-library /home/mrbear/software/mariadb-java-client-2.3.0.jar
    Command add-library executed successfully.
    or try:
    $ cp ~/Downloads/mariadb-java-client-2.3.0.jar ~/payara5/glassfish/domains/domain1/lib

    The last part will probably require a payara application server reboot, though.

  3. connect to http://localhost:4848
  4. surf to Resources -> JDBC -> JDBC Connection Pools
  5. Create a new one
  6. Settings:
    Pool name[obvious]
    Resource Typejavax.sql.DataSource
    Datasource classnameorg.mariadb.jdbc.MariaDbDataSource

    Leave the rest as default.

  7. Define the following additional properties:
    NameValue
    serverNamelocalhost
    URLjdbc:mariadb://localhost:3306/mmud
    databaseNamemmud
    userusername
    passworditsasecret
  8. Try the "Ping" button to verify that the connection is established.
  9. surf to Resources -> JDBC -> JDBC Resources
  10. Create a new one
  11. Settings:
    NameValue
    JNDI Namethis is the name as the resource is defined in your application
    Pool Namethe pool defined previously, it's a dropdown which is convenient.
  12. Press finish or OK or something
  13. Done!

References

Using MySQL with Payara Server
https://blog.payara.fish/using-mysql-with-payara
Payara - Using Hibernate 5 on Payara Server
https://blog.payara.fish/using-hibernate-5-on-payara-server

Thursday, 6 December 2018

Adding MariaDB JDBC Connector to Wildfly 14

  1. install the database driver as a module
    1. create directory WILDFLY_HOME/modules/com/mariadb/main
      $ mkdir -p modules/com/mariadb/main
    2. copy database driver into that one
      $ cp ~/Downloads/mariadb-java-client-2.3.0.jar .
    3. Create the file module.xml in the same folder with the following content:
      <module xmlns="urn:jboss:module:1.3" name="com.mariadb">
          <resources>
              <resource-root path="mariadb-java-client-2.3.0.jar"/>
          </resources>
          <dependencies>
              <module name="javax.api"/>
              <module name="javax.transaction.api"/>
          </dependencies>
      </module>
  2. start Wildfly
    $ cd $WILDFLY_HOME/bin
    $ ./standalone.sh
  3. connect to http://localhost:9990/error/index.html
  4. run ./add-user.sh
    [mrbear@localhost bin]$ ./add-user.sh 

    What type of user do you wish to add? 
     a) Management User (mgmt-users.properties) 
     b) Application User (application-users.properties)
    (a): a

    Enter the details of the new user to add.
    Using realm 'ManagementRealm' as discovered from the existing property files.
    Username : mrbear
    Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
     - The password should be different from the username
     - The password should not be one of the following restricted values {root, admin, administrator}
     - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
    Password : 
    Re-enter Password :  
    What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: 
    About to add user 'mrbear' for realm 'ManagementRealm'
    Is this correct yes/no? yes
    Added user 'mrbear' to file '/home/mrbear/wildfly-14.0.1.Final/standalone/configuration/mgmt-users.properties'
    Added user 'mrbear' to file '/home/mrbear/wildfly-14.0.1.Final/domain/configuration/mgmt-users.properties'
    Added user 'mrbear' with groups  to file '/home/mrbear/wildfly-14.0.1.Final/standalone/configuration/mgmt-groups.properties'
    Added user 'mrbear' with groups  to file '/home/mrbear/wildfly-14.0.1.Final/domain/configuration/mgmt-groups.properties'
    Is this new user going to be used for one AS process to connect to another AS process? 
    e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
    yes/no? no
  5. click on "Try again" on the Website
  6. log on with the new added user
  7. Configuration - Subsystems - Datasources and drivers - JDBC drivers - [+]
  8. Fill out the following information:
    Driver namemariadb
    Driver Module Namecom.mariadb
    Module Slot
    Driver Class Nameorg.mariadb.jdbc.Driver
    Drive Datasource Class Name
    Driver XA Datasource Class Name
  9. Configuration - Subsystems - Datasources and drivers - Datasources - [+]
  10. Select "Add Datasource" to add a non-XA Datasource
  11. Select "Custom" template
  12. Attributes:
    Name[name]
    JNDI Namejava:/jdbc/[name]
  13. JDBC Driver
    Driver Namemariadb
    Driver Module Name[empty]
    Driver Class Name[empty]
  14. Connection:
    Connection URLjdbc:mariadb://localhost:3306/[databasename]
    User nameroot
    Passworditsasecret
    Security Domain[empty]
  15. Test connection
  16. Reload of server required - so reload the server
  17. Test connection: Successfully tested connection for datasource [name].

References

JDBC Driver / DataSource Setup
https://hal.gitbooks.io/dev/content/recipes/jdbc-driver-setup.html
About MariaDB Connector/J
https://mariadb.com/kb/en/library/about-mariadb-connector-j/
GitHub - Use MariaDB Connector/J Driver
https://github.com/MariaDB/mariadb-connector-j/blob/master/documentation/use-mariadb-connector-j-driver.creole
IronJacamar 1.1 - Userguide - Deploying DS Descriptor
http://www.ironjacamar.org/doc/userguide/1.1/en-US/html_single/index.html#deployingds_descriptor

Tuesday, 14 January 2014

Installing JDK in Fedora Core

Seems to work fine. I am writing it down here, because I do not do it often, and I keep forgetting the steps.

Installing java


I have switched over to using openjdk. It seems to be pretty stable and standard in Fedora Core.

The openjdk-7-jre package contains just the Java Runtime Environment
yum install java-1.7.0-openjdk
The actual Java Development Kit can be installed as below.
yum install java-1.8.0-openjdk-devel
Call me weird, but I find it confusing to name both packages "openjdk", but then, that's the name of the thing.

Switching javac

If I try "alternatives --config javac", I get.


There are 2 programs which provide 'javac'.

  Selection    Command
-----------------------------------------------
*  1           /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75-2.5.4.2.fc20.x86_64/bin/javac
 + 2           /usr/lib/jvm/java-1.8.0-openjdk.x86_64/bin/javac

Enter to keep the current selection[+], or type selection number: 

Switching java


If I try "alternatives --config java", I get.


There is 1 program that provides 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java

Enter to keep the current selection[+], or type selection number: 

I need to install the Oracle JDK, that is as simple as downloading the rpm and installing it with "rpm i jdk-7u13-linux-x64.rpm".

Then, I am required to set a symbolic link using the 'alternatives --install' commandline. See [1] for more information on that.

Then, I can set the default using "alternatives --config java" again.

[root@localhost Downloads]#  alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
*+ 3           /usr/java/jre1.7.0_45/bin/java

Enter to keep the current selection[+], or type selection number: 
Updated 22 April 2014: added OpenJDK, removed specifics regarding Oracle

References

[1] Installing Sun Oracle Java JDK on Fedora, Centos, Redhat and RHel
http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/
Java - FedoraProject
http://fedoraproject.org/wiki/Java
OpenJDK
http://openjdk.java.net/install/


Monday, 12 August 2013

Raspberry Pi

Hardware


My current hardware setup seems to work okay with the Raspberry Pi.
  • Raspberry Pi model B
  • Pretty Adafruit Pi Box (Enclosure)
  • Belkin Gold Portable Audio Player-to-Stereo Cable (2xRCA male to 3.5 mm male)
  • Belkin USB 2.0 Micro B Cable
  • Sitecom USB 2.0 hub 4-port with power adaptor and weird USB port on top (ART. CODE CN-050 v1 002)
  • SanDisk Ultra SDHC Card 32 Gb class 10
  • Perimac USB 2 to Fast Ethernet Adapter
  • RCA cable (male to male) (I had one lying around)

Software

  • mpd - Music Player Daemon (plays audio files in "/var/lib/mpd/music")
  • deluged - Deluge BitTorrent Client [2]
  • deluge-console - Deluge BitTorrent Client console
  • xbmc - X Box Media Center
  • Java JDK 8 - for the arm hf

Reasons

  • wanted to have internet 'always on' without a lot of power/computers involved
  • wanted to be in control of the software
  • wanted to download stuff easily
  • wanted to be able to send my solar panels input to the internet during daylight hours
  • wanted to play music on my (very old) stereo
  • wanted to do stuff with our old TV
  • wanted new toys to play with

Trying Wheezy Raspbian


I've downloaded Wheezy Raspbian, nowadays with Hard Float, and put it on a 32 GB SD Card.
dd bs=4M if=2013-07-26-wheezy-raspbian.img of=/dev/sdb

Downloaded 2013-05-29-wheezy-armel.zip first, which is the Software Floating Point image. XBMC is compiled for the Hardware Floating Point image. So, it won't work. Originally, I had envisioned playing with Java, and Java SDK was not available for Hardware Floating Point at the time. This has now been remedied, luckily. So no reason not to use Hardware Floating Point.[5][6]

Installing XBMC


Now, I've already tried RaspBMC, and I didn't like the fact that my default linux network scripts were replaced by XBMC scripts. Especially, as I had a non-standard setup (two ethernet ports).

So I installed XBMC on a standard Wheezy Raspbian. [4]

My TV is Black & White?


My TV provided a black and white screen. Now, given I'm European, I assumed the TV to use PAL (Phase Alternating Line, 'Picture Always Lousy') and not the (American?) NTSC (National Television System Committee, 'Never The Same Colour'). NTSC is probably the default.

Added sdtv_mode=2 to /boot/config.txt (0 is NTSC, 1 is Japanese NTSC, 2 is PAL, 3 is Brazilian PAL.)[1]

Attaching a second Ethernet by means of USB


I'm wanting to use the thing (amongst other things) as my little firewall.


My second ethernet is detected. Yay! My /etc/network/interfaces file looks like:
auto lo eth0 eth1

iface lo inet loopback
iface eth1 inet dhcp
iface eth0 inet static
address 10.0.0.11
netmask 255.255.255.0

#allow-hotplug wlan0
#iface wlan0 inet manual
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp

I have my little firewall script in "/etc/network/if-up.d/" so it runs upon boot, after network setup. But I usually forget to turn on "net.ipv4.ip_forward" in /etc/sysctl.conf.

Root access


Root access to Raspbmc is disabled, and you should use 'sudo'. But you can turn it on. http://www.raspbmc.com/wiki/user/root-access/.

I was never a "sudo" guy, but I'm getting used to it.

Expanding the root partition by hand


My Second SD card provided the following problems, after indicating that the Raspberry Pi should expand the SD Card partition and reboot. As the other SD card I have did not have this problem, I surmise that the SD card is a bit dodgy. This is the message I saw (a lot) on the screen upon boot:

end_request: I/O error, dev mmcblk0, sector 137029
mmcblk0: error -110 transferring data, sector 137030, nr 185, cmd response 0x900, card statux 0xb00
So, I attempted to expand my SD Card partition on my labtop. That fixed the problem (for now).[7]

References

[1] RPiconfig
http://elinux.org/RPi_config.txt
[2] How to Turn a Raspberry Pi into an Always-On BitTorrent Box
http://www.howtogeek.com/142044/how-to-turn-a-raspberry-pi-into-an-always-on-bittorrent-box/
[3] RaspbianXBMC
http://www.raspbian.org/RaspbianXBMC
[4] Michael Gorven's XBMC packages for the Raspberry Pi
http://michael.gorven.za.net/raspberrypi/xbmc
[5] JavaFX on Raspberry Pi in 3 Easy Steps
http://javafx.steveonjava.com/javafx-on-raspberry-pi-3-easy-steps/
[6] OpenJDK version for the Raspberry Pi
https://wiki.openjdk.java.net/display/OpenJFX/OpenJFX+on+the+Raspberry+Pi
[7] RPi Resize Flash Partitions
http://elinux.org/RPi_Resize_Flash_Partitions
Official Raspberry Pi Website
http://www.raspberrypi.org/