Megamon Tech Blog

IT issues resolved

The scripts featured in the community section of zimbra’s website are quite elaborate.

Personally – I like things simple:

#!/bin/sh

mailhost=”atmx02″;

date
ssh $mailhost “service zimbra stop”
rsync -av -e ssh $mailhost:/opt/zimbra /data/backup
ssh $mailhost “service zimbra start”
date

Here is how you enable 802.x tagging on your Centos host

cat /etc/sysconfig/network-scripts/ifcfg-vlan100

VLAN=yes
VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
DEVICE=vlan100
PHYSDEV=eth5
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.200.254
NETMASK=255.255.255.0

Update

No comments

It’s February 2010. Far out time flies.

The example shows group dialing on the inbound number, to 2 SIP clients as well as a Cisco VoIP handset.

Where 12345678 is your mynetfone account number.

extensions.conf:

[myfone-inbound]

exten => 12345678,1,Dial(SIP/6666,30)
exten => 12345678,2,Congestion
exten => 12345678,102,Busy

[default]

exten => 12345678,1,Dial(SIP/6666&SIP/6667&SCCP/6668,30)
exten => 12345678,2,Congestion
exten => 12345678,102,Busy

sip.conf:

[mynetphone-out]
disallow=all
allow=ulaw
allow=alaw
authname=12345678
canreinvite=no
dtmfmode=rfc2833
fromuser=12345678
host=sip99.mynetfone.com.au
insecure=very
nat=yes
pedantic=no
qualify=yes
secret=
type=friend
username=12345678

[12345678]
canreinvite=no
context=myfone-inbound
fromuser=12345678
insecure=very
qualify=no
secret=
type=friend
username=12345678

dont forget NAT and rtp.conf, forward these UDP ports onto your Asterisk server

[general]
;
; RTP start and RTP end configure start and end addresses
;
; Defaults are rtpstart=5000 and rtpend=31000
;
rtpstart=15000
rtpend=20000

master /etc/my.cnf configuration:

server-id=1
relay-log = /var/lib/mysql/mysql-relay-bin
relay-log-index = /var/lib/mysql/mysql-relay-bin.index
log-error = /var/lib/mysql/mysql.err
master-info-file = /var/lib/mysql/mysql-master.info
relay-log-info-file = /var/lib/mysql/mysql-relay-log.info
log-bin = /var/lib/mysql/mysql-bin

slave /etc/my.cnf configuration:

server-id=2
relay-log = /var/lib/mysql/mysql-relay-bin
relay-log-index = /var/lib/mysql/mysql-relay-bin.index

restart mysql on the master:

service mysqld restart

stop mysql on the slave:

service mysqld stop

on the master grant privileges to the slave:

GRANT REPLICATION SLAVE ON *.* TO ‘user’@'host’ IDENTIFIED BY ‘pass’;

on the master lock the database:

FLUSH TABLES WITH READ LOCK;

on the master take note of the current position and log file name:

SHOW MASTER STATUS \G

copy the data from the master to the slave

rsync -e ssh -av /var/lib/mysql/ root@host:/var/lib/mysql

on the master unlock the database:

UNLOCK TABLES;

fire up mysql on the slave:

service mysqld start

on the slave configure the master:

CHANGE MASTER TO
MASTER_HOST=’master_host’,
MASTER_USER=’user’,
MASTER_PASSWORD=’pass’,
MASTER_LOG_FILE=’log_file_name’,
MASTER_LOG_POS=log_position;

on the slave fire up the replication:

SLAVE START;

check on the slave status:

SHOW SLAVE STATUS \G

rejoice.

test it out – create tables, drop a database, do whatever you like on the master and watch the magic on the slave.