This is where we have debugging notes.

Asterisk console - asterisk -r
max debug level - core set verbose 999

who -r - to check the init level of the upbx

0 /etc/rc.d/rc0.d/ shutdown/halt system
1 /etc/rc.d/rc1.d/ Single user mode
2 /etc/rc.d/rc2.d/ Multiuser with no network services exported
3 /etc/rc.d/rc3.d/ Default text/console only start. Full multiuser
4 /etc/rc.d/rc4.d/ Reserved for local use. Also X-windows
5 /etc/rc.d/rc5.d/ XDM X-windows GUI mode.
6 /etc/rc.d/rc6.d/ Reboot

To add an extra repository, place a definition file in the /etc/yum.repos.d/ directory on your system
1. root ssh access
2. ran chmod -s * on /bin - don't know what will happen with new load
Fixed - 3. unable to execute unmount in /bin


tcpdump -i eth0 -n -s0 -vvv udp port 5060 -w ./dump2.pcap

Linux Hardware clock

date -s "02/13/2013 20:49:00"
/sbin/hwclock --set --date="02/13/2013 21:04:00" --utc

Linux Software Release Name

cat /etc/*release

Linux Software Release Name

cat /etc/*release

Linux kdump

vi /boot/grub/grub.conf
add crashkernel=128M@16M to the end of the kernel command.  For example:

kernel /vmlinuz-2.6.18-274.7.1.el5 ro root=/dev/VolGroup01/LogVol00 console=ttyS0 rhgb quiet crashkernel=128M@16M

vi /etc/kdump.conf
path /var/crash

chkconfig kdump on
service kdump start

test: - this will panic the machine.
echo 1 > /proc/sys/kernel/sysrq
echo "c" > /proc/sysrq-trigger

Linux Date Command

date -s "11/20/2003 12:48:00"

 ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

public key authentication ssh

Run ssh-keygen to create the public/private key pair:

    local-host$ ssh-keygen -t rsa -f ~/.ssh/key

Install the private key

Add the following lines to ~/.ssh/config:

    Host *
    IdentityFile ~/.ssh/key

Install the public key on a remote host with OpenSSH

On the remote host, paste the contents of the public key in ~/.ssh/authorized_keys2:

    local-host$ cat  ~/.ssh/
    remote-host$ paste in ~/.ssh/authorized_keys2

Linux iNode Information

tune2fs -l /dev/mapper/VolGroup00-LogVol00


Open a new tab in Firefox and type “about:config” in the browser’s address bar. Then hit the warning message ” I will be careful”, in the following window – right click anywhere and choose “New Boolean”
Enter the name as network.manage-offline-status and set it’s value to false.

network.dns.disableIPv6 = true


chkconfig network --add
chkconfig --level 235 network on
chkconfig --list

Setting DISPLAY env variable.

function get_xserver ()
    case $TERM in
       xterm )
            XSERVER=$(who am i | awk '{print $NF}' | tr -d ')''(' ) 
            # Ane-Pieter Wieringa suggests the following alternative:
            # I_AM=$(who am i)
            # SERVER=${I_AM#*(}
            # SERVER=${SERVER%*)}

        aterm | rxvt)
        # Find some code that works here. ...

if [ -z ${DISPLAY:=""} ]; then
    if [[ -z ${XSERVER}  || ${XSERVER} == $(hostname) || \
      ${XSERVER} == "unix" ]]; then 
        DISPLAY=":0.0"          # Display on local host.
        DISPLAY=${XSERVER}:0.0  # Display on remote host.

export DISPLAY

CentOS Installer Information

See log messages behind the gui
back to the gui

Ethernet Tool

ethtool eth0 = shows eth0 settings.
ethtool -a eth0
ethtool -K eth0 tso off - Disables TCP Segmentation 

vi /etc/rc.d/rc.local
ethtool -K eth0 tso off

To permanently set:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
ETHTOOL_OPTS="speed 100 duplex full autoneg off"
# /etc/init.d/network restart

Mounting a USB Flash Drive

Start a tail on /var/log/messages to see what device is being used for the usb drive. Make directory to mount to; then mount to usb device.
tail -f /var/log/messages 
mkdir /mnt/flash
mount -t vfat /dev/sdb1 /mnt/flash

Mounting an internal DVD drive

mkdir /mnt/dvd
# This mounts the dvd device read-only (-r) and auto detects the files system type (-t auto).
mount -r -t auto /dev/dvd /mnt/dvd


gzip --> Add files to a compressed "gz" file.
gunizp <-- Remove files from a compressed "gz" file.

TAR - Tape Archive

tar -tvf archive.tar         # List all files in archive.tar verbosely.
tar -cvf archive.tar         # Create all files in archive.tar verbose
tar -xvf archive.tar         # Extract all files in archive.tar verbose

Root Login SSH

Root Login
vi /etc/ssh/sshd_conf and un-comment #PermitRootLogin yes
ps -ef|grep sshd
kill -HUP <processnum>

Root Login via Xming (GDM Login)

First, edit the file /etc/gdm/custom.conf and add the following two entries:


Restart GDM

Setting up VNC for remote muPBX desktop access

#Install the VNC server if not already installed.
yum -y install vnc-servers

cd /etc/sysconfig
vi vncservers
# Add the following lines
VNCSERVERARGS[1]="-geometry 1280x720"

run "service vncserver restart" - this will create the .vnc directory in the admin's home directory.

su - admin
run "vncpasswd" - Enter a password for admin.
cd .vnc
vi xstartup
#Uncomment "unset SESSION_MANAGER" and "exec /etc/X11/xinit/xinitrc" - see xstart example below.
Add "( while true ; do xterm ; done ) &"
run "exit"  - Exit from admin back to root user.
run "service vncserver restart"

run "chkconfig vncserver on" - This will enable VNC after a reboot.


# Uncomment the following two lines for normal desktop:
exec /etc/X11/xinit/xinitrc
# Add the following line to ensure you always have an xterm available.
( while true ; do xterm ; done ) &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

file:vncservers - non-secure example
#Bunch of comments...#
VNCSERVERARGS[1]="-geometry 1280x720"

Download TightVNC to your PC: Enter your.ip.address:1 to connect to the muPBX VNC server.
Use a Java enabled browser and surf to: http://your.ip.address:5801 (external link) to connect to the muPBX VNC server.
If it doesn't work properly, try rebooting your server or restarting the Xserver. I rebooted.

Setting up xWindows on CentOs 5

Author: (external link)

NOTE - I found this only works if you have a monitor plugged into the server.

[root@dlp ~]#
vi /etc/gdm/custom.conf

# line 47: add

[root@dlp ~]#
vi /etc/X11/fs/config
# bottom: make it comment
no-listen = tcp

[root@dlp ~]#
/etc/rc.d/init.d/xfs restart

[root@dlp ~]# reboot

Installing asterisk

1. Download Asterisk source files using svn.
cd /usr/src

# Latest code:
svn checkout asterisk
svn checkout dahdi-linux
svn checkout dahdi-tools
svn checkout libpri

# Branch code:
Use: - To view what version of code is desired.

svn checkout asterisk-1.6.2
svn checkout dahdi-linux-2.2
svn checkout dahdi-tools-2.2
svn checkout libpri-1.4

2. Make sure the following packages are installed before proceeding:
rpm -q bison
rpm -q bison-devel
rpm -q ncurses
rpm -q ncurses-devel
rpm -q zlib
rpm -q zlib-devel
rpm -q openssl
rpm -q openssl-devel
rpm -q gnutls-devel
rpm -q gcc
rpm -q gcc-c++

If any of the package is not installed, use yum to install it, e.g.,
yum install bison-devel

3. Make sure you establish a link while in the /usr/src directory:
ln -s kernels/kernel_version linux

4. Install the Asterisk files in the following order -> libpri, dahdi-linux, dahdi-tools, asterisk.

# Installing Libpri
cd /usr/src/libpri
make install

# Installing dahdi-linux
cd /usr/src/dahdi-linux
make install

# Installing dahdi-tools
optional step: select custom configuration:
make menuselect
make install
# To install init scripts and config files:
make config

# Installing Asterisk
cd /usr/src/asterisk
make menuselect [optional]
make install
make samples - Needed for config files.
make progdocs [optional]

5. Verify your Asterisk installation by doing the following:
asterisk -vvvc - launch Asterisk in the foreground mode (not a daemon)
safe_asterisk - connect to its console by typing `asterisk -vvvvvr`.
reload - reload the entire configuration.

Install Asterisk GUI:
cd /usr/src
svn checkout asterisk-gui
cd ./asterisk-gui
make install

Files that need to be modified:

enabled = yes
webenabled = yes
port = 5038
bindaddr =

secret = mysecret
;I left the commented ACL deny/permit in for reference.
read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
write = system,call,agent,user,config,command,reporting,originate

redirect = / /static/config/cfgbasic.html

Note: bindaddr means you can access it from anywhere, if you want
access only on the local machine, put instead.

To start Asterisk at boot time, do the following:
cd /usr/src/asterisk-gui
make checkconfig - Check your Asterisk-GUI configuration
cd /usr/src/asterisk
make config - this add the startup script /etc/rc.d/init.d/asterisk

Then issue the following command to be able to start and stop asterisk via service command:
chkconfig --add asterisk

NOTE - I think make install is going to overwrite http.conf and manager.conf. It might be necessary to do the procedure "Setup HTTP Server", again. Running "make checkconfig" should pass if they are okay.
run "make checkconfig"
cd /var/lib/asterisk/static-http
chmod 0777 ./config
asterisk -r - for Asterisk CLI
CLI> reload

To run the GUI use the following URLs.
NOTE - you MUST use the URLs below. Trying to surf to just the ip.address:port will result in some goofy behavior.

Removing the color from the Linux terminal

vi /etc/DIR_COLORS
COLOR none
vi /etc/DIR_COLORS.xterm
COLOR none

Remove color from vi:
vi ~/.vimrc
syntax off

Power off muPBX from remote SSH terminal

/sbin/shutdown -h now

Use "top" to monitor processes.


Auto start user defined process after booting.

cd /etc/rc.d
vi rc.local
#Add start command.

Setting up sendmail.

Create script.
cd /etc/mail
make -C /etc/mail
/etc/init.d/sendmail restart

NOTE - This didn't work.
# Did not modify resolv.conf because it was automagically generated by dhcp.
/etc/resolv.conf File

/etc/hosts File       localhost.localdomain localhost linuxsrv1

/etc/mail/access File
Connect:localhost.localdomain           RELAY
Connect:localhost                       RELAY
Connect:                       RELAY

/etc/mail/local-host-names File
# local-host-names - include all aliases for your machine here.

# Person who should get root's mail
# Person who should get root's mail

Note - use "dnl" to comment a line in /etc/mail/ and not "#".


mail -v username
tail the /var/log/maillog

Linux Soft Bridge Ethernet Interfaces

brctl   - prints the available commands.
brctl addbr mybridge
brctl addif mybridge eth0
brctl addif mybridge eth1
ifconfig eth0
ifconfig eth1
ifconfig mybridge netmask up

slaveIfs="1 2 3 4 6 7 8 9 10";
[ -z "$cmd" ] && cmd="start";
case "$cmd" in
    brctl addbr br0;
    brctl stp br0 off;
    brctl addif br0 eth0;
    brctl addif br0 eth1;
    (ifdown eth0 1>/dev/null 2>&1;);
    (ifdown eth1 1>/dev/null 2>&1;);
    ifconfig eth0 up;
    ifconfig eth1 up;
    ifconfig br0 broadcast netmask up;
    route add default gw;
    for file in br0 eth0 eth1;
      echo "1" > /proc/sys/net/ipv4/conf/${file}/proxy_arp;
      echo "1" > /proc/sys/net/ipv4/conf/${file}/forwarding;
    echo "1" > /proc/sys/net/ipv4/ip_forward;
    brctl delif br0 eth0;
    brctl delif br0 eth1;
    ifconfig br0 down;
    brctl delbr br0;
    #ifup eth0; ### Adapt to your needs.
    #ifup eth1; ### Adapt to your needs.
    $0 stop;
    sleep 3;
    $0 start;


yum check-update
yum update

#When yum goes south
yum install yum-utils

Windows files Linux

Samba is the Linux package for sharing files with Windows SMB.
# Samba client.
/usr/bin/smbclient \\\\yourwindowspcname\\somesubdirectory windowspassword

# Mounting using samba file system.  Note the file system is not the old smbfs it is cifs.
mkdir /mnt/win
mount -t cifs //fqdnoripaddress/somesubdir -o  username=winpcusername,password=winpassword/mnt/win

# For the fstab file to mount the windows drive after a reboot.
//fqdnoripaddress/somesubdir /mnt/win cifs username=winpcusername,password=winpassword 0 0

rsync for backing up files to a locally mounted drive.

# Archive, verbose, compress stream
rsync -avz /tools /mnt/win/linuxsrv1

# Archive restore, verbose, compress stream
rsync -avz /mnt/win/linuxsrv1/tools /

Linux File Permissions

File Mode Drawing by: (external link)

# Transferring files from a windows SMB drive will sometimes set the group file permission with a capital S.
# To fix: 
chmod g+x
chmod g-s

 |------file mode------|
 |                     |
 |       |----full-----|
 |-type| |   |--basic--|
 |     | |   |         |
 oo0 000 000 000 000 000
 ... ... ... ... ... ...
    |     |   |   |   |
    |     |   |   |   |---- rwx for other
    |     |   |   |
    |     |   |   |-------- rwx for group
    |     |   |
    |     |   |------------ rwx for user
    |     |
    |     |---------------- set uid, set gid, sticky bit
    |---------------------- file type: regular (-)
                                       directory (d)
                                       character special (c)
                                       block special (b)
                                       fifo (p)
                                       symbolic link (l)
                                       socket (s)

# To change the user permission to allow execution
chmod u+x filename
#results in: ---x------

# To change everything to allow execution
chmod +x filename
#results in: ---x--x--x

# If you want to set everything on:
chmod 0777 filename
#results in: -rwxrwxrwx

Boot without monitor

This is necessary if you don't leave a monitor plugged into the muPBX and you are running the muPBX in GUI mode (init level 5). Comment out the "splashimage" and add "nomodeset" to the kernel options. See below.
# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
title CentOS (2.6.18-164.6.1.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-164.6.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet nomodeset
        initrd /initrd-2.6.18-164.6.1.el5.img
title CentOS (2.6.18-128.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet nomodeset
        initrd /initrd-2.6.18-128.el5.img

Finding CentOS Version

rpm -qa|grep centos-release

Asterisk Console Commands

# No HTTP keep-alive messages
core set verbose 3
# Debug 
core set verbose 7

core restart now
# Useful for showing what's configured.
sip show settings

sip show registry

Changing Linux hostname

#Replace Abcdefg with your hostname in the files below.
# Edit network file
vi /etc/sysconfig/network

# Edit hosts file
vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.       localhost.localdomain localhost Abcdefg
::1             localhost6.localdomain6 localhost6

Changing Linux IP Address

vi /etc/sysconfig/network-scripts/ifcfg-eth0
vi /etc/hosts
vi /etc/sysconfig/network
vi /etc/resolv.conf
/etc/init.d/network restart

Creating /etc/rc.d/init.d chkconfig --add file

# Starts and stops

case "$1" in

        ./ >> /var/log/file.log&



        kill $(pgrep

        $0 stop
        $0 start

             if pidof -o %PPID > /dev/null; then
                     echo "Running"
                     exit 0
                     echo "Not running"
                     exit 1

        echo "Usage: $0 {start|stop|restart|status}"
        exit 1

rpm, svn and yum notes

Installing rpmforge yum repos
# rpm -Uhv
createrepo /home/root/rpmbuild/RPMS/x86_64/

 name=MPS Server - $basearch

Menu [toggle]