Install Asterisk11 + FreeBPX on CentOS6.3 Virpus VPS

post on October 29th, 2013
Posted in VOIP Trixbox admin

Recently I’ve rent another VPS from Virpus Xen XVM512M. They had PBX in Flash in their OS library you can choose to install before, but not anymore. Therefore I have to install all the whole VOIP set after the OS installation. Lucky enough I found this article on the Internet made my installation so smooth.

 

Installing asterisk now

# yum -y install dnsmasq 

# rpm -Uvh http://packages.asterisk.org/centos/6/current/i386/RPMS/asterisknow-version-3.0.0-1_centos6.noarch.rpm

# yum -y update

# yum -y install asterisk asterisk-configs –enablerepo=asterisk-11

 #  yum -y install dahdi-linux dahdi-tools libpri
Installing Freepbx

# yum -y install gcc gcc-c++ wget bison mysql-devel mysql-server php php-mysql php-process php-pear php-mbstring tftp-server httpd make ncurses-devel libtermcap-devel sendmail sendmail-cf caching-nameserver sox newt-devel libxml2-devel libtiff-devel php-gd audiofile-devel gtk2-devel subversion nano kernel-devel selinux-policy sqlite-devel openssl-devel

***Install CDR ODBC required packages

# yum -y  install libtool-ltdl-devel unixODBC unixODBC-devel mysql-connector-odbc

***Install optional packages

****chan_gtalk, chan_motif, and res_xmpp will not compile unless iksemel-devel and it’s dependencies are installed. If you plan to use Google Voice ****you will need to install this. For CentOS 6, iksemel is in the EPEL repository.

#rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum -y install iksemel-devel

****Install pear DB

****Don’t worry about the warning message.

# pear install db

# yum -y install asterisk-odbc php-pear-DB asterisk-sounds-extra-en-gsm
# nano /usr/sbin/safe_asterisk

Find the line with TTY=9 and comment it out like this #TTY=9
# /usr/sbin/safe_asterisk
# rpm -Uvh http://packages.asterisk.org/centos/6/current/x86_64/RPMS/freepbx-2.11.0beta2-2_centos6.x86_64.rpm

# amportal chown /etc/dahdi/modules

# amportal chown /etc/dahdi/system.conf

Navigate to http://youripaddress  and login with the following credentials

Username    admin

Password    admin

http://asteriskonvps.com/how-to-install-asterisknow-with-freepbx-on-centos-6-vps/

WIFI HotSport! NoCatSplash

post on June 15th, 2013
Posted in Uncategorized

1. Flash your Router with DD-WRT firmware. Here is a good document on how to flash your router. http://www.dd-wrt.com/wiki/index.php/Linksys_WRT54GS_v2.0

imgres

 

 

2. After flashing your router, login and enable ssh, then config your router.

splash URL: http://www.redwindtech.com/nocatsplash/splash.html

router1

router2

 

 

3. Make a splash page, and upload to your website.

nocatsplash

 

4. done.

 

 

 

你18

post on November 25th, 2012
Posted in 我写的歌

mp3: http://netkoo.ca/wp-content/uploads/2012/11/ni18.mp3

你18
那年我们还在上学,你带着我去见世面,
你指着那片青蓝的天,说我们的幸福会更高远。

有一些张狂,有一些朦胧,有一些初恋的心痛。
我笑容灿烂,我热血沸腾,我却看不清你的面容。

天空早已不再蓝,我还是那么年轻,
黑夜你慢慢地走来,白天我已经不在。

那年我们都在船上,外面老天爷阴沉着脸,
你对着岸边大声说,你要将一切统统改变!

我不会再害怕,我不会再委屈,不会担心说话没有底气。
我有多爱你,我有多爱你,我愿意把身体献给你。

昨天我路过你的窗前,看着你细心地描着眉眼。
窗外的世界你不在意,眼里只有着镜中的自己。

我要感谢你,让我看清你,我心里不再有任何委屈。
我想告诉你,我还会爱你,只要你肯把我放在你心里。

啦。。。。。。。啦。。。。。。
啦。。。。。。 啦。。。。。。

你今年, 18,
你问我,幸福吗?
我看着你,没有回答,
因为我,真的,有点害怕。

CentOS 6.3 with RAID0 and RAID1 (Mirror DIsks)

post on November 16th, 2012
Posted in Linux/Unix Admin

Setup a CentOS 6.3 server, with OS on RAID 1 partition, and SWAP on RAID 0 partition.

1. Download CentOS-6.3-x86_64-minimal-EFI.iso and start from this image file.

 

2. Skip media test, select default language, then select “Basic Storage Devices”

 

3. Name your server

 

4. Create Custom Layout, because we need to setup soft RAID.

 

