Sunday, December 03, 2006

Networking Setup on Debian Linux

The networking configuration and eth0 is configured in the file /etc/network/interfaces file.If the system is set up to use dhcp, then the /etc/network/interfaces would contain:

iface eth0 inet dhcp

To change the system to use a static IP address, change the /etc/network/interfaces file to:

iface eth0 inet static

address 192.168.1.1

netmask 255.255.255.0

gateway 192.168.1.254

Thursday, August 24, 2006

Asterisk Installation on Debian Sarge 3.1

Asterisk Installation on Debian Sarge:
Linux rbast 2.6.8-2-386 #1 Tue Aug 16 12:46:35 UTC 2005 i686 GNU/Linux

After several days of trying to have a Linux box with a recompiled kernel (and failed every time) I gave up and just do the basic/minimum and no packages installation of debian netinstall. After that I started the Asterisk installation.


Here are the steps. They worked for me, I picked them up from several sites.

cd /usr/src/
apt-get install kernel-headers-2.6.8-2-386

apt-get install cvs
apt-get install libssl-dev
apt-get install zlib1g-dev
apt-get install libnewt-dev
apt-get install bison
apt-get install ncurses-dev
apt-get install libssl-dev
apt-get install initrd-tools
apt-get install procps


mkdir asterisk
cd asterisk

wget http://ftp.digium.com/pub/asterisk/asterisk-1.2.4.tar.gz
wget http://ftp.digium.com/pub/zaptel/zaptel-1.2-current.tar.gz
wget http://ftp.digium.com/pub/libpri/libpri-1.2-current.tar.gz
wget http://ftp.digium.com/pub/libiax/iax-0.2.2.tar.gz
wget http://ftp.digium.com/pub/asterisk/asterisk-1.2-current.tar.gz
wget http://ftp.digium.com/pub/asterisk/asterisk-addons-1.2-current.tar. gz

tar xvfz libpri-1.2-current.tar.gz
cd libpri-1.2.3/
make clean
make
make install

