How To Install MariaDB on CentOS 7

[root@voice teee]# yum -y install mariadb-server mariadb.x86_64 mariadb-devel.x86_64 mariadb-libs.x86_64

[root@voice teee]# systemctl restart mariadb
[root@voice teee]# netstat -lntup
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 31899/mysqld

[root@voice teee]# mysql_secure_installation
Enter current password for root (enter for none):
Set root password? [Y/n] y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

[root@voice teee]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.60-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| mysql |
| performance_schema |
+——————–+
3 rows in set (0.00 sec)

[root@voice teee]# systemctl enable mariadb

[root@voice teee]# systemctl status mariadb

How to Find windows WIFI Password //

>> Run Command Prompt as Administrator

C:\Windows\system32>netsh wlan show profile

C:\Windows\system32>netsh wlan show profile (profile name) key=clear

Security settings
Authentication : WPA2-Personal
Cipher : CCMP
Security key : Present
Key Content : ( Wifi password here!!!)

INSTALL MYSQL ODBC CONNECTOR TO DEBIAN 10.x

root@teee:~# wget https://dev.mysql.com/get/Downloads/Connector-ODBC/8.0/mysql-connector-odbc-8.0.18-linux-debian10-x86-64bit.tar.gz
root@teee:~# tar xvf mysql-connector-odbc-8.0.18-linux-debian10-x86-64bit.tar.gz
root@teee:~# cd mysql-connector-odbc-8.0.18-linux-debian10-x86-64bit/lib/
root@teee:/usr/lib64# cd /usr/lib64/
root@teee:/usr/lib64# mkdir odbc
root@teee:/usr/lib64/odbc# cp /root/mysql-connector-odbc-8.0.18-linux-debian10-x86-64bit/lib/libmy* .
root@teee:/usr/lib64/odbc# ls
libmyodbc8a.so libmyodbc8S.so libmyodbc8w.so

Install:

root@teee:/usr/lib64/odbc# /root/mysql-connector-odbc-8.0.18-linux-debian10-x86-64bit/bin/myodbc-installer -d -a -n “MySQL” -t “DRIVER=/usr/lib64/odbc/ libmyodbc8w.so;”
Success: Usage count is 1

Check:

root@teee:/usr/lib64/odbc# /root/mysql-connector-odbc-8.0.18-linux-debian10-x86-64bit/bin/myodbc-installer -s -a -c2 -n “test” -t “DRIVER=MySQL;SERVER=127.0.0.1; DATABASE=mysql;UID=root;PWD=password”

[Result should be “Success”]

root@teee:/usr/lib64/odbc# ee /etc/odbcinst.ini

[MDBTools]
Description=MDBTools Driver
Driver=libmdbodbc.so
Setup=libmdbodbc.so
FileUsage=1
UsageCount=1

[MySQL]
Driver=/usr/lib64/odbc/ libmyodbc8w.so <— NEW INSTALL
UsageCount=1

Linux Boot Precess

LVM


Configure a Postfix Relay through Gmail on CentOS

[root@fs ~]# yum -y install postfix cyrus-sasl-plain mailx
[root@fs ~]# ee /etc/postfix/main.cf
####### RELAY GMAIL ######
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous

[root@fs ~]# ee /etc/postfix/sasl_passwd
[smtp.gmail.com]:587 bots@naitinoi.com:sana2455xxxx

[root@fs ~]# postmap /etc/postfix/sasl_passwd
[root@fs ~]# chown root:postfix /etc/postfix/sasl_passwd*
[root@fs ~]# chmod 640 /etc/postfix/sasl_passwd*
[root@fs ~]# service postfix restart
Shutting down postfix: [FAILED]
Starting postfix: [ OK ]
[root@fs ~]# echo “This is a test.” | mail -s “test message” mail@some.co.th

[root@fs ~]# ee /etc/aliases
root: testuser@naitinoi.com
[root@fs ~]# newaliases

FreeSwitch CentOS 6.x Installation

FreeSwitch CentOS 6.x Installation
REF. https://freeswitch.org/confluence/display/FREESWITCH/CentOS+6