5. Clear all previous partition settings. Assume you have 2 identical hard drives 2x20GB.

 

6. creat 1 4GB partition, with file system type “Software RAID”, on disk “sda”, then click “OK”. After this repeat this step on disk “sdb”

 

7. Create a “Software RAID” on disk “sda”, with size “Fill to maximum allowable size”, then click “OK”. Repeat this step on disk “sdb”

 

8. After all partitions created

 

9. Click “create” button then select “RAID Device” then click “Create”.

 

10. Create SWAP first. Select File System Type: “SWAP”, RAID Device “md0″, RAID Level “RAID0″, then select “sda1″ and “sdb1″.

 

11. Create OS file system. Mont Point “/”, File System Type: “ext4″, RAID Device: “md1″, RAID Level: “RAID1″, select RAID Members: sda2 and sdb2

 

12. Final layout.

 

13. Done. This should build you a 8GB RAID0 SWAP, and 16GB RAID1.

 

 

SAMBA server (NAS) on Centos 6

post on October 31st, 2012
Posted in Linux/Unix Admin

Setting up a samba server is kind of hard if you don’t have the perfect document in hand. Here I’m recording my samba server config files and setup procedure

1. install samba ( this should be the easy part if you have the centos repo configured correctly.)

yum install samba

 

2. add some samba user(s)

useradd -d /home/testuser -s /bin/bash -c “samba test user” testuser

passwd testuser ( say give it a password like “abc123?”)

 

3. Create your Shared directory and give owner to your testuser. I use /nas/HoldenNet_nas

mkdir /nas

mkdir /nas/HoldenNet_nas

chown -R testuser:testuser /nas/HoldenNet_nas

chmod -R 777 /nas

 

4. create samba config file. I just create my new smb.conf file, it’s easier to test. Make sure you BACKUP your current smb.conf file first!

vi /etc/samba/smb.conf

[global]
workgroup = WORKGROUP
server string = SAMBA server
netbios name = SAMBA server
security = user
browseable = yes
hosts allow = 192.168.  #your local network

#make sure you have these 2 lines or you won’t have smbpasswd file created
passdb backend = smbpasswd
smb passwd file = /etc/samba/smbpasswd

##### less important global settings######
wins support = yes
dns proxy = no
name resolve order = lmhosts bcast host wins
log file = /var/log/samba/log.%m
max log size = 1000
panic action = /usr/share/samba/panic-action %d
##########################################

 

[HoldenNet_nas]
path = /nas/HoldenNet_nas
comment = “Holden NET internal user only”
writeable = yes
public = no
valid users = oss testuser

######### less important path settings ######
socket options = TCP_NODELAY # better performance ?
#############################################

 

5. restart your SAMBA server

service smb restart

 

6. add samba server user

smbpasswd -a testuser (give the password “abc123?”)

make sure you have this file (/etc/samba/smbpasswd) created with your new testuser account.

 

7. test from your windows machine by launch IE browswer and type \\your-samba-server-ip , and you should see the password prompt.

username: testuser

password: abc123?

 

 

 

北京的秋天

post on October 18th, 2012
Posted in 我写的歌

 

mp3: http://netkoo.ca/wp-content/uploads/2012/10/北京的秋天.mp3

 

 

北京的秋天
秋天的空气是微凉的,
秋天的树叶是枯黄的,
秋天的人穿秋天的衣,
秋天的心情是惆怅的。

豆浆油条煎饼果子,
故宫天坛北海公园儿,
东四六条窄窄的胡同,
平安大街汹涌的人群。

北京的秋天,银杏的世界,
后海的喧嚣,堵车的苦恼。
天通苑风起,八通线拥挤,
三元桥老去,西直门桥傻逼。

银锭桥西山从来没见过,
何勇的舌头从未尝过,
自行车从长安街骑过,
看到很多白牌儿车窜过。

国贸的一期二期三期四妾。
五环六环天津石家庄。
这个城市越来越大,
离开人也越来越多。

北京的秋天,回不去的世界,
那个世界有风,那个世界有光。
北京的秋天,青春的季节
那时的我,还现在没这么装。

A2billing + Freepbx 2.10 + Pbx In A Flash Installation

post on October 3rd, 2012
Posted in VOIP Trixbox admin

Recently I’m trying to upgrade my voip server. I’ve rented a new vps under Virpus because you can choose pbx in flash as your OS installation. This installation will include centos 5.7, webmin, pbx in flash 1.8x, mysql 5.x, and phpmyadmin, of course with php and apache web server.

 

I choose the PBX In A Flash v1.8.6 Purple CentOS 5.7 x64. They have PBX In A Flash 2.0622 x64 – CentOS 6.2 x64 but I tried a few times doesn’t work, even opened a ticket to Virpus, but still not working. So,  back to PBX In A Flash 1.8.6.