cd ..
tar xvfz zaptel-1.2-current.tar.gz
cd zaptel-1.2.8/
make clean
make linux26)
make install
modprobe zaptel
modprobe wcfxo
ztcfg
(from goods2world where I bout the cheap/clone x100p. => Also, this commands need to get executed whenever
you restart the system. Make sure to add it to init.d loading scripts. Stupid installation manual can be found
here http://www.goods2world.com/downloads/X100PG2W.pdf)


cd ..
tar xvfz asterisk-1.2-current.tar.gz
cd asterisk-1.2.11/
make
make install
make samples

(don't know why I put this notes here)
wget http://ftp.digium.com/pub/asterisk/g729/linux/32-bit/i386/codec_g72 9a.so
wget http://ftp.digium.com/pub/asterisk/g729/register_utility/glibc2.3.5 /x86/register
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-sounds-1.2.1.t ar.gz

cd ..
tar xvfz asterisk-sounds-1.2.1.tar.gz
cd asterisk-sounds-1.2.1
make clean
make install

cd ..
cd asterisk-addons-1.2.4/
make clean
make
make install


cd..
modprobe ztdummy


From Asterisk TFOT
Let’s look at some examples. To start Asterisk and connect to the CLI with a verbos-
ity level of 3, use the following command:
# /usr/sbin/asterisk –cvvv
If the Asterisk process is already running (for example, if you started Asterisk with
/usr/sbin/asterisk), instead use the reconnect switch, like so:
# /usr/sbin/asterisk –vvvr

Get a sipphone and install it. Try to connect to the ip of the server and dial any number.
The examples installation prepared the system to accept any incoming call and play a menu so
anything you dial will work. If you hear the menu. You are ready for phase II (now what!!!)

Next step. READ THE MANUALS!!!!

Tuesday, August 22, 2006

SELinux Tip

I installed vlcplayer and mplayer to watch movies and also add some codecs. When run this applications generated errors on dmesg like the following:

audit(1156241386.596:14): avc: denied { execmod } for pid=2850 comm="vlc" name="libavutil.so.49.0.0" dev=dm-0 ino=284990 scontext=user_u:system_r:unconfined_t:s0 tcontext=system_u:object_r:lib_t:s0 tclass=file

This was an issue on SELinux don't giving them access to the files. Looking around I found the following comment on http://fedora.redhat.com/docs/selinux-faq-fc5/:


SELinux restricts certain memory protection operation. Following is a list of those denials, as well as possible reasons and solutions for those denials. For more information on these restrictions, see http://people.redhat.com/drepper/selinux-mem.html.

These show up in /var/log/messages (or /var/log/audit/audit.log if using the audit daemon) as avc denials. These can also show up when running programs with errors like

error while loading shared libraries: /usr/lib/libavutil.so.49:
cannot restore segment prot after reloc: Permission denied

which indicates that the library is trying to perform a text relocation and failing. Text relocations are bad, but can be allowed via the first hint below. Below are the SELinux memory permissions that are denied, as well as hints at how to address these denials.

execmod

This is usually based on a library label. You can permanently change the context on the library with the following commands

# /usr/sbin/semanage fcontext -a -t textrel_shlib_t '/usr/lib/libavutil.so.49.0.0'
# /sbin/restorecon -v /usr/lib/libavutil.so.49.0.0

with the particular library at fault in place of /usr/lib/libavutil.so.49.0.0. Now your application should be able to run. Please report this as a bugzilla.
execstack

Attempt to execstack -c LIBRARY. Now try your application again. If the application now works, the library was mistakenly marked as requiring execstack. Please report this as a bugzilla.
execmem, execheap

A boolean for each one of these memory check errors have been provided. So if you need to run an application requiring either of these permissions, you can set the boolean allow_exec* to fix the problem. For instance if you try to run an application and you get an AVC message containing an execstack failure. You can set the boolean with

setsebool -P allow_execstack=1

Sunday, August 20, 2006

Wireless on a nx6125

My work laptop is an HP nx6125 and it comes with a Broadcom wireless adapter. To make it run on windows I used ndiswrapper and worked fine. I went to HP support page and dowload the window drives. There I took the file bcmwl5a.ini (bcmwl5.ini doesn't work) and bcmwl5.sys and copied on the ndiswrapper directory.

Check this site for details:

http://ndiswrapper.sourceforge.net/mediawiki/index.php/Installation
http://ndiswrapper.sourceforge.net/mediawiki/index.php/Fedora

After ndiswrapper installation the process is as follows:

ndiswrapper -i
ndiswrapper -l
ndiswrapper -m
modprobe ndiswrapper

ifconfig eth0 down
ifconfig eth1 up (In fedora wlan is eth1)
iwconfig eth1 key
iwconfig eth1 essid
dhclient eth1
ifconfig to check the system

At this time you will see eth1 on the Network Manager of Fedora.

Serial Connection

My asterisk box (no monitor or keyboard) will need serial connection "just in case the network" goes down. I have another box next to it and connected through the serial. To allow this we need to change the inittab file as by default the serial connection is usually disabled.

As root vi /etc/inittab:
rbold:/etc# vi inittab
Check the file and you will find something like this:
# Example how to put a getty on a serial line (for a terminal)
T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

In my case I remove the coment from the fist line and it worked. I've seen on the web examples with s0 instead of T0, it makes more sense but maybe it is a Debian thing.

The options for this file are:
  • -L force line to be local line with no need for carrier detect (when you have no modem).
  • 9600 serial line rate in bps. Set this to your dumb terminal or terminal emulator line rate.
  • ttyS0 this is the serial port identifier.
  • vt100 is the terminal emulation.
Check the web for more otpions

Update

I got lost for 2 months. I was resolved to start on this and now is time. Since I started this a few things have happened:
  • Change job (well kind of - different company but same desk).
  • Change city, I left city move to a little boring - great to just read and learn - town.
  • Bought a Nikon D50
  • Installed FC5 on my laptop as base work OS (still have a pc with WXP for some win32 stuff).
  • Installed a Debian 3.1r2 - Unstable- pc to run Asterisk on it. Installation TODAY!
  • Got an iMac as secondary work pc.
Well lets see how this goes.

Saturday, May 13, 2006

A new begining

Ok, this blog is a personal sponsor. I am a techie, but not the techie I would like to be. I've been working on IT for the past 5 years. Have I modified commercial (small businness or system gateways) software applications (php, c++, visual basic, .net, java, javascript, shell scripts, perl, vxml an I believe another couple more) on my work? YES I HAVE. Do I consider myself a programmer? NO.

I can read simple code, understand it and change to achieve what I need. But I can't start from scratch, I never was asked to and I am kind of lazy (therefore this page will be my sponsor). I have tried to learn proper software development hundreds of time and I have to say that if I had a response for every "Hello World" that I have done I would still be greeting people.

I love IT, I love when I am a faced a problem and solve it but after work (and I work long hours as I like to see things well done and on my terms so usually take upon other people work) I go back home and just relax watching tv, reading a book and try to stay out of the pc.

My interests are Linux, Java, software development, Asterisk PBX, vxml, voip, databases. I will try to start with linux, java and asterisk and see where they meet - I know you will say from that I can linked them from the begining - but will try to understand each of them and then integrate the others.

How many times I have installed Linux? Lost count, I have installed slackware, red hat, fedora, debian, gentoo, ubuntu several times. After the install I get bored and go back to watch tv (my work laptop has windoze and slackware but don't ask when was the last time I boot lilo on slack).

How many times I have install the java tools ... the same.

How many times I have installed asterisk.... 4/5. I even hosted 4 extensions to talk with friends around the world and we used it ..... for a week until we got bored and switch to normal software.

So this is my new beginning, I will be posting what I do and I will help me see how lazy I am. And force the shame to take me out of bed, couch, dreams and keep working and learn new things.

For info.. what I do? I am a pbx/cti/ivr/pds administrator.

By the way, this is my first blog or thing in the net, I just went to google put blog on the search box and opened the first link. I see that this things has an "Edit Comments" option so therefore I assume people would be able to add comments. So fell free to add anything you like....

Finally although this is going to be mostly focus on techie things I will try to post normal things...

good luck