Ron and Ella Wiki Page

Extremely Serious

Page 23 of 33

Using Google SMTP with Archiva in Synology

Pre-requisite

Procedure

  1. Open the archiva.xml file found in the following location:
    /volume1/@appstore/Tomcat7/src/conf/Catalina/localhost
  2. Update the Resource entry with the name mail/Session to become the following:
    <Resource name="mail/Session" auth="Container"
          type="javax.mail.Session"
          mail.smtp.host="smtp.gmail.com"
              mail.smtp.port="587"
              mail.smtp.auth="true"
              mail.smtp.user="<USERNAME>"
              password="<PASSWORD>"
              mail.smtp.starttls.enable="true"
              mail.transport.protocol="smtp"/>
    Token Description
    USERNAME Google Account
    PASSWORD Google App Password
  3. Save the updated file and wait for Archiva to restart.

    If you've updated the archiva.xml file and save it, Tomcat will detect it and it will restart the Archiva application.

Artifactory on Ubuntu with MariaDB

Requirement

  • Java 8
  • MariaDB 10.3.x

Preparing MariaDB

  1. Create the database called artdb using the following command:
    CREATE DATABASE artdb CHARACTER SET utf8 COLLATE utf8_bin;
  2. Add artifactory as the user to the newly created database using the following command:
    GRANT ALL on artdb.* TO 'artifactory'@'<HOST>' IDENTIFIED BY '<PASSWORD>';
    FLUSH PRIVILEGES;
    Token Description
    HOST The address of machine housing MariaDB
    PASSWORD The password for the artifactory user.

Installing Artifactory

  1. Add the artifactory repository to your source list.
    echo "deb https://jfrog.bintray.com/artifactory-debs <DISTRIBUTION> main" | sudo tee -a /etc/apt/sources.list
    Token Description
    DISTRIBUTION Use the following command to identify the destribution:

    lsb_release -c

    The sample output for ubuntu bionic distribution:

    Codename:       bionic
  2. Download jfrog public key using the following command:
    curl https://bintray.com/user/downloadSubjectPublicKey?username=jfrog | sudo apt-key add -
  3. Update your package list using the following command:
    sudo apt-get update
  4. Install the oss artifactory using the following command:
    sudo apt-get install jfrog-artifactory-oss

Artifactory Service Commands

Objective Command
Checking service status sudo service artifactory status
Starting the service sudo service artifactory start
Stopping the service sudo service artifactory stop
Restarting the service sudo service artifactory restart

Accessing The Artifactory from the Browser

  1. Use the following address to access the artifactory application:
    http://localhost:8180/artifactory
  2. Use the following default credentails:
    Field Value
    Username admin
    Password password

    It is recommended to change the admin password after installation but you can do it after hooking it to MariaDB.

Using the MariaDB Prepared Earliear

Variable Value
$ARTIFACTORY_HOME /var/opt/jfrog/artifactory
  1. Using the terminal, change the directory to $ARTIFACTORY_HOME/tomcat/lib and execute the following:
    sudo wget https://downloads.mariadb.com/Connectors/java/connector-java-2.4.4/mariadb-java-client-2.4.4.jar

    You can visit https://mariadb.com/downloads/#connectors for a different version of java client.

  2. Copy $ARTIFACTORY_HOME/misc/db/mariadb.properties to $ARTIFACTORY_HOME/etc/db.properties.

    This will replace the default db.properties that is using derby as the database.

  3. Update the following fields in the db.properties:
    Field Value
    url jdbc:mariadb://<HOST>:<PORT>/artdb?characterEncoding=UTF-8&elideSetAutoCommits=true&useSSL=false&useMysqlMetadata=true
    password The password you've used on Preparing MariaDB section.
    Token Value
    HOST The host you've indentified on Preparing MariaDB section.
    PORT This is the port where MariaDB is listening (i.e. 3306 or 3307).
  4. Restart the artifactory service using the following command:
    sudo service artifactory restart

Creating a Google App Password

Procedure

    1. Sign-in to https://accounts.google.com/ using the account to wanted to use.
    2. Click Security from the side menu
    3. On the Signing in to Google section, click App Passwords.
    4. Select the application you wanted to use from google (e.g. Mail, Calendar, Contacts or YouTube).
    5. Select the Other (Custom name) for the device, and name it appropriately.
    6. Click the generate button.
  1. Now you have your 16-character password that you can use.

Using RSYNC to Sync Some Local Directories to Remote Directory via SSH

Requirement

  • SSH Server on Remote Computer

Syntax

To sync some of your local directories to a remote directory via ssh you can use the following syntax:

rsync -av -L --delete -e ssh <DIR1>[[ <DIR2>] <DIRn>] <REMOTE_USER>@<REMOTE_HOST>:<REMOTE_DIR>
Token Description
DIR1, DIR2, DIRn These are the local directories you've wanted to be synced remotely. Only DIR1 is required and the rest are optional.
REMOTE_USER A valid user on the remote machine.
REMOTE_HOST A valid address of the remote machine.
REMOTE_DIR The destination directory on the remote machine.

Example

rsync -av -L --delete -e ssh /data/artifactory backup01@10.0.0.204:/volume1/backup

Create a New Azure Function App with .Net Core by Azure Function Core Tools

Requirements

Procedures

  1. Create a directory to house your azure function codes.
  2. Using the command console,  navigate to the newly created directory.
  3. Execute the following command and select dotnet (i.e. usign the arrow keys) and press enter.
    func init

    Wait for the command prompt to come back.

  4. On the new prompt, execute the following command and select the template you want (i.e. using the arrow keys) and press enter.
    func new
  5. Type a name for the function and press enter.
« Older posts Newer posts »