Right after installation finishes. SSH login to your server change the root password, and use passwd-master to setup maint password and sync it to the server.
Login to webmin with your new root password, upgrade centos to 5.7 and upgrade webmin to 1.6. Make sure you have the asterisk start on boot.

Login to FreePBX web console, and click on module admin. Upgrade it all the way to 2.10.x. If you have problem to apply configuration between upgrades, please uninstall that google voice module. You can install it back after your upgrade done.

 

Now you should have a complete VOIP system, without a2billing. Time to make some backup.

[code]

Backup:

$>tar cvzpf /SystemBackup/Backup.tgz --same-owner --exclude=/backup/Backup.tgz --exclude=/backup/error.log --exclude=/proc/* --exclude=/dev/* --exclude=/mnt/* --exclude=/sys/* --exclude=/tmp/* --exclude=/SystemBackup/* /

Restore:

$>cd /

$>tar xvzpf /SystemBackup/Backup.tgz

[/code]

 

Next install A2billing. I followed the one online document and it worked almost perfect for me. You can check here if you like, but their is a little typo.

Download and extract

[code]

cd /usr/local/src/

wget --no-check-certificate https://github.com/Star2Billing/a2billing/tarball/v1-current

tar xvf Star2Billing-a2billing-v1-current-0-g95789f5.tar.gz

ln -s ./Star2Billing-a2billing-d960375 ./a2billing

ln -s /var/lib/asterisk /usr/share/asterisk

[/code]

 

Build Database

[code]
mysql -u root -p
Enter password:
mysql>CREATE DATABASE a2billing;
Query OK, 1 row affected (0.00 sec)
mysql>quit
Bye
[/code]

 

Populate the Database

[code]

cd /usr/local/src/Star2Billing-a2billing-d960375/DataBase/mysql-5.x

./install-db.sh

[/code]

 

 

Setup the Database

Install A2Billing DataBase
-----------------------------
Enter Database Name :
a2billing
Enter Hostname :
localhost
Enter UserName :
root
Enter Password :
mypass
mysql --user=root --password=mypass --host=localhost a2billing
mysql -u root -p
Enter password:
mysql> CREATE USER 'a2buser'@'localhost' IDENTIFIED BY 'mypass';
 Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL ON a2billing.* TO 'a2buser'@'localhost';
 Query OK, 1 row affected (0.00 sec)
mysql> quit
 Bye
mysql -u a2buser -p
Enter password:
mysql> USE a2billing;
mysql> SHOW TABLES;
97 rows in set (0.00 sec)
mysql> SHOW GRANTS;
2 rows in set (0.00 sec)
mysql> quit
Bye

 

Setup A2billing.

ln -s /usr/local/src/a2billing/a2billing.conf /etc/a2billing.conf
nano /etc/a2billing.conf
[database]
hostname = localhost
port = 3306
user = a2buser
password = mypass
dbname = a2billing
dbtype = mysql
chmod 777 /etc/asterisk
touch /etc/asterisk/additional_a2billing_iax.conf
touch /etc/asterisk/additional_a2billing_sip.conf
echo '#include additional_a2billing_sip.conf' >> /etc/asterisk/sip.conf
echo '#include additional_a2billing_iax.conf' >> /etc/asterisk/iax.conf
chown -Rf apache:apache /etc/asterisk/additional_a2billing_iax.conf
chown -Rf apache:apache /etc/asterisk/additional_a2billing_sip.conf
chmod 777 /etc/asterisk/additional_a2billing_iax.conf
chmod 777 /etc/asterisk/additional_a2billing_iax.conf

Install Sound
cd /usr/local/src/a2billing/addons/sounds
./install_a2b_sounds.sh
chown -R asterisk:asterisk /usr/share/asterisk/sounds/

Configure Asterisk Manager 
vi /etc/asterisk/manager.conf
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
[myasterisk]
secret=mycode
permit=127.0.0.1/255.255.255.0
read=system,call,log,verbose,command,agent,user
write=system,call,log,verbose,command,agent,user

Install AGI component:
ln -s /usr/local/src/a2billing/AGI/a2billing.php /var/lib/asterisk/agi-bin/a2billing.php
ln -s /usr/local/src/a2billing/AGI/a2billing_monitoring.php /var/lib/asterisk/agi-bin/a2billing_monitoring.php
ln -s /usr/local/src/a2billing/common/lib /var/lib/asterisk/agi-bin/lib
chmod 0774 /usr/local/src/a2billing/AGI/a2billing.php
chmod 0774 /usr/local/src/a2billing/AGI/a2billing_monitoring.php
chmod -Rf 0774 /usr/local/src/a2billing/common/lib
chown asterisk:asterisk /usr/local/src/a2billing/AGI/a2billing.php
chown asterisk:asterisk /usr/local/src/a2billing/AGI/a2billing_monitoring.php
chown -Rf asterisk:asterisk /usr/local/src/a2billing/common/lib

Install web-based Graphical interface
mkdir /var/www/html/a2billing
chown asterisk:asterisk /var/www/html/a2billing
mkdir -p /var/lib/a2billing/script
mkdir -p /var/run/a2billing
ln -s /usr/local/src/a2billing/admin /var/www/html/a2billing/admin
ln -s /usr/local/src/a2billing/agent /var/www/html/a2billing/agent
ln -s /usr/local/src/a2billing/customer /var/www/html/a2billing/customer
ln -s /usr/local/src/a2billing/common /var/www/html/a2billing/common
chmod -R 755 /usr/local/src/a2billing/admin/templates_c
chmod -R 755 /usr/local/src/a2billing/customer/templates_c
chmod -R 755 /usr/local/src/a2billing/agent/templates_c
chown -Rf asterisk:asterisk /usr/local/src/a2billing/admin/templates_c
chown -Rf asterisk:asterisk /usr/local/src/a2billing/customer/templates_c
chown -Rf asterisk:asterisk /usr/local/src/a2billing/agent/templates_c
chmod -R 777 /var/lib/php/session
chown -R asterisk:asterisk /var/lib/php/session

Login to a2billing web consoole

http://yourip/a2billing/admin/

Username: root
Password: changepassword

 

Done!



 

 

 

Samsung LCD TV power on issue.

post on July 13th, 2012
Posted in Uncategorized

This post is not computer related issue, but a TV problem.

My Samsung LCD 52 inch TV refuses to turn on when I press the power button, instead, it only makes “click click click…..” sounds. After checking on the internet, many people having the similar problem and all pointing to the same problem, capacitor plague. Means the voltage is too high that pops open the capacitors on the board. Of course, the solution would be changing your capacitors.

Here is the picture after you open the back of the Samsung LCD TV.

 

2 Popped capacitors (blue), CM852 and the one on it’s left CM853.

 

from another angle, you can see the pops and leaking liquid (brown stuff on top of the CM852 capacitor).

 

Spent $4 bought 5 of these new black capacitors, and de-soldered these 2 blue capacitors.

 

Soldering…. make sure the positive and negative are correct. These are my co-worker’s hands, as mine are not so stable.

 

Done. Front and back.

 

Plugin the board and turn on TV. Perfect!!! :)

 

 

So this whole fix saved me perhaps $200+.

I’ve only bought this TV for 3-4 years, and it’s already broken like this. So next time when I’m thinking of buying a Samsung TV, I’ll think twice.

 

 

 

Install webmin to new vps (centos 5)

post on June 19th, 2012
Posted in Linux/Unix Admin

I just rented a new VPS and need to install the server management software webmin on to it. Webmin is free and easy to install and use and it doesn’t take to much of your resource.

1. Update the new vps.
[root@ server1 ~]# uname -a
Linux server1 2.6.18-274.7.1.el5.028stab095.1 #1 SMP Mon Oct 24 20:49:24 MSD 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@server1 ~]# yum update

2. Download the latest webmin from http://www.webmin.com/download.html
[root@server1 ~]# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.580-1.noarch.rpm

3. Make and import the webmin key file.
[root@server1 ~]# vi webmin1.58_keyfile

-----B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ssA40O5QR4t915z6wS4Ml+fAc5ZOeL6EQxiP+x+rz6h9+Mc8rawowY+7sBnvVw5O
YoVXiEYEGBECAAYFAjx9wSoACgkQ2Xo66RH2PFH+ZgCggAyuOLaoE9t9tyJbifEz
/YzvqYwAnj85Ehe8EmnKuor/k/TPtKl4MzDm
=oxvD
-----END PGP PUBLIC KEY BLOCK-----
~
~
"webmin1.58_keyfile" [New] 24L, 1320C written

[root@server1 ~]# rpm --import webmin1.58_keyfile
[root@server1 ~]# rpm --checksig webmin-1.580-1.noarch.rpm
webmin-1.580-1.noarch.rpm: (sha1) dsa sha1 md5 gpg OK

4. Install webmin
[root@email ~]# rpm -U webmin-1.580-1.noarch.rpm
Operating system is CentOS Linux
Webmin install complete. You can now login to http://YOURIP:10000/
as root with your root password.
[root@server1 ~]#

5. Login your webmin console.

done.

Hello world! again!

post on June 4th, 2012
Posted in Uncategorized

Migrating my old netkoo.ca to a new server. this is my first hello world in this new server!.