Restore MySQL Enterprise Backup File
1. Shutdown MySQL server
mysqladmin -u root -p shutdown
2. Restore MySQL Backup
./mysqlbackup --defaults-file=/etc/MySQL/my.cnf --datadir=/var/lib/MySQL --backup-image=/srv/db_backup/my.mbi --backup-dir=/srv/db_backup/restore-tmp copy-back-and-apply-log --force --uncompress
3. Update file permission
chown -R mysql:mysql /var/lib/MySQL
4. Start MySQL
service start MySQL
5. Check your MySQL data to ensure that it's been successfully restored.
That's all folks! 5 steps only. I've restored 16GB of compressed my.mbi backup file in less than half an hour.
Fyi, I referred to https://dev.mysql.com/doc/mysql-enterprise-backup/4.1/en/mysqlbackup.restore.html for this.
Monday, February 11, 2019
Thursday, January 31, 2019
Install WSO2 Identity Server 5.7.0 on Centos 7 x64
Pre-requisites:
OpenJDK8 or Oracle JDK 1.8.*
Steps:
1. Download WSO2 Identity Server from WSO2 Website:
https://wso2.com/identity-and-access-management/install/
2. Install WSO2 Identity Server
rpm -i wso2is-linux-installer-x64-5.7.0.rpm
3. Download and install Apache Tomcat version 8 or above
I installed Apache Tomcat 9 which I downloaded from Apache Tomcat 9 Core Download (tar.gz)
tar xvf apache-tomcat-9.0.14.tar.gz
4. Download and install curl
I installed it using yum
yum -y install curl
5. Create a Twitter application to try out multi-factor or federated authentication
a. Go to https://twitter.com/ and create an account
b. Register for Twitter Developer account
I applied for it on 31 Jan 2019 6.00pm GMT+8. Will update here when it is approved).
Update: My Twitter Developer Account was approved 1 Feb 2019 11.43pm GMT+8. Twitter first responded asking for more info on 31 Jan 2019 10.24pm GMT+8 but I didn't notice the email and only replied back on 1 Feb 2019 11.25pm GMT+8. So, it's either I was very lucky to have gotten a very fast response or Twitter is super efficient in handling these developer accounts application because I think there would be like thousands of application per day from all over the world everyday! Anyway, thanks to Twitter for approving my developer account.)
c. Register a new application on Twitter at https://apps.twitter.com You can use the following url as the Callback URL for your Twitter application: https://localhost:9443/commonauth
d. Note down API key and secret for later use.
6. Open the /etc/hosts file and add the following entry
127.0.0.1 localhost.com
7. Start WSO2 IS
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/
export WSO2IS_HOME=/usr/lib64/wso2/wso2is/5.7.0/
cd $WSO2IS_HOME/bin
sudo ./wso2server.sh
8. Open firewall port if firewalld is active in Centos 7
firewall-cmd --permanent --add-port=9443/tcp
firewall-cmd --list-ports
List the services that are accepted through the firewall:
firewall-cmd --list-services
Pre-requisites:
OpenJDK8 or Oracle JDK 1.8.*
Steps:
1. Download WSO2 Identity Server from WSO2 Website:
https://wso2.com/identity-and-access-management/install/
2. Install WSO2 Identity Server
rpm -i wso2is-linux-installer-x64-5.7.0.rpm
3. Download and install Apache Tomcat version 8 or above
I installed Apache Tomcat 9 which I downloaded from Apache Tomcat 9 Core Download (tar.gz)
tar xvf apache-tomcat-9.0.14.tar.gz
4. Download and install curl
I installed it using yum
yum -y install curl
5. Create a Twitter application to try out multi-factor or federated authentication
a. Go to https://twitter.com/ and create an account
b. Register for Twitter Developer account
I applied for it on 31 Jan 2019 6.00pm GMT+8. Will update here when it is approved).
Update: My Twitter Developer Account was approved 1 Feb 2019 11.43pm GMT+8. Twitter first responded asking for more info on 31 Jan 2019 10.24pm GMT+8 but I didn't notice the email and only replied back on 1 Feb 2019 11.25pm GMT+8. So, it's either I was very lucky to have gotten a very fast response or Twitter is super efficient in handling these developer accounts application because I think there would be like thousands of application per day from all over the world everyday! Anyway, thanks to Twitter for approving my developer account.)
c. Register a new application on Twitter at https://apps.twitter.com You can use the following url as the Callback URL for your Twitter application: https://localhost:9443/commonauth
d. Note down API key and secret for later use.
6. Open the /etc/hosts file and add the following entry
127.0.0.1 localhost.com
7. Start WSO2 IS
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/
export WSO2IS_HOME=/usr/lib64/wso2/wso2is/5.7.0/
cd $WSO2IS_HOME/bin
sudo ./wso2server.sh
8. Open firewall port if firewalld is active in Centos 7
firewall-cmd --permanent --add-port=9443/tcp
firewall-cmd --list-ports
List the services that are accepted through the firewall:
firewall-cmd --list-services
Friday, November 16, 2018
Install TeamViewer on Centos7
1. Get the RPM Package
wget https://download.teamviewer.com/download/linux/teamviewer-host.x86_64.rpm
2. Install EPEL Repository
sudo yum -y install epel-release
3. Install TeamViewer
sudo yum -y install ./teamviewer-host*.rpm
That's all folks! 3 steps only.
Fyi, I referred to https://community.teamviewer.com/t5/Knowledge-Base/How-to-install-TeamViewer-on-Red-Hat-and-CentOS/ta-p/30708 for this.
1. Get the RPM Package
wget https://download.teamviewer.com/download/linux/teamviewer-host.x86_64.rpm
2. Install EPEL Repository
sudo yum -y install epel-release
3. Install TeamViewer
sudo yum -y install ./teamviewer-host*.rpm
That's all folks! 3 steps only.
Fyi, I referred to https://community.teamviewer.com/t5/Knowledge-Base/How-to-install-TeamViewer-on-Red-Hat-and-CentOS/ta-p/30708 for this.
Install FileZilla FTP Client on Centos7
1. Enable EPEL Repository
sudo yum -y install epel-release
2. Install FileZilla
sudo yum -y install filezilla
That's all folks. 2 steps only.
Fyi, i referred to http://sysadmindata.com/install-filezilla-centos-7/ for this.
1. Enable EPEL Repository
sudo yum -y install epel-release
2. Install FileZilla
sudo yum -y install filezilla
That's all folks. 2 steps only.
Fyi, i referred to http://sysadmindata.com/install-filezilla-centos-7/ for this.
Install Google Chrome on Centos7
1. Enable Yum Repository
sudo vi /etc/yum.repos.d/google-chrome.repo
Add the following:
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl.google.com/linux/linux_signing_key.pub
2. Install Google Chrome
sudo yum install google-chrome-stable
That's all folks. 2 steps only.
Fyi, I referred to https://www.cyberciti.biz/faq/howto-install-google-chrome-on-redhat-rhel-fedora-centos-linux/ for this.
1. Enable Yum Repository
sudo vi /etc/yum.repos.d/google-chrome.repo
Add the following:
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl.google.com/linux/linux_signing_key.pub
2. Install Google Chrome
sudo yum install google-chrome-stable
That's all folks. 2 steps only.
Fyi, I referred to https://www.cyberciti.biz/faq/howto-install-google-chrome-on-redhat-rhel-fedora-centos-linux/ for this.
Installing Visual Studio Code on Centos7
1. Enable Yum Repository
sudo vi /etc/yum.repos.d/vscode.repo
Add the below:
[vscode]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
2. Import the package signing GPG key
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
3. Install Visual Studio Code
sudo yum check-update
sudo yum install code
That's all folks! 3 steps only.
Fyi, I referred to https://tecadmin.net/install-visual-studio-code-editor-in-fedora/ for this.
1. Enable Yum Repository
sudo vi /etc/yum.repos.d/vscode.repo
Add the below:
[vscode]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
2. Import the package signing GPG key
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
3. Install Visual Studio Code
sudo yum check-update
sudo yum install code
That's all folks! 3 steps only.
Fyi, I referred to https://tecadmin.net/install-visual-studio-code-editor-in-fedora/ for this.
Tuesday, October 9, 2018
My To Read List:
Java JWT Token Tutorial using JJWT Library
Over a quarter of employees don't know company protocol for sharing business info
Enterprise is dead, long live Agile!
Building Docker Intuition
SEI CERT releases open-source Source Code Analysis Laboratory for pinpointing vulnerabilities
Architecture with Docker for Two-tier Application
MVVM in Flutter using ScopedModel
SSO for your Single Page Application (part 1/2 — AngularJS)
https://stackoverflow.com/questions/8176001/trouble-creating-active-directory-users-with-java
https://www.youtube.com/watch?v=qs2n_poLarc
Java JWT Token Tutorial using JJWT Library
Over a quarter of employees don't know company protocol for sharing business info
Enterprise is dead, long live Agile!
Building Docker Intuition
SEI CERT releases open-source Source Code Analysis Laboratory for pinpointing vulnerabilities
Architecture with Docker for Two-tier Application
MVVM in Flutter using ScopedModel
SSO for your Single Page Application (part 1/2 — AngularJS)
https://stackoverflow.com/questions/8176001/trouble-creating-active-directory-users-with-java
https://www.youtube.com/watch?v=qs2n_poLarc
Thursday, September 27, 2018
Drop database and then restore (Postgresql 10.4.0):
1. su as postgres
2. run psql at command prompt
3. First, find the activities that are taken place against the target database, you can query the pg_stat_activity view with the following query:
SELECT
*
FROM
pg_stat_activity
WHERE
datname = 'target_database';
4. Second, terminate the active connections by issuing the following query:
SELECT
pg_terminate_backend (pg_stat_activity.pid)
FROM
pg_stat_activity
WHERE
pg_stat_activity.datname = 'target_database';
5. Third, execute the DROP DATABASE statement:
DROP DATABASE target_database;
6. Create database:
CREATE DATABASE target_database;
7. Copy file from host to docker container:
docker cp src/. mycontainer:/target
8. Go into docker container and restore database:
docker container exec -it mycontainer bash
su postgres
psql target_database < infile
That's all folks!
1. su as postgres
2. run psql at command prompt
3. First, find the activities that are taken place against the target database, you can query the pg_stat_activity view with the following query:
SELECT
*
FROM
pg_stat_activity
WHERE
datname = 'target_database';
4. Second, terminate the active connections by issuing the following query:
SELECT
pg_terminate_backend (pg_stat_activity.pid)
FROM
pg_stat_activity
WHERE
pg_stat_activity.datname = 'target_database';
5. Third, execute the DROP DATABASE statement:
DROP DATABASE target_database;
6. Create database:
CREATE DATABASE target_database;
7. Copy file from host to docker container:
docker cp src/. mycontainer:/target
8. Go into docker container and restore database:
docker container exec -it mycontainer bash
su postgres
psql target_database < infile
That's all folks!
After Jenkins successfully shutdown, my Gitlab CE is now using port 8080 so I need to shut it down also to make way for my WildFly Application Server. Command issued to shutdown Gitlab CE are as follows:
1. su as root
2. At command prompt: gitlab-ctl stop
Referred from here: https://docs.gitlab.com/omnibus/maintenance/
That's all folks!
1. su as root
2. At command prompt: gitlab-ctl stop
Referred from here: https://docs.gitlab.com/omnibus/maintenance/
That's all folks!
My Jenkins Server automatically starts upon Centos 7 server starts, so I need to stop it to make way for my WildFly Application Server. What I did to stop it are as follows:
1. On my Firefox browser, go to this url :
2. It will ask me to login then i have to click some button to initiate the shutdown process
I saw someone also asking about the same thing at stackoverflow: https://stackoverflow.com/questions/10238604/how-to-shutdown-my-jenkins-safely/35922474
It's that easy folks!
1. On my Firefox browser, go to this url :
http://localhost:8080/exit
2. It will ask me to login then i have to click some button to initiate the shutdown process
I saw someone also asking about the same thing at stackoverflow: https://stackoverflow.com/questions/10238604/how-to-shutdown-my-jenkins-safely/35922474
It's that easy folks!
Wednesday, September 5, 2018
Install PgAdmin4 on Centos 7
Install PgAdmin4 on Centos7
PgAdmin4 is GUI Tool to manage PostgreSQL database. I have a problem installing the latest PgAdmin4 which is v3.2 in Windows 10 on my HP EliteBook x360 so I made the decision to install it on my VMware Virtualised Centos 7 server.
This is what I did to install PgAdmin4 on Centos 7:
1. Get the yum repository installed on my server
2. Install PgAdmin4 Desktop Gnome
sudo yum -y install pgadmin4-desktop-gnome
That's all folks.
Fyi, I referred to https://people.planetpostgresql.org/devrim/index.php?/archives/96-Installing-pgAdmin4-3.X-on-RHEL-CentOS-7-and-Fedora-27.html for this.
PgAdmin4 is GUI Tool to manage PostgreSQL database. I have a problem installing the latest PgAdmin4 which is v3.2 in Windows 10 on my HP EliteBook x360 so I made the decision to install it on my VMware Virtualised Centos 7 server.
This is what I did to install PgAdmin4 on Centos 7:
1. Get the yum repository installed on my server
- Get the yum repo rpm
wget -v https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
Get the rpm location from https://yum.postgresql.org/repopackages.php
- Install the yum repo
sudo rpm -ivh pgdg-centos96-9.6-3.noarch.rpm
- Install PgAdmin4
sudo yum -y install pgadmin4
- Configure PgAdmin4
cd /usr/pgadmin4/bin/
su./pgadmin4-web-setup.sh
NOTE: Configuring authentication for SERVER mode.Enter the email address and password to use for the initial pgAdmin user account: Email address: edyzairani@gmail.com
Password:
Retype password:
pgAdmin 4 - Application Initialisation
====================================== We can now configure the Apache Web server for you. This will create the pgAdmin4 conf file under /etc/httpd/conf.d/. Do you wish to continue?
1) Yes
2) No
#? 1 pgAdmin4 Apache config file is created as /etc/httpd/conf.d/pgadmin4.conf
Apache web server is not running. We can start the web server for you to finish pgAdmin4 installation. Would you like to continue?
1) Yes
2) No
#? 1
Apache successfully started. You can now start using pgAdmin4 in web mode
2. Install PgAdmin4 Desktop Gnome
sudo yum -y install pgadmin4-desktop-gnome
That's all folks.
Fyi, I referred to https://people.planetpostgresql.org/devrim/index.php?/archives/96-Installing-pgAdmin4-3.X-on-RHEL-CentOS-7-and-Fedora-27.html for this.
Subscribe to:
Posts (Atom)
Install MySQL 8.0 on Centos 7
Steps to install MySQL 8.0 Community Edition in Centos 7 1. Enable MySQL 8.0 Repository sudo yum localinstall https://dev.mysql.com...
-
Steps to install MySQL 8.0 Community Edition in Centos 7 1. Enable MySQL 8.0 Repository sudo yum localinstall https://dev.mysql.com...
-
My Jenkins Server automatically starts upon Centos 7 server starts, so I need to stop it to make way for my WildFly Application Server. Wha...