January 6th, 2014 by Gia
root@jsbin:~# apt-get update
root@jsbin:~# apt-get install git-core curl build-essential openssl libssl-dev
root@jsbin:~# apt-get install daemon
root@jsbin:/var/tmp# cd /var/tmp
root@jsbin:/var/tmp# git clone https://github.com/joyent/node.git
root@jsbin:/var/tmp/node# cd node
root@jsbin:/var/tmp/node# git tag (to show all version of node)
root@jsbin:/var/tmp/node# git checkout v0.10.15
root@jsbin:/var/tmp/node# ./configure
root@jsbin:/var/tmp/node# make
root@jsbin:/var/tmp/node# make install
root@jsbin:/var/tmp/node# node -v
root@jsbin:/var/tmp/node# cd ..
root@jsbin:/var/tmp# curl https://npmjs.org/install.sh | sudo sh
root@jsbin:/var/tmp# npm -v
root@jsbin:/var/tmp# npm install -g jsbin
root@jsbin:/var/tmp# vi /usr/local/lib/node_modules/jsbin/config.default.json (change url:host value from localhost to IP public address)
root@jsbin:/var/tmp# daemon /usr/local/bin/jsbin
November 27th, 2013 by Gia
  • Access your Openfire server (ex. http://54.254.190.215:9090/)
  • Click Continue
    Openfire - 01
  • Input a domain or IP AddressOpenfire - 02
  • Click ContinueOpenfire - 03
  • Input a Database settings
    Openfire - 04
  • Click ContinueOpenfire - 05
  • Input Administrator account email and password
    Openfire - 06
  • Setup Complete !
    Openfire - 07
  • Login to Administration Console (Access your domain/IP Address using port 9090 in your browser)Openfire - 08
  • Administration Console
    Openfire - 09
Posted in centOS, Linux | No Comments »
November 14th, 2013 by Gia
*Disabled SELinux
[root@FMIVPLOPNFR01 ~]# vi /etc/selinux/config
change SELINUX=enforcing to SELINUX=disabled
[root@FMIVPLOPNFR01 ~]# reboot (to affect SElinux config)

*Download and install Openfire
[root@FMIVPLOPNFR01 ~]# yum -y install wget mysql-server glibc.i686
[root@FMIVPLOPNFR01 ~]# wget http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-3.8.2
2-1.i386.rpm
[root@FMIVPLOPNFR01 ~]# rpm -ivh openfire-3.8.2-1.i386.rpm
Preparing...                ########################################### [100%]
   1:openfire               ########################################### [100%]
[root@FMIVPLOPNFR01 ~]# service openfire start
Starting openfire:
[root@FMIVPLOPNFR01 bin]# service openfire status
openfire is running
[root@FMIVPLOPNFR01 bin]# chkconfig --level 2345 openfire on

*Disabled firewall for temporary :
[root@FMIVPLOPNFR01 ~]# service iptables stop
iptables: Flushing firewall rules: [  OK  ]
iptables: Setting chains to policy ACCEPT: filter [  OK  ]
iptables: Unloading modules: [  OK  ]
[root@FMIVPLOPNFR01 ~]# chkconfig --level 2345 iptables off

*Setup MySQL
[root@FMIVPLOPNFR01 ~]# service mysqld start
[root@FMIVPLOPNFR01 ~]# mysql_secure_installation
[root@FMIVPLOPNFR01 ~]# mysqladmin -uroot -p
mysql> create database openfire;
Query OK, 1 row affected (0.06 sec)
mysql> grant all privileges on openfire.* to 'openfire'@'localhost' identified by 'openfirepassword';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> quit
Bye
[root@FMIVPLOPNFR01 ~]# chkconfig --level 2345 mysqld on

If get error like this (or Openfire can’t start) :

[root@FMIVPLOPNFR01 bin]# ./openfire.sh
./openfire.sh: /opt/openfire/jre/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
./openfire.sh: line 165: /opt/openfire/jre/bin/java: Success

Install a glibc.i686 using YUM

[root@FMIVPLOPNFR01 ~]# yum -y install glibc.i686
September 15th, 2013 by Gia

Environment :
- CentOS 6.4 (64bit)
- FreeSWITCH 1.5.6b git fb238ed 2013-09-13 15:44:10Z
- FusionPBX 3.3

This error will shown if you using https to access FusionPBX

Freeswitch log :

2013-09-14 22:11:43.120093 [ERR] mod_xml_cdr.c:365 Got error [404] posting to web server [http://127.0.0.1/app/xml_cdr/v_xml_cdr_import.php]
2013-09-14 22:11:43.120093 [ERR] mod_xml_cdr.c:372 Retry will be with url [http://127.0.0.1/app/xml_cdr/v_xml_cdr_import.php]
2013-09-14 22:11:43.120093 [ERR] mod_xml_cdr.c:383 Unable to post to web server, writing to file

Fix it :D

vi /usr/local/freeswitch/conf/autoload_configs/xml_cdr.conf.xml

Change http with https (in url parameter) :

FusionPBX CDR

Don’t forget to reloadxml in fs_cli :D

September 5th, 2013 by Gia

Query to generate CSV file :

mysql> SELECT * FROM tablename
INTO OUTFILE '/tmp/csvfile.csv'
FIELDS terminated by ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';

Error when user don’t have privilege to create file :

mysql>SELECT * FROM tablename
INTO OUTFILE '/tmp/csvfile.csv'
FIELDS terminated by ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
ERROR 1045 (28000): Access denied for user 'demo'@'localhost' (using password: YES)

Add grant to create file (execute using root user or user with grant option) :

mysql> GRANT FILE ON *.* TO 'demo'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql>FLUSH PRIVILEGES;

** GRANT FILE only works with ON *.*

If you want delete, remove or revoke GRANT file :

mysql> REVOKE FILE on *.* FROM 'demo'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql>FLUSH PRIVILEGES;
Tags: ,
Posted in Database, MySQL | No Comments »
May 27th, 2013 by Gia

RB951G-2HND + Huawei E272Environment :

  • RB951G-2HnD
  • RouterOS v6.0
  • Huawei E272

Installation step :

  1. Plug a modem to USB Port
  2. Check a modem in Resources – USB menu from Winbox
    MKT-Huawei02 Read the rest of this entry »
May 9th, 2013 by Gia
** add EPEL Repository
[root@VOIP01 /]# wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
[root@VOIP01 /]# rpm -ivh epel-release-5-4.noarch.rpm

** freeswitch prerequisites
[root@VOIP01 /]# yum -y install git autoconf automake libtool ncurses-devel libjpeg-devel
[root@VOIP01 /]# yum -y install expat-devel openssl-devel libtiff-devel libX11-devel unixODBC-devel libssl-devel python-devel zlib-devel libzrtpcpp-devel alsa-lib-devel libogg-devel libvorbis-devel perl-libs gdbm-devel libdb-devel uuid-devel @development-tools

[root@VOIP01 /]# cd /usr/local/src
[root@VOIP01 src]# git clone git://git.freeswitch.org/freeswitch.git
[root@VOIP01 src]# cd freeswitch

[root@VOIP01 freeswitch]# ./configure -prefix=/opt/freeswitch
[root@VOIP01 freeswitch]# make
[root@VOIP01 freeswitch]# make all install cd-sounds-install cd-moh-install

**create init script
[root@VOIP01 freeswitch]# adduser freeswitch -g daemon -d /opt/freeswitch
[root@VOIP01 freeswitch]# chown -R freeswitch:daemon /opt/freeswitch/
[root@VOIP01 freeswitch]# chmod -R o-rwx /opt/freeswitch/
[root@VOIP01 freeswitch]# cp /usr/local/src/freeswitch/build/freeswitch.init.redhat /etc/init.d/freeswitch
[root@VOIP01 freeswitch]# chmod +x /etc/init.d/freeswitch
[root@VOIP01 freeswitch]# chkconfig --level 345 freeswitch on
[root@VOIP01 freeswitch]# vi /etc/init.d/freeswitch

** running freeswitch
[root@VOIP01 /]# service freeswitch start
[root@VOIP01 /]#

Freeswitch init Script sample

Source :
http://wiki.freeswitch.org/wiki/Linux_Quick_Install_Guide
http://wiki.freeswitch.org/wiki/Freeswitch_init