[root@naitinoi ]# cat /etc/redhat-release
CentOS release 6.6 (Final)
[root@naitinoi]# uname -r
2.6.32-504.16.2.el6.x86_64

Install Prerequisites
[root@naitinoi /]# rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
[root@naitinoi /]# rpm -ivh http://mirror.cedia.org.ec/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@naitinoi /]# yum install git gcc-c++ autoconf automake libtool wget python ncurses-devel zlib-devel libjpeg-devel openssl-devel e2fsprogs-devel sqlite-devel libcurl-devel pcre-devel speex-devel ldns-devel libedit-devel

Install FreeSWITCH
[root@naitinoi /]# cd /usr/src
[root@naitinoi src]# git clone -b v1.4 https://freeswitch.org/stash/scm/fs/freeswitch.git
Initialized empty Git repository in /usr/src/freeswitch/.git/
remote: Counting objects: 262168, done.
remote: Compressing objects: 100% (51716/51716), done.
remote: Total 262168 (delta 205126), reused 259999 (delta 203225)
Receiving objects: 100% (262168/262168), 113.54 MiB | 542 KiB/s, done.
Resolving deltas: 100% (205126/205126), done.

[root@naitinoi src]# cd /usr/src/freeswitch
[root@naitinoi freeswitch]# ./bootstrap.sh -j

# if you want to add or remove modules from the build, edit modules.conf
[root@naitinoi freeswitch]# ee modules.conf
#TEEE
say/mod_say_th

[root@naitinoi freeswitch]# ./configure -C
[root@naitinoi freeswitch]# make
[root@naitinoi freeswitch]# make install

Install Sounds
CD-Quality Sounds
[root@naitinoi freeswitch]# make cd-sounds-install
[root@naitinoi freeswitch]# make cd-moh-install

8KC Sounds
[root@naitinoi freeswitch]# make sounds-install
[root@naitinoi freeswitch]# make moh-install

Set Owner and Permissions
# create user ‘freeswitch’
# add it to group ‘daemon’
# change owner and group of the freeswitch installation
[root@naitinoi freeswitch]# cd /usr/local
[root@naitinoi local]# useradd –system –home-dir /usr/local/freeswitch -G daemon freeswitch
[root@naitinoi local]# passwd -l freeswitch
Locking password for user freeswitch.
passwd: Success

[root@naitinoi local]# chown -R freeswitch:daemon /usr/local/freeswitch/
[root@naitinoi local]# chmod -R 770 /usr/local/freeswitch/
[root@naitinoi local]# chmod -R 750 /usr/local/freeswitch/bin/*
[root@naitinoi local]# mkdir /var/run/freeswitch
[root@naitinoi local]# chown -R freeswitch:daemon /var/run/freeswitch
[root@naitinoi local]# ln -s /usr/local/freeswitch/bin/freeswitch /usr/bin/

Automatic Start At Boot
[root@naitinoi local]# cp /usr/src/freeswitch/build/freeswitch.init.redhat /etc/init.d/freeswitch
[root@naitinoi local]# chmod 750 /etc/init.d/freeswitch
[root@naitinoi local]# chown freeswitch:daemon /etc/init.d/freeswitch
[root@naitinoi local]# chkconfig –add freeswitch
[root@naitinoi local]# chkconfig –levels 35 freeswitch on

[root@naitinoi local]# service freeswitch restart
Shutting down freeswitch:
cannot stop freeswitch: freeswitch is not running. [FAILED]
Starting freeswitch: [ OK ]

[root@naitinoi local]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 10.10.10.21:5060 0.0.0.0:* LISTEN 27000/freeswitch
tcp 0 0 127.0.0.1:8021 0.0.0.0:* LISTEN 27000/freeswitch
tcp 0 0 10.10.10.21:5080 0.0.0.0:* LISTEN 27000/freeswitch
tcp 0 0 ::1:5060 :::* LISTEN 27000/freeswitch
tcp 0 0 ::1:5080 :::* LISTEN 27000/freeswitch
[root@naitinoi local]# cd /usr/local/freeswitch/
[root@naitinoi freeswitch]# ls -l
total 60
drwxrwx— 2 freeswitch daemon 4096 Jun 1 00:32 bin
drwxr-x— 2 freeswitch freeswitch 4096 Jun 1 00:59 certs
drwxrwx— 12 freeswitch daemon 4096 Jun 1 00:32 conf
drwxrwx— 2 freeswitch daemon 4096 Jun 1 01:00 db
drwxrwx— 2 freeswitch daemon 4096 Jun 1 00:32 grammar
drwxrwx— 3 freeswitch daemon 4096 Jun 1 00:32 htdocs
drwxrwx— 2 freeswitch daemon 4096 Jun 1 00:32 include
drwxrwx— 3 freeswitch daemon 4096 Jun 1 00:32 lib
drwxrwx— 4 freeswitch daemon 4096 Jun 1 00:59 log
drwxrwx— 2 freeswitch daemon 4096 Jun 1 00:32 mod
drwxrwx— 2 freeswitch daemon 4096 Jun 1 00:32 recordings
drwxrwx— 2 freeswitch daemon 4096 Jun 1 00:59 run
drwxrwx— 2 freeswitch daemon 4096 Jun 1 00:32 scripts
drwxrwx— 4 freeswitch daemon 4096 Jun 1 00:51 sounds
drwxr-x— 3 freeswitch freeswitch 4096 Jun 1 00:59 storage

[root@naitinoi bin]# cd /usr/bin
[root@naitinoi bin]# ln -s /usr/local/freeswitch/bin/fs_cli .

VNC SERVER-CentOS

[root@naitinoi ~]# yum -y install vnc-server tigervnc-server
[root@naitinoi ~]# mkdir .vnc
[root@naitinoi ~]# vncpasswd
Password:
Verify:
[root@naitinoi ~]# ee /etc/sysconfig/vncservers
# VNCSERVERS=”2:myusername”
# VNCSERVERARGS[2]=”-geometry 800×600 -nolisten tcp -localhost”
VNCSERVERS=”2:root”
VNCSERVERARGS[2]=”-geometry 800×600″
[root@naitinoi ~]# chkconfig vncserver on
[root@naitinoi ~]# /etc/init.d/vncserver start
Starting VNC server: 2:root xauth: creating new authority file /root/.Xauthority
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/xxxxxx.com:2.log

[ OK ]
allow firewall TCP 5902,6002
[root@naitinoi ~]# iptables -nvL
0 0 ACCEPT tcp — * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:5902
0 0 ACCEPT tcp — * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:6002

How to Recovery MySQL Root Password

1 ) Stop MySql Server Service
[root@naitinoi ~]# /etc/init.d/mysqld stop
Stopping mysqld: [ OK ]

2) Start MySQL server w/o password:
[root@naitinoi ~]# mysqld_safe –skip-grant-tables &
[1] 6462
[root@naitinoi ~]# 151105 08:47:32 mysqld_safe Logging to ‘/var/log/mysqld.log’.
151105 08:47:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

3) Login as root
[root@naitinoi ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.x.xx MySQL Community Server (GPL) by Remi

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password=PASSWORD(“new password here”) where User=’root’;
Query OK, 3 rows affected (0.01 sec)
Rows matched: 3 Changed: 3 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> quit
Bye

4) Stop MySQL server w/o password:
[root@naitinoi ~]# /etc/init.d/mysqld stop
151105 08:49:26 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Stopping mysqld: [ OK ]
[1]+ Done mysqld_safe –skip-grant-tables

5) Start MySql Server Service
[root@naitinoi ~]# /etc/init.d/mysqld start
Starting mysqld: [ OK ]

6) Login
[root@naitinoi ~]# mysql -u root -p
Enter password:

### FS18 Install Production ###

https://freeswitch.org/confluence/display/FREESWITCH/Debian+9+Stretch

Building From Source
Compiling Release Branch (production)

root@fs18ast16:~# wget -O – https://files.freeswitch.org/repo/deb/freeswitch-1.8/fsstretch-archive-keyring.asc | apt-key add –
root@fs18ast16:~# echo “deb http://files.freeswitch.org/repo/deb/freeswitch-1.8/ stretch main” > /etc/apt/sources.list.d/freeswitch.list
root@fs18ast16:~# echo “deb-src http://files.freeswitch.org/repo/deb/freeswitch-1.8/ stretch main” >> /etc/apt/sources.list.d/freeswitch.list
root@fs18ast16:~# apt-get update
root@fs18ast16:~# apt-get build-dep freeswitch
root@fs18ast16:~# cd /usr/src/
root@fs18ast16:/usr/src# git clone https://freeswitch.org/stash/scm/fs/freeswitch.git -bv1.8 freeswitch
root@fs18ast16:/usr/src# cd freeswitch
root@fs18ast16:/usr/src/freeswitch# git config pull.rebase true
root@fs18ast16:/usr/src/freeswitch# ./bootstrap.sh -j
root@fs18ast16:/usr/src/freeswitch# ee modules.conf
say/mod_say_th
applications/mod_esl

Edit BANNER >

root@fs18ast16:/usr/src/freeswitch# cd /usr/src/freeswitch/libs/esl
root@fs18ast16:/usr/src/freeswitch/libs/esl# cp fs_cli.c fs_cli.backup
root@fs18ast16:/usr/src/freeswitch/libs/esl# ee fs_cli.c

SEARCH : banner
remove old banner and add new

static const char *banner =”YOUR BANNER HERE< teee@local.com>”;

static const char *inf = “Type /help to see a list of commands\n\n\n”;

root@fs18ast16:/usr/src/freeswitch/libs/esl# cd /usr/src/freeswitch/src/include
root@FS18:/usr/src/freeswitch/src/include# mv cc.h cc.bak

Create NEW
root@FS18:/usr/src/freeswitch/src/include# ee cc.h

const char *cc = “”;
const char *cc_s = “”;

root@fs18ast16:/usr/src/freeswitch/src/include# cd /usr/src/freeswitch
root@fs18ast16:/usr/src/freeswitch# ./configure
root@fs18ast16:/usr/src/freeswitch# make
root@fs18ast16:/usr/src/freeswitch# make install
root@fs18ast16:/usr/src/freeswitch#

root@fs18ast16:/usr/src/freeswitch# make cd-sounds-install && make cd-moh-install && make uhd-sounds-install && make uhd-moh-install &&
make hd-sounds-install && make hd-moh-install && make sounds-install && make moh-install

root@fs18ast16:/usr/src/freeswitch# make samples

### SECURE YOUR EVENT SOCKET ###

root@fs18ast16:/usr/src/freeswitch# ee /etc/fs_cli.conf
root@fs18ast16:/usr/src/freeswitch# ee /usr/local/freeswitch/conf/autoload_configs/event_socket.conf.xml
root@fs18ast16:/usr/local/freeswitch# cd /usr/local/freeswitch/bin
root@fs18ast16:/usr/local/freeswitch/bin# ln -s /usr/local/freeswitch/bin/freeswitch /bin/freeswitch
root@fs18ast16:/usr/local/freeswitch/bin# ln -s /usr/local/freeswitch/bin/fs_cli /bin/fs_cli
root@fs18ast16:/usr/local/freeswitch/bin# ee /usr/local/freeswitch/conf/vars.xml

root@fs18ast16:/usr/local/freeswitch/conf/autoload_configs# ee /usr/local/freeswitch/conf/autoload_configs/event_socket.conf.xml





root@fs18ast16:/usr/local/freeswitch/conf/autoload_configs# ee /etc/fs_cli.conf
[default]
; Put me in /etc/fs_cli.conf or ~/.fs_cli_conf
key_f1 => help
key_f2 => status
key_f3 => show channels
key_f4 => show calls
key_f5 => sofia status
key_f6 => reloadxml
key_f7 => /log console
key_f8 => /log debug
key_f9 => sofia status profile internal
key_f10 => fsctl pause
key_f11 => fsctl resume
key_f12 => version

[default]
profile => YOUR-USER
host => YOUR-FS-IPADDR
port => 8021
password => YOUR-PASSWD
debug => 2
loglevel => debug

root@fs:/usr/src/freeswitch# ee /usr/local/freeswitch/conf/autoload_configs/acl.conf.xml

root@fs18ast16:/usr/local/freeswitch/conf/autoload_configs# ee acl.conf.xml