What a difference compiling makes vs prepackaged!

10 11 2008

Okay so I just finished installing FreeBSD 7.0 on this machine:

AMD Athlon X2 6000+ overclocked to 3.2GHz, 2GB DDR2800, 250gb Seagate Barracuda SATAII, nvidia 8500GT (using nvidia-driver)

This machine has had Ubuntu 32bit, Ubuntu 64bit, Slackware 12.1, Slamd64, Debian 4.0r4 i386, PC-BSD 7.0 Fibonacci.  Now I knew that natively-compiled binaries are faster and usually more reliable – but when I decided to “build the world” with FreeBSD 7.0 I was in for a shock from the difference in speed using this system as a desktop environment.  KDE and especially gnome are surprisingly faster.  Browsing with Firefox 3.0.3 is very snappy and everything just immediately responds.

I think I’m going to stick with this OS for a while.  It took about 3 days for the entire project – but most of it was compile time.  I probably spent 3 hours at the console doing the installation.





Intel follows behind AMD in design, once again

3 11 2008

Okay, so here’s the review here:
http://hothardware.com/Articles/Intel-Core-i7-Processors-Nehalem-and-X58-Have-Arrived/

Once again Intel follows behind – giving more creedence to the statement “AMD works smarter, Intel works harder”. If you check out this article, it goes on and on about “advances” in the microarchitecture for the i7 processors.

Feature #1
Monolithic Quad-Core
AMD had this nailed already on their Phenom line. True monolithic quad-core design. All of the previous Intel quads were basically just two dual-cores slapped together.

Feature #2
Integrated Memory Controller
Ummm… AMD has had this since who knows when. AMD has always been superior in memory interface speeds and peripheral interface speeds.

Feature #3
Quick Path Interconnect
Basically now that they’ve done it right the inter-core and memory connects are faster. Or, to put it differently “Oooh – now that we’re doing what AMD does it’s faster!”

What’s actually cool about this thing that would warrant spending (most likely) $1000 on a CPU? They’ve used a 45nm process, which means it runs cooler and more efficient. And… drumroll… they’ve brought back HyperThreading. So now, you can have:

1. 4 really fast CPUs with HyperThreading disabled.
2. 8 really slow virtual CPUs with HyperThreading enabled.

I think I’ll save the $$.





My old sig.

3 11 2008

Links from my old email sig – more of my rampant Linux militism.

What’s wrong with Windows Vista?
http://badvista.fsf.org/what-s-wrong-with-microsoft-windows-vista

Download Ubuntu today, completely free.  An easy alternative to
Windows based on Linux
http://www.ubuntu.com

The fastest computers are Linux computers
http://practical-tech.com/infrastructure/the-fastest-computers-are-linux-computers/

Who writes Linux and who supports it?
http://linux-foundation.org/weblogs/press/2008/03/31/linux-foundation-publishes-study-on-linux-development-statistics-who-writes-linux-and-who-supports-it/

Hybrid machine breaks petaflop barrier using Cell chip and running Linux
http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=9095318

Where Windows is #2 to Linux
http://blogs.computerworld.com/where_windows_is_2_to_linux

Windows can’t even get into the game
http://uptime.netcraft.com/up/today/requested.html





Setting up an Asterisk PBX on Ubuntu 8.04 Server

3 11 2008

So I recently have had the opportunity to set up another PBX running asterisk – and some things have changed since the last time I’ve set one up.  I’ve successfully got the system online and running, and I thought I’d post the steps to get one of these puppys built from scratch.  First I’d like to mention that I highly recommend that you NOT use a canned asterisk solution such as trixbox or asteriskNOW – as those are based on CentOS and CentOS/RHEL have really crappy driver support.  I went with a fresh minimal Ubuntu install (should also work with Debian Etch), compiled the packages from scratch (no apt asterisk / zaptel packages), and it worked great.  Note that this will also run the FreePBX gui for management.  Many thanks to undertoe for his guide – a lot of this is based on his guide and cleaned up a bit.

So you’ve got your Ubuntu minimal up and running.  Here we go:

$ sudo su            
(work as superuser for this session – this is generally considered a bad practice, but I’m lazy)

$ apt-get install cvs build-essential automake autoconf bison flex libtool libncurses5-dev libssl-dev php5 php5-cli php5-curl php5-gd php5-mysql mysql-server php-pear php-db curl sox apache2 subversion libssl-dev libmysqlclient15-dev            
(this will install the needed packages for php/apache/etc.  make sure you note the root password that you set for MYSQL, it will ask you during the install)

$ uname -a        
(this will give you your kernel version – note it for the next step)

$ apt-get install linux-headers-2.6.24-19-server      
(2.6.24-19-server comes from the uname-a output)

$ ln -s /usr/src/linux-headers-2.6.8.1-5-686-smp /usr/src/linux-2.6    
(link the headers)

$ cd /usr/src/
$ wget http://downloads.digium.com/pub/zaptel/zaptel-1.4-current.tar.gz
$ tar -zxvf zaptel-1.4-current.tar.gz
$ cd zaptel-1.4.12.1
$ ./configure
$ make clean
$ make
$ make install
$ make config                   
(download the zaptel driver, compile, install, configure)

$ /etc/init.d/zaptel start
$ update-rc.d zaptel defaults 20 80      
(start up zaptel and update rc.d)

To check to see if zaptel is running do a cat /proc/zaptel/*  –  you should see an output like this:

Span 1: WCTDM/0 “Wildcard TDM410P Board 1″
IRQ misses: 0

1 WCTDM/0/0 FXSKS (In use)
2 WCTDM/0/1 FXSKS (In use)
3 WCTDM/0/2 FXSKS (In use)
4 WCTDM/0/3 FXSKS (In use)

$ groupadd asterisk
$ useradd -c “asterisk PBX” -d /var/lib/asterisk -g asterisk asterisk
$ mkdir /var/run/asterisk
$ chown asterisk:asterisk /var/run/asterisk/
$ cd /usr/src/
$ wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.22.tar.gz
$ tar -zxvf asterisk-1.4.22.tar.gz
$ cd asterisk-1.4.22
$ make clean
$ ./configure
$ make
$ make install
$ make samples            
(configure directories, permissions, download asterisk source, compile and install)

$ cd ..
$ wget http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4.7.tar.gz
$ tar -zxvf asterisk-addons-1.4.7.tar.gz
$ asterisk-addons-1.4.7
$ perl -p -i.bak -e ’s/CFLAGS.*D_GNU_SOURCE/CFLAGS+=-D_GNU_SOURCE\nCFLAGS+=-DMYSQL_LOGUNIQUEID/’ Makefile        
$ ./configure
$ make clean
$ make
$ make install            
(download, compile, and install asterisk addons)

$ cd ..
$ mkdir asterisk-sounds
$ asterisk-sounds
$ wget http://downloads.digium.com/pub/telephony/sounds/asterisk-core-sounds-en-wav-current.tar.gz
$ wget http://downloads.digium.com/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz
$ wget http://downloads.digium.com/pub/telephony/sounds/asterisk-moh-freeplay-wav.tar.gz
$ tar -zxvf asterisk-core-sounds-en-wav-current.tar.gz
$ tar -zxvf asterisk-extra-sounds-en-wav-current.tar.gz
$ tar -zxvf asterisk-moh-freeplay-wav.tar.gz
$ cp -rf * /var/lib/asterisk/sounds/
$ ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3       
(download sound packages, extract, copy them to the asterisk sounds directory, and create a symlink for FreePBX music on hold)

$ chown asterisk:asterisk /etc/asterisk -R
$ chown asterisk:asterisk /var/lib/asterisk -R
$ chown asterisk:asterisk /var/log/asterisk -R
$ chown asterisk:asterisk /var/spool/asterisk/ -R   
(set permissions for asterisk)

$ nano /etc/asterisk/asterisk.conf   
(open asterisk.conf for editing)

Look for “astrundir” and change to /var/run/asterisk   Save and quit when done.

$ cd /usr/src/
$ wget http://mirror.freepbx.org/freepbx-2.5.0.tar.gz
$ tar -zxvf freepbx-2.5.0.tar.gz
$ cd freepbx-2.5.0
$ mysql_install_db
$ mysqladmin u root password ‘<your MYSQL root password>’
$ mysqladmin create asteriskcdrdb -p
$ mysqladmin create asterisk -p
$ mysql –user=root –password=<your MYSQL root password> asterisk < ./SQL/newinstall.sql
$ mysql –user=root –password=<your MYSQL root password> asteriskcdrdb < ./SQL/cdr_mysql_table.sql
(Download FreePBX, and set up the MYSQL databases asterisk and asteriskcdrdb)

$ mysql –user root -p
$ GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY ‘amp109′;
<enter>
$ GRANT ALL PRIVILEGES ON  asterisk.* TO asteriskuser@localhost IDENTIFIED BY ‘amp109′;
<enter>
$ quit
<enter>
(Set up appropriate MYSQL privileges)

$ nano /etc/apache/envvars
change  “export APACHE_RUN_USER=www-data & export APACHE_RUN_GROUP=www-data”
to  “export APACHE_RUN_USER=asterisk & export APACHE_RUN_GROUP=asterisk”

$ nano /etc/apache2/sites-enabled/000-default
change  “AllowOveride None” to  “AllowOverid All” under both /var/www  and  /var/www/
(Sets up apache for FreePBX)

$ nano /etc/php5/apache2/php.ini
change: upload_max_filesize to upload_max_filesize = 20M

$ nano /etc/php5/cli/php.ini
change: upload_max_filesize to upload_max_filesize = 20M

Set permissions on /var/lib/php5
$ chown asterisk:asterisk /var/lib/php5 -R

Set permissions on /var/www
$ chown asterisk:asterisk /var/www -R

Restart Apache
$ /etc/init.d/apache2 restart

Test by entering http://<pbx-ip-addresss>/ in a browser – you should get “It Works!” or a similar message letting you know apache is working.

$ cd /usr/src/freepbx-2.5.0
$ sudo ln -sf /bin/bash /bin/sh
$ sudo
./start_asterisk start
$ sudo ./install_amp
Accept the default on all questions except for:
Enter the path to use for your AMP web root: /var/www
IP address: <pbx-ip-addresss>

(Install FreePBX and start it up)

Now point your browser to http://<server-ip-addresss>/admin/ and click on the orange reload config banner at the top of the page.  Yay!  You should now have a working asterisk/FreePBX box.

To have it load on boot:

$ nano /etc/init.d/asterisk

Paste the following:

—————————————————————————-

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

DESC="Asterisk"
NAME=amportal
DAEMON=/usr/local/sbin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

test -x $DAEMON || exit 0

d_start() {

amportal start

}

d_stop() {

amportal stop

}

d_reload() {

amportal restart

}

case "$1" in

start)

echo -n "Starting $DESC: $NAME"
d_start
echo "."
;;

stop)

echo -n "Stopping $DESC: $NAME"
d_stop
echo "."
;;

restart|force-reload)

echo -n "Restarting $DESC: $NAME"
d_stop
sleep 10
d_start
echo "."
;;

*)

echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 3
;;

esac

exit 0

—————————————————————————-
Save the file and run:

$ chmod 755 /etc/init.d/asterisk

$ update-rc.d asterisk defaults 90 10