วันจันทร์ที่ 15 เมษายน พ.ศ. 2562

Install MySQL 5.7 on Ubuntu 18.04

Install MySQL Server 5.7

การติดตั้ง MySQL Server 5.7

Reference: Install MySQL | Install phpMyAdmin
# Install MySQL Server
sudo apt update
sudo apt install mysql-server

# Check MySQL Status
sudo systemctl status mysql
# Initial Server
sudo mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No:
Please set the password for root here.

New password:

Re-enter new password:
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) :

 ... skipping.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) :

 ... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) :

 ... skipping.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) :

 ... skipping.
All done!

วันศุกร์ที่ 12 เมษายน พ.ศ. 2562

Install PostgreSQL 11 on Ubuntu 18.04

การติดตั้ง PostgreSQL 11


*ถ้าไม่ต้องการติดตั้ง Version 11 จะลงตาม Version ที่มากับ Repository Linux ให้ข้ามไปตรง #Install PostgreSQL ได้เลยครับ

Official: PostgreSQL Installation
Reference: Install PostgreSQL, Install pgAdmin4, Getting Started
# Install PostgreSQL 
sudo apt update
sudo apt install wget gnupg2

Create the file /etc/apt/sources.list.d/pgdg.list and add repository
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
# Import repository signing key, then update package lists
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update

# Install PostgreSQL, ถ้าไม่ทำตามขั้นตอนข้างบนจะติดตั้งตาม Version ที่มากับ Repository ของ Linux
sudo apt install postgresql postgresql-contrib

# Check PostgreSQL Status
sudo systemctl status postgresql

ทำการทดสอบโดยใช้ user postgres
# Connect to PostgreSQL
sudo su - postgres
psql
-- Show your connection information

\connifo
-- You are connected to database "postgres" as user "postgres" 
-- via socket in "/var/run/postgresql" at port "5432".

-- Show help
\?

-- Quit
\q

วันพฤหัสบดีที่ 11 เมษายน พ.ศ. 2562

Knowage 6.2 Config Datasource (JDBC)

Oracle 11g

Stop Knowage and Download Oracle JDBC Driver
Copy file ojdbc6.jar to library directory and Start Knowage
Dialect: Oracle
Read Only: Read Only
Type: JDBC

URL: jdbc:oracle:thin:@//host:port/servicename
Username: username
Password: password

Driver: oracle.jdbc.driver.OracleDriver



PostgreSQL 11

!! Please set your PostgreSQL 11 allow remote connection
Stop Knowage and Download PostgreSQL JDBC Driver
Copy file postgresql-42.2.5.jar to library directory and Start Knowage
Dialect: PostgreSQL
Read Only: Read Only
Type: JDBC

URL: jdbc:postgresql://host:port/databasename
Username: username
Password: password

Driver: org.postgresql.Driver



MySQL 5.7.25

!! Please set your MySQL 5.7.25 allow remote connection
Stop Knowage and Download MySQL JDBC Driver (Connector J)
Copy file mysql-connector-java-8.0.15.jar to library directory and Start Knowage
* By default MySQL JDBC Driver is already have in library directory please check !
Dialect: MySQL/MariaDB
Read Only: Read Only
Type: JDBC

URL: jdbc:mysql://host:port/databasename
Username: username
Password: password

Driver: com.mysql.jdbc.Driver

วันเสาร์ที่ 6 เมษายน พ.ศ. 2562

Knowage 6.2 Installer in Ubuntu 18.04

I will follow this step for make sure it can work correctly


This video use Knowage 6.2.1 on Ubuntu 18 and Use Oracle JDK 8 and MySQL Server 5.7

Step 1. Install Java / Step 2. Configure System Variables

sudo apt install software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt update

sudo apt install oracle-java8-installer
sudo apt install oracle-java8-set-default

# Setup JAVA_HOME
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=$JAVA_HOME/bin:$PATH

# Verify JDK is Installed
java -version

# java version "1.8.0_201"
# Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
# Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
Reference: Command [add-apt-repository] Missing | Install Java 8 | Setup System Variables

[Linux Container] - How to use LXC Snapshot


คำสั่งที่เกี่ยวข้องกับ lxc snapshot จะมี lxc restore, lxc rename, lxc delete, lxc info
Usage:
  lxc [command]
 
Available Commands:
  delete      Delete containers and snapshots
  info        Show container or server information
  remote      Manage the list of remote servers
  rename      Rename containers and snapshots
  restore     Restore containers from snapshots
  snapshot    Create container snapshots

วันศุกร์ที่ 5 เมษายน พ.ศ. 2562

[Linux Container] - How to use LXC Network


ใช้คำสั่ง lxc network เราจะเห็นว่ามีคำสั่งอะไรบ้างให้เราใช้งาน
sarankon@ubuntu:~$ lxc network

Description:
  Manage and attach containers to networks

Usage:
  lxc network [command]

Available Commands:
  attach         Attach network interfaces to containers
  attach-profile Attach network interfaces to profiles
  create         Create new networks
  delete         Delete networks
  detach         Detach network interfaces from containers
  detach-profile Detach network interfaces from profiles
  edit           Edit network configurations as YAML
  get            Get values for network configuration keys
  list           List available networks
  list-leases    List DHCP leases
  rename         Rename networks
  set            Set network configuration keys
  show           Show network configurations
  unset          Unset network configuration keys

Global Flags:
      --debug         Show all debug messages
      --force-local   Force using the local unix socket
  -h, --help          Print help
  -v, --verbose       Show all information messages
      --version       Print version number

Use "lxc network [command] --help" for more information about a command.