Tuesday, July 10, 2007

Book: Hardvard Business Review on Innovation

This is basically a compilation of articles that appeared on the HBR magazine. The articles present on this book are:

* Creating New Market Space
* Creating Breakthroughs at 3M
* Building an Innovation Factory
* Knowing a Winning Business Ida When You see One
* Meeting the Challenge of Disruptive Change
* Discovering New Points of Differentiation
* From Spare Change to Real Change: The Social Sector as Beta Site for Business Innovation
* Enlightened Experimentation: The New Imperative for Innovation


What did I learn from it? Consciously not much, the book started very well but it became boring or not that enlightening at the end so it took me much more time to finish it than expected (as falling sleep while reading a single page).

But what it left me with 2 mayor notes, the way to innovation is breaking models and managers solve but innovator leads (or similar). I am sure that if one day I do the change from my low technically emotional job working under and with completely useless people in my opinion, I will read it again quickly to remember the tips it gives on how to think.

Also the fact that they sell a book at almost 20U$D made of articles from a magazine that they already sold (physically, on the web, subscription, pamphlets, umbrellas, etc) gives a little of faith on the innovation of this guys.

So do I recommend it? Yes but as quick read.

Wednesday, July 04, 2007

Book: Stories of Your Life and Others


Stories of Your life and Others by Ted Chiang might be the second science fiction book I read in the last two years and I recommend it to everyone. The previous one was "The Hitchhiker's Guide to the Galaxy" but I liked Chiang's writing better.

I might be doing a comparison of rocks and apples here but the different writing stiles of each history make it great. I was impressed with one of them about a man whose intelligence gets increase on where the writing makes your heart beat accelerate and takes you to a journey were you can feel how the main character is feeling things.

All stories were great and unique making you think, dream and look back. Again a book recommended to all. By the way you have no idea how much it took me to upload the image of the cover of the book (copyright to the owner, publicist, etc, etc), kind of spooky maybe the fiction is should not be before the science.

Read, explore, open new windows and get lost as much as possible!

(As always all images, etc are copyright by the owner and this never happened)

Tuesday, June 26, 2007

Boring notes of day to day Linux

These are just some notes from my last asterisk installation (done on may 15th but notes lost between all the desktop files) and they are here because man is the only animal that stumbles on the same rock and even worst I am far away to grew up.

a) Usefull installations for debian:

apt-get install mc bzip2 zip unzip ngrep iproute less

b) Some detatails on debian networking:

Networking:

rbast:/etc/network# pwd
/etc/network
rbast:/etc/network# more interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
rbast:/etc/network#


Could be changed to:
This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 10.0.2.51
netmask 255.255.255.0
gateway 10.0.2.254


c) how to open bz2 files (I always forget!!!)

tar -xjvf asterisk_settings.tar.bz2

d) I got an autoconf error

autonf error: solved by installing atuconf (apt-get) and running make config.

232 make
233 make config
234 make install
235 history


e) I got a cc1plus error

Asterisk installation: Got an error related to cc1plus while doing the .configuration. I apt-geted the packaged and worked.

apt-get install build-essential


f) Finally booting Asterisk at start time:

147 cd /etc/init.d/
148 cp /usr/src/asterisk-1.4.4/contrib/init.d/rc.debian.asterisk ./asterisk
149 ls
150 update-rc.d asterisk defaults

It should display the following output:

rbast:/etc/init.d# update-rc.d asterisk defaults
Adding system startup for /etc/init.d/asterisk ...
/etc/rc0.d/K20asterisk -> ../init.d/asterisk
/etc/rc1.d/K20asterisk -> ../init.d/asterisk
/etc/rc6.d/K20asterisk -> ../init.d/asterisk
/etc/rc2.d/S20asterisk -> ../init.d/asterisk
/etc/rc3.d/S20asterisk -> ../init.d/asterisk
/etc/rc4.d/S20asterisk -> ../init.d/asterisk
/etc/rc5.d/S20asterisk -> ../init.d/asterisk
rbast:/etc/init.d# history

Monday, June 25, 2007

Must have applications for your Windows PC

Below is a list of applications that do my work and windows experience more easy. They are not sorted in any particular order and note that they are all light applications, no hundreds of MB involved.

Total commander - http://www.ghisler.com/
A clon of the famous Norton commander used long time ago (yes I am that old and also you can have mc on your Linux) that you can use to manage your files, ftp, connect to other boxes, etc. Visit the website and go back in time where things were simpler.


Cerberus - http://www.cerberusftp.com/
An FTP server easy and quickly to run on you pc.

Snagit - http://www.techsmith.com/screen-capture.asp
A must have if you have to send documents with manuals or showing users what to do. Easily capture your screen, edit it, modified it, copy it and just send it or paste it or save it in whichever format you want.

Textpad - http://www.textpad.com/
A text editor to replace the old notepad on which you cannot do much. If you deal with logs and simple files and want to do searchs, compares, replaces, etc. this is the tool for you (other textedit or vim for windows but I always go back to Textepad).

Putty - http://www.chiark.greenend.org.uk/~sgtatham/putty/
Not sure if this is the right site where to download it but Google for it. A great and complete telnet and ssh and others. Very useful to replace the windows telnet.

Videolan - http://www.videolan.org/
This is to reproduce video files of all types (almost) very easy to use with some extra features as to stream your movie to your friends if they are on the same network.

Synergy - http://synergy2.sourceforge.net/
If you have 2 pcs or more you can just use 1 keyboard and mouse to control both systems. I have my desktop and my laptop in the office and I use my normal keyboard for both, it shares memory so copy paste can be copy and no more having several mouse laying around not knowing which one to use and occupying all your desktop space.

Foxit pdf reader - http://www.foxitsoftware.com/pdf/rd_intro.php
This is not a must but aren't you tired of downloading 70MB to read a 30K pdf!!. This is a PDF reader free to use, there is a pay option for a writer but I don't need it yet. One day Adobe would need to launch a light version of their app that consumes less memory also.

Other applications I sue are the CoolEdit, RealVNC (or any vnc clon), WinSPC3 and ActivePorts.

Ok that is my list for the time being, I would have to go through my start/programs menu to find out more but if I have to find them then they are not essential.

Good luck!!

Sunday, June 24, 2007

Benjamin Franklin's Thirteen Virtues

One of the things I would like to take from Benjamin Franklin are the virtudes that he tried to follow. I have a lot of work to do on most of them, but it simpler now that I have identify them.

1. TEMPERANCE. Eat not to dullness; drink not to elevation.
2.
SILENCE. Speak not but what may benefit others or yourself; avoid trifling conversation.
3.
ORDER. Let all your things have their places; let each part of your business have its time.
4.
RESOLUTION. Resolve to perform what you ought; perform without fail what you resolve.
5.
FRUGALITY. Make no expense but to do good to others or yourself; i.e., waste nothing.
6.
INDUSTRY. Lose no time; be always employ'd in something useful; cut off all unnecessary actions.
7.
SINCERITY. Use no hurtful deceit; think innocently and justly, and, if you speak, speak accordingly.
8.
JUSTICE. Wrong none by doing injuries, or omitting the benefits that are your duty.
9.
MODERATION. Avoid extreams; forbear resenting injuries so much as you think they deserve.
10.
CLEANLINESS. Tolerate no uncleanliness in body, cloaths, or habitation.
11.
TRANQUILLITY. Be not disturbed at trifles, or at accidents common or unavoidable.
12.
CHASTITY. Rarely use venery but for health or offspring, never to dulness, weakness, or the injury of your own or another's peace or reputation.
13.
HUMILITY. Imitate Jesus and Socrates.


(is there something wrong that I liked the virtudes of somebody who lived +200 years ago when slavery was still in practice?... also if you think about it, the world lives by 10 rules that were given to us +2000 and other +6000 and even longer)

Book - Benjamin Franklin An American Life


I read Walter Isaacson book about Benjamin Franklin - note I am not american and english is not my first language! - and I have to say that I like it.

I am not a writer, critic and I am consider myself a normal human being with my own mind. I think the book was more about Benjamin Franklin on the american revolution (then the "An American Life" of the title makes sense) that a biography of this really interesting man. You can argue that this life was america and I agree on that. Everybody has the right to his own opinion right?

I recommend this book to everybody and one can lear a lot from it (or at least a few things depending on how commited and inteligent you are, in my case.. I just learned a little). As said the book focused more on Franklin's part on the American Independence, how from a loyal royalist became a patriot and help the US to get it idependence. (In my opinion a change more induced by the "practicallity of it" that the book mentioned he always focus on rather on actually believing it).

You can also learn about his family and scientific work, how he thought, worked and specially wrote. It is amazing how good (always in a practical way) he was writting and how much he wrote, ok no every idiot (: has his own blog but for back then this man really knew how to express ideas, how to influence people and how to tell the truth.

I didn't like how John Adams, Thomas Jefferson and Washington were portrayed (does that word exists?) and I didn't share Franklin's view about family.

In general I admire the guy, would buy him a beer as the book say but would not spend my christmas with him as I like to be with my family.

Funny thing at the same time I read this book I saw the movie called the "Shooter" (ok a blockbuster type of movie full of explosions with a die hard type of hero) and on it near the end the poor underdog hero confronts a US "sitting" senator about his actions and this says: "There are no sides.... there are republican and democrats there are haves and haves not... This is a country where a secretary of defense can go on tv and tell the american public that this is about freedom is not about oil" so ok, this is a movie but how far is from the true?

Again read this book or any other biography of Franklin, after this I am looking forward to read about Washington and Edison.

Testing Google Docs!

This is a test of google docs direct posting to blogger. It is an nice alternative to the blogpost post manager and google is full of utils to make your net experience more control by them!


So at this moment I am using.



Blogspot... where I publish (not very often) what I do (that means I need to do more).
Must have? Not really, you can use other servers.



Docs. Will become a must very shortly. Word and Excel like formats available on the web? No more loosing files due hard disk failures? No more forgetting the file at home? Sharing it with a team? Great features, a little concern about security (you would not put your company salary here yet) and would like to see a feature like automatic archive (imagine go back to all previous version of the same file).



Picasa. Having see how useful this is. Now you can have a blog and a flog?. I used to have Flirck (just testing on one of my first posts) but was limited on the amount of files per month or size. Let's see if this gives me the freedon (and remains FREE) to upload more files to share with family and friends.


Talk. Ok another hotmail messenger, yahoo messenger, icq, skype client kind of thing and I get lost between them. (I am using skype to test vxml, google talk never, hotmail messenger friends, yahoo meseenger work, icq I lost my account long time ago).
Must have? Not really Keep using your old clients and skype if you want to talk on voip



Calendar. A nice calendar to have on the web, maybe it can be connected to Orkut.
Must have? Yes if you want to get out of outlook calendar. Yahoo has another one but don't use it so much.



Desktop. This is a client install for search on my hd and add some gadgets (calendar) on my desktop (that looks a lot as Windows Vista gadgets.. the previous version had a white background).
Must have? Yes. Looking for files or emails is easier and faster.


Toolbar. Nice to have, just add features to your IE or Firefox.



Gmail. Once you create an account you can activate everything so not used atm but nice. Note that people used to pay for having one of the invitations to gmail when it was still on beta. The 1GB (or more) that provides is great but how many accounts does a person really needs. I wish they could all have pop3 like in the old days.


And that is not all, if you go to the google homepage and choose "more" (on the search bar) you have more things to install. I use a lot maps and images and remember that now google have youtube database of vidoes.

Wednesday, February 28, 2007

Little Java program

My first little java program... after a few tries with the Hello World and reading a book I did my beeting game. It is not a great thing but I need to get used to break problems in parts - the example below doesn't do 100% that.

I need to be able to break each action as much as possible, at the begining I thought it was going to be easy but for this simple example I kept falling into creating one big procedural class. I should be able to break it even more and caught more exception (like entering chars/strings instead of numbers) and will do it after I finish the second book of begining java.

import java.text.NumberFormat;

public class Account {

static int balance;

public Account (int amount) {
balance = amount;
}

public Account () {
balance = 0;
}

public void credit (int betamount){
balance = balance + (2 * betamount);
}

public vo
id debit (int betamount){
balance = balance - betamount;
}

public boolean checkBet (int betamount){
if (betamount > balance) {
return false;
} else {
return true;
}
}


public void showbalance (){
NumberFormat nf = NumberFormat.getCurrencyInstance();
System.out.println("Available balance is : " + nf.format(balance));
}
}


Main class

import java.util.Random;
import java.util.Scanner;

public class BettingGame {

static Random myRandom = new Random();
static Scanner myScanner = new Scanner(System.in);

publi
c static void main(String[] args) {

Account myAccount = new Account(1000);
int available;
myAccount.showbalance();
boolean keepgoiang = true;

do {

System.out.println ("How much will you bet? ");
if (!myScanner.hasNextInt()){
myScanner.next();
continue;
}
int bet = myScanner.nextInt();
if (bet == 0) {
break;
}
if
(myAccount.checkBet(bet)){

do {
System.out.println ("Which number do you chose");
if (myScanner.hasNextInt()){
break;
}
}while (!myScanner.hasNextInt());
int number = myScanner.nextInt();
int ra
nnum = RandomGenerator(0,10);
System.out.println("Lucky number is: " + rannum);
if (number == rannum){
System.out.print("You win. ");
myAccount.credit(bet);
} else {
System.out.print("Better Luck next time. ");
myAccount.debit(bet);
}


} else {
System.out.println ("Not enough founds for that bet");
}
myAccount.showbalance();
if (Account.balance == 0) {
keepgoing = false;
}

}while (keepgoing);

if (myAccount.balance > 0 ) {
System.out.println("Great you quit with money on your pocket");
myAccount.showbalance();
} else {
System.out.println("You are fucked!");
myAccount.showbalance();
}


}

public static int RandomGenerator (int min, int max){
int RamNumber = myRandom.nextInt(10) + 1;
return RamNumber;
}


}


An image of the output on the console:

Monday, February 12, 2007

Fedora Eclipse 3.2.0 and jdk-1_5_0

I am leraning Java (trying to at least) and during the installation I was very pleased to see the Eclipse package under the options but the version installed uses jre-1.4.2-gcj. That is the java runtime engine from the gnu project. It is a great effort but to someone who is reading books about java and the Sun version you get to cases where particular clases/packages (I still don't get hold of the names) are not available. Therefore I installed the Sun JDK.

As always after googling a little I found a great how-to and here are my notes. The link to the original post is at the botton of this post.

First download a jdk/jre from Sun. At the moment of writing this version 6 was available. At work I using a tool to create vxml code with eclipse that recommends 1.4.2 so I choose 1.5 (just in the middle).

I downloaded jdk-1_5_0_11-linux-i586.bin. There is a rpm but every site I checked recommends not getting closed to the sun rpm and all prefers to just run the binary.

Once downloaed copy it to /opt directory and give it rights to be executed. The easiest way is chmod +x filename.

Next cd to /opt and just run the binnary.

./jdk-1_5_0_11-linux-i586.bin


This will install everything under the current directory. In my case I ended with /opt/jdk1.5.0_11

Note that the JDK installed Sun JRE so you might want to use this jre instead that the gnu one when browsing the web. So to do this you just create a link on the mozilla

ln -s /opt/jdk1.5.0_11/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so

If you use firefox don't worry as firefox checks the mozilla plugins.

Now we start with the tricky part. You need to create a file java.sh to include the new paths, in my case I created the following:

[ricardo@mybox]$ more /etc/profile.d/java.sh
export J2RE_HOME=/opt/jdk1.5.0_11/jre
export PATH=$J2RE_HOME/bin:$PATH
[ricardo@mybox]

Once you have this file execute it by typing:

source /etc/profile.d/java.sh

This wll set your new java paths. To check it run the command below:

[ricardo@mybox]$ which java
/opt/jdk1.5.0_11/jre/bin/java
[ricardo@mybox]$


Next step is to run the following command to be able to later change the from gnu java to sun java.

/usr/sbin/alternatives --install /usr/bin/java java /opt/jdk1.5.0_11/jre/bin/java 2

Then type

/usr/sbin/alternatives --config java

This will show you something like this:

[ricardo@mybox]$ /usr/sbin/alternatives --config java

There are 2 programs which provide 'java'.

Selection Command
-----------------------------------------------
* 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
+ 2 /opt/jdk1.5.0_11/jre/bin/java

Enter to keep the current selection[+], or type selection number:


In the case above the + sign was on option 1. I selected 2 so it changed to the new version I installed.

Final step is to run the command below and get a similar entry as mine.

[ricardo@mybox]$ /usr/sbin/alternatives --display java
java - status is manual.
link currently points to /opt/jdk1.5.0_11/jre/bin/java
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1420
slave keytool: /usr/lib/jvm/jre-1.4.2-gcj/bin/keytool
slave rmiregistry: /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
slave jre_exports: /usr/lib/jvm-exports/jre-1.4.2-gcj
slave jre: /usr/lib/jvm/jre-1.4.2-gcj
/opt/jdk1.5.0_11/jre/bin/java - priority 2
slave keytool: (null)
slave rmiregistry: (null)
slave jre_exports: (null)
slave jre: (null)
Current `best' version is /usr/lib/jvm/jre-1.4.2-gcj/bin/java.


Now Eclipse. Eclipse keep using the old runtime everytime you create a new project.

To solve this when you create a project go to the JRE section and click on "Configure JREs" as shown on the image below.


Then on the following screen you click on add and complete the form with the details shown below (note that the libraries section will be auto completed once you selcted the home directory).


The final step is to check the new JRE and every new project will be using the Sun engine.



That is all, Good luck!


Much more information on the link below:
http://stanton-finley.net/fedora_core_5_installation_notes.html#Java

Sunday, February 11, 2007

Install Fedora Core 6 on a Dell Latitude D620

I got a new laptop at work (the hp nx6125 decided to give up on me) and as every time I have a new pc/laptop I will try to run linux on it until -as always- remember that I am a windows sofa lazy user and go back to it. Therefore until my concious realizes that I am trying to learn something here are the notes on what I did. (note if you want notes on how to install windows just click next during installation until death knocks on your door).

I use two flavours of Linux.. Fedora for personal use and Debian for Servers.. Why? No idea.

Note that his are my notes.. the urls where I got all this from are below. This notes are for me to avoid googling again for this in the future.

*****Installation
Downloaded the hp dvd image and booted from the DVD and just hit enter. I found later notes of people recommending the following boot options:

linux i686
--- Check http://fedoraproject.org/wiki/Bugs/FC6Common. Seems that some early versions installed the wrong architecture kernel version (in the document i586 instead of i686).

linux resolution=1440×900
--- For some reason some use this kind of resolution. I haven't tried it yet but not sure if this is for the nvidia or intel board.

The installation is straight forward and I surf around the packages and selected the ones I wanted. Note that after the installation Fedora will try to update all your applications, if you select Extras as package sources this update process will take a bit longer so have a good book or movie ready while your system goes to the net and updates everything (including kernel).

The hardware on my pc is:

[root@box loginname]$ /sbin/lspci
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS/940GML and 945GT Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 01)
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 01)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) Serial ATA Storage Controller IDE (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
03:01.0 CardBus bridge: O2 Micro, Inc. OZ601/6912/711E0 CardBus/SmartCardBus Controller (rev 40)
09:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5752 Gigabit Ethernet PCI Express (rev 02)
0c:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)

From here the only things that I had to work around were:
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)
0c:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)

I will add the details for this below on the document.

*****Sudo

Sudo helps normal accounts to run application as root without being root. To add the normal user account as root run the command visudo and enter the following line.

loginname ALL=(ALL) ALL

The sudo configuration is pretty easy and straight forward. You can also create different groups to give access to diferent things like files or applications. In the above case would have access to everything and it will need to type it's own password everytime that sudos a command.

*****Yum

Yum is the apt-get of Fedora and the life saver of the novice that would take care of dependencies and file location when isntalling/updating/removing new software. I remember on '96 or '97 playing with Slackware (influenced by Antonio Ex@@@) and FreeBSD (influenced by Juan Carlos Ne@@@@@) and untaring files and running the make, make config, make install to find out that a file somewhere was not present or your gcc was not the correct one, etc. And yes if you do the manth that was more than 10 years ago and still don't know shit. One day If I get rich and don't need to work anymore I will spend time to learn Slackware (imho the best way to learn what happens under the hood).

I added freshrpm to the repository

[root@box loginname]cd /etc/yum.repos.d/
[root@box loginname]# more freshrpms.repo
[freeshrpms]
name=FreshRPMs for Fedora Core $releasever - $basearch
baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms
enabled=1
gpgcheck=1
gpgkey=http://freshrpms.net/RPM-GPG-KEY-freshrpms


*****Fedora Kernel Headers

We will need the kernel headers at some point (wireless) and always a pain in the ass but I follow this steps found on the web and it worked.

Note this is a 99% copy of a page I found with my notes around. The original link is below (sorry for this guys!).

First move to:
cd /usr/src/redhat/

We need to download the kernel SRPM package, whose version and release match our currently running kernel. This version is shown by the following command:

# uname -r
2.6.19-1.2895.fc6


I use the following link wget http://download.fedora.redhat.com/pub/fedora/linux/core/updates/6/SRPMS/kernel-2.6.19-1.2895.fc6.src.rpm

Next thing is to install the SRPM package. This just extracts the included files in the proper directories under /usr/src/redhat/ or to the directory tree you use for building. It does not actually install any kernels. As a user, run:.
# rpm -ivh kernel-$(uname -r).src.rpm

This extracts the kernel source packages and the various patches in the SOURCES directory and the spec file in the SPECS directory. The SRC RPM file is not needed any more.

Next, we execute the %prep stage of the spec file, by issuing the following command:

# rpmbuild -bp --target $(arch) --rmsource --rmspec SPECS/kernel-2.6.spec

This extracts the kernel source code package and applies all the Red Hat patches. All the files are placed in the BUILD directory. Here follows an explanation of the options:
-bp : Execute only the %prep stage
–target : Specify the architecture. You can explicitly put your architecture, instead of the $(arch) in this option. This is the same thing.
–rmsource : This removes all the kernel SRC RPM related files under the SOURCES directory, so no unneeded files are left to the system.
–rmspec : This also removes the spec file from the SPECS directory.

Now, we move to the directory containing the fedora kernel sources:

# cd /usr/src/redhat/BUILD/kernel-2.6.19/linux-2.6.19.i686

Copy the proper kernel configuration file, that matches your architecture, from the configs directory and place it in our current working directory, naming it as .config and replacing the already existent .config file. For example, I used the kernel-2.6.14-i686.config file :

# cp configs/kernel-2.6.19-i586.config .config

These files most probably contain the same configuration options, but we do this for completeness.

Next thing is to add the proper kernel release number to the Makefile (in directory: BUILD/kernel-2.6.19/linux-2.6.19.i686/). As it is stated in the Fedora release notes, in order to "protect the innocent" the value of the EXTRAVERSION field is -prep. Open this Makefile in a text editor and replace the -prep with the release number of your currently running kernel. For example, my running kernel at the time of writing is 2.6.14-1.1637_FC4. I replace the:

EXTRAVERSION = -prep

with :
EXTRAVERSION = -1.2895.fc6

Example:
# vi /usr/src/redhat/BUILD/kernel-2.6.19/linux-2.6.19.i686/Makefile
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 19
EXTRAVERSION = -1.2895.fc6
NAME=Avast! A bilge rat!


The last action of the basic configuration is to run the following command:

# make oldconfig

This command sets the default answers to all kernel configuration questions according to the settings of our .config file. This command is more relevant to kernel re-building, but won’t hurt issuing it.

At this point, if you try to compile any third party kernel modules using this directory as the kernel source directory, you will most probably encounter errors. This is because some more preparation should be done to the kernel sources (this mainly involves the include directory).

A full compilation of the kernel would set all these things straight, but one of the goals is to avoid the compilation of the kernel to save some time. We have not modified any of the kernel configuration options or applied any extra patches, so this would be pointless anyway.

I remind that our current directory is:
/usr/src/redhat/BUILD/kernel-2.6.19/linux-2.6.19.i686

A file, named Module.symvers, which contains information about the native kernel modules, needs to be present inside our current directory. This file is normally created after the native kernel modules are compiled. Since we are not building the kernel or any modules and since we have not modified the default kernel configuration, we can use the Module.symvers file, which is included in the official fedora kernel-devel RPM.

The presense of this file is important when we compile any third party modules using these kernel headers. If it’s not there, then our modules will not contain any dependency information, regarding the native kernel modules. This way, if the third party module depends on some native kernel modules, then you will have to load the latter manually.

So, copy the Module.symvers file from the directory, where the official fedora kernel-devel package is installed, into our current directory:

# cp /usr/src/kernels/$(uname -r)-$(arch)/Module.symvers .

Finally, we issue the following command:

# make prepare scripts

This creates:

  1. The include/linux/version.h file, which contains kernel versioning information.
  2. The proper asm symlink for your platform and the asm-offsets.h file inside your platform’s specific asm directory.
  3. The scripts that come with the kernel sources. These are needed when we compile third party modules using these headers.

This is the proper and most complete way of preparing our headers, instead of compiling each of the files mentioned above individually.

That should be the end of all the needed actions in order to accomplish our goal. Final Words: At this point, we have a custom directory that contains:
  • The fedora kernel sources. The kernel has not been compiled.
  • The kernel headers that match those of the kernel-devel RPM package with the difference that they are complete. No files are missing.
The directory /usr/src/redhat/BUILD/kernel-2.6.19/linux-2.6.19.i686 can be moved to any place you like. Give it a proper name that includes your currently running kernel version and release. The kernel headers, contained in this directory, can be used in order to compile any third party kernel modules. The rest of the contents of the /usr/src/redhat/BUILD/ directory, can be deleted, unless you need it.

*****Wireless Intel Corporation PRO/Wireless 3945ABG
My wireless is a Intel. I don't recall exactly what I did as I surf a lot but here is what I remember:

0c:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)

a) Install dkms-ipw3945, ipw3945d and ipw3945-firmware from freshrpms, install the kernel-devel package for your kernel (already done) and reboot.

yum install ipw3945 (not sure)
yum install dkms-ipw3945-1.2.0-1.noarch.rpm
yum install ipw3945-firmware-1.13-1.noarch.rpm
yum install ipw3945d-1.7.22-4.i386.rpm


b) Add the NetworkManager to Gnome so I can geet a fancy icon to log into networks.
  1. Install the software: su -c 'yum install NetworkManager NetworkManager-glib NetworkManager-gnome'
  2. Set the main service to start on boot: su -c '/sbin/chkconfig --level 345 NetworkManager on'
  3. Set the dispatcher service to start on boot: su -c '/sbin/chkconfig --level 345 NetworkManagerDispatcher on'
  4. Start the services: su -c '/sbin/service NetworkManager start ; /sbin/service NetworkManagerDispatcher start'
  5. Now enter this command to load the tray icon: NetworkManagerInfo & (or just Reboot as I did).
*****VPN
This was really easy. Install PPTP and the pptpconfig GUI using the following commands:

# rpm -Uvh http://pptpclient.sourceforge.net/yum/stable/fc6/pptp-release-current.noarch.rpm
# yum --enablerepo=pptp-stable install pptpconfig


Then open ppptconfig application from the Applications/Internet menu and complete the configuration. On my case I had to disable (or enable?) one of the Encryption options to be able to connect to my work. Also on the Routing tab you can either select to route all traffic through the tunnel or set up rules so your internet traffic goes through your home broadband and your corporate applications go through the tunnel (don't know if this is a good idea on a security point of view).

*****NTFS
Mounting NTFS partition on FC6

My laptop has 2 windows partions, one for the windows applications/windows installation and a second one to keep files, documents, etc. This is to avoid any problem in case I need to reinstall windows and to use as sandbox with the Fedora partition.

My steps were:

a) As root (or sudo)
yum install fuse fuse-libs ntfs-3g ntfsprogs ntfsprogs-gnomevfs

b) Check disk configuration to see where the partition is:
[root@box loginname]# /sbin/fdisk -l
Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1958 15727603+ 7 HPFS/NTFS
/dev/sda2 1959 5222 26218080 7 HPFS/NTFS
/dev/sda3 5223 5235 104422+ 83 Linux
/dev/sda4 5236 7296 16554982+ 5 Extended
/dev/sda5 5236 7296 16554951 8e Linux LVM

The partition I want to mount is /dev/sda2, so I change the /etc/fstab and add the last line on the example below:

[root@box loginname]$ more /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/sda2 /mnt/drive_e ntfs-3g rw,defaults,umask=0000 0 0


Where /mnt/drive_e is a directory I created to "label" the mounting point.
Then ntfs-3g is the file system and note that rw will make the partition read/write. You can also set it up as ro (read only). Check the man mount for the meaning of umask as it gives several options.

*****Screen Resolution Intel 945 Dell 620

Surfing around I found that many of this dells come with a nvidia driver and I guess my company is a cheaper one and went for the Intel 945 option.

The lspci shows the version of the Display controller
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)

Installation went well but the system keeps booting on 1024x768. I read along and I can see that I can at least run this laptip at 1200x800 and in some cases at 1440x900. Haven't been able to run at 1440x900 but here is what I did for 1280x800.

a) yum install 915resolution
It looks that you need this utility to run customs resolution on the 945. Also this utility needs to be run everytime that you boot your pc.

A few tips, after installing run "locate 915resolution" if nothing is found then run an updatedb.

After install run a 915resolution -l and you will get a list of all options. Probably 1280x800 is not there so run the following options to create the 1280x800

/usr/sbin/915resolution 49 1280 800
/usr/sbin/915resolution 38 1280 800
/usr/sbin/915resolution 58 1280 800

As you have to run this everytime the box boots you can add them on the /etc/rc.local.

I also added the file /etc/default/915resolution so that it has XRESO=1280 YRESO=800.

Finally I changed the /etc/X11/xorg.conf as follows (note that everytime I change the display configuration using the gnome utility this file looses this changes - I was trying to have 2 montiros running) but along the above steps are done it doesn't seem to affect it. Just in case below are the details I originally used on xorg.conf.

Section "Monitor"
Identifier "Monitor1"
VendorName "Monitor Vendor"
ModelName "Monitor 1024x768"
HorizSync 24.0 - 64.0
VertRefresh 43.0 - 60.0
Option "dpms"
EndSection

Section "Device"
Identifier "Videocard0"
Driver "i810"
BusID "PCI:0:2:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Videocard0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1440x900" "1280x800" "1024x768" "800x600" "640x480"
EndSubSection
EndSection


*****FIX DVD DMA
(again copied from another site)
For some of us, DMA isn't enabled by default for our wonderful FC5 powered computers (like some Dells and Thinkpads). I've been spending a month or two (off and on) trying to find out how to work arround this problem. The long answer, from what I understand, for why this happens has to do with an IDE and a SATA/PATA drivers that are conflicting with one another and trying to control the drive (you might notice that the drive is labled /dev/hdc) and the DMA doesn't work well... or at all. According to the bug-report that I read, this is not a bug but an expected side effect of some DVD drive setups. With recently released kernels it is not required to make a custom-build, so this is done based off of a yum-installed kernel.

Signs of this problem include choppy DVD playback or slow image reading and when running "hdparm -d1 /dev/hdc" to turn DMA on it will respond with "Operation not permitted". If you see this and, like me, have been trying to find a way to enable DMA on your drive this should help you and I'm writing this so that people with this (apperently common) problem can referance one place to solve it.

Ok, now to get to the part where I tell you how to...

In the terminal:

$su -
#gedit /etc/modprobe.conf


add the following line to the end of the file (leaving an extra empty line behind it):

options libata atapi_enabled=1

save, close and continue in the terminal:

#gedit /boot/grub/menu.lst

add the following to the boot parameter:

combined_mode=libata

save, close and reboot.

Now your DVD drive should be called "/dev/scd0", DMA will not be needed and Xine should be able to play it without the choppyness. Further effects of a working DVD drive (from what I hear, tell myself to make me feel better and dream) include faster CD ripping speeds and general read speeds, improved oooo-aaahhhh factor of showing off Linux, improved firtility and a marginal decrease in Windows dependancy...

*****Other installations
yum install flash-plugin
yum install wifi-radar
yum install wlassistant
yum install gnome-commander



*****Usefull URLs
Below are the URLs I used to get the information. Read them as the people who wrote them knew what they were doing that is not my case most of the time.

http://pptpclient.sourceforge.net/howto-fedora-core-6.phtml
http://www.g-loaded.eu/2005/12/14/the-complete-fedora-kernel-headers/
http://klamstwo.org/evad/archives/3
http://mikelococo.com/2007/01/fc6-on-d620/
http://www.mjmwired.net/resources/mjm-fedora-fc6.html
http://www.linuxquestions.org/questions/showthread.php?t=515648
http://fedoraproject.org/wiki/Tools/NetworkManager#head-fc3fe44e92c63867615113b1ef69cf4fc0dc03cf
http://www.fedoraforum.org/forum/showthread.php?t=114586

C51B50E96BD6109DF982BBD4F6

Saturday, January 13, 2007

Installing Asterisk, Java SDK, recompiling Kernel on Debian

This is nothing to be proud off.. two things I wanted to install. Note this is not JAVA for Asterisk, keep googling on how to do that, this is just a few packages I installed on a Debian box.

------

a) Java SDK - Sun webpage has jdk-6-linux-i586.bin but I followed some instructions (running the binary and trying to create the Debian package) but they didn't work so I check what was available. I found that testing (etch) had a Sun Java package ready to apt-get install.

-------


b) Asterisk again (this is a second server, I want to experiment with IAX and SIP trunks between asterisks)

For (a) I couldn't install it on normal ways so I cheated. Following is what I did -not on purpose.

Installed Sarge from Netinstall and updated it.
5 cd /etc/apt/
1 vi sources.list
2 apt-get update
3 apt-get dist-upgrade
4 shutdown -r now


Upgraded to Etch (by changing the sourcelist)
5 cd /etc/apt/
12 apt-get install fakeroot
13 apt-get install java-package ncurses-dev wget bzip2
17 vi sources.list
18 apt-get update
19 apt-get dist-upgrade
20 uname -r
21 shutdown -r now


Install Jdk 5 (not 6)
22 apt-get install sun-java5-jdk
23 which java

After this I went to install asterisk but when compiling Zaptel I got the error that the headers didn't match although they were there and they were the same as the uname -r. I tried to uninstall them and install them again but once uninstalled I couldn't install them again... so I decided to do something that I always fails... build the kernel from the sources.

Upgraded the kernel to latest one on kernel.org
I install a bunch of packages that not sure what they are for
105 apt-get install kernel-package ncurses-dev fakeroot wget bzip2
106 apt-get install make-kpkg kernel_image
130 apt-get install yaird fakeroot
134 apt-get install initramfs-tools


Also in the process I created a Sudo account.
apt-get install sudo
adduser ricardosudo
visudo -> modified a file with PICO
added ricadosudo ALL=(ALL) ALL
sudo adduser ricardosudo src


And here it gets weird:
cd /usr/src
tar jxf /path/to/linux-2.6.19.2.tar.bz2
cd linux-2.6.19.2/
cp /boot/config-$(uname -r) .config
---> basically I am copying the .config left by the default installation to avoid starting from zero.
make oldconfig ---> not sure if necessary. Here you are asked A LOT of things. Try to answer what you can but probably this will remind you a Windoze NEXT NEXT NEXT era.
make menuconfig --> here again I think that I could avoid the previous step. anyway go through the options and remove anything you think you don't need as it will make the kernel smaller and compile quicker. What do I don't need you ask? Go for the obvious - like removing support for ATI if you have an Intel Graphic board.

Example of the screen of menuconfig:



A few things to check are:
Processor type and features ---> Processor family (Pentium 4)
Processor type and features ---> Timer Frequency (1000 Hz)
Processor type and features ---> Preemption Model ---> Preemptible Kernel (Low-Latency Desktop)


Exit to the main menu and SAVE then run:
fakeroot make-kpkg clean

Run the make-kpkg commmand like: fakeroot make-kpkg --append-to-version "<-suffix>" --revision "" --us --uc --initrd kernel_image kernel_headers Where <-suffix> is whatever you want (like -mykernel), and change with a number (like the date, 05112006.)

Example: fakeroot make-kpkg --append-to-version "-mykernel" --revision "01132007" --us --uc --initrd kernel_image kernel_headers

After this you will get 2 deb files, you can use dpkg -i to install them.

dpkg -i linux-headers-2.6.19.2-mykernel_01132007_i386.deb
dpkg -i linux-image-2.6.19.2-mykernel_01132007_i386.deb

Here my box went wrong saying that I needed Yaird initramfs-tools and another package and could continue. I try to apt-get install those package bUt it kept saying "The following packages have unmet dependencies." but also it said to try to run apt-get install -f (note alone, not any other instance).

After this I run the dpkg again and now it worked.

After this I was able to install Asterisk as always and it worked. I am sure that I am doing something wrong and hope to learn what it is along the way.

NOTE: When compiling Zaptel I run the modprobe zaptel and modprobe ztdummy as I don't have any fxo,fxs,tdm board on this box. It will us the ztdummy for timing. An lsmod shows the modules...

rbtest:/usr/src# lsmod
Module Size Used by
ztdummy 5544 0
zaptel 208932 1 ztdummy
crc_ccitt 2304 1 zaptel

Something good came out of this.. NO KERNEL PANIC on an attempt to recompile a kernel. I have to say.. first time I didn't got one of this.

Some links that I used to do this were:

http://www.falkotimme.com/howtos/debian_kernel2.6_compile/
http://wizah.blogspot.com/2005/12/debian-how-to-custom-kernel-compile.html
http://www.debianhelp.co.uk/kernel2.6.htm

Monday, January 08, 2007

Installing Asterisk again

I installed Asterisk again. This time version 1.4.

As always I did a Debian Sarge netsinstall. On boot I choose the linux26 option to have a 2.6 kernel rather than the 2.4 that comes by default.. Why? Have no idea.

The installation is really basic, I don't choose any configuration when Debian asksfor "Desktop", "Web Server", etc.. I just give the ok and start with an empty server.

(Note that I tried to run the "testing" or "etch" version of netinstall but Asterisk requieres headers. The etch version repository don't have the headers for the default installation and you need to recompile.. AND I CANNOT RECOMPILE THE BLODDY KERNEL YET. I tried, I really tried and read several posts/pages and run diferent methods - from building my debian kernel package to actually recompile the kernel from source - but always I get a Kernel Panic. If anybody want's to sit with me and show me how to do it, I will pay for the lunch/coffee).

After the installation I changed the source.list to add contrib and non-free packages when installing new software. The file can be seen below:

rbast:/etc/asterisk# cd /etc/apt/
rbast:/etc/apt# more sources.list
#deb file:///cdrom/ sarge main

deb http://ftp.uk.debian.org/debian/ stable main contrib non-free
deb-src http://ftp.uk.debian.org/debian/ stable main contrib non-free

deb http://security.debian.org/ stable/updates main contrib non-free
rbast:/etc/apt#


You have to run apt-get update after this to let Debian pick up the changes (need to read more about apt).

Then I run the apt-get dist-upgrade to upgrade all the packages installed.

First step after install - as I like to do things remotely - is to do the apt-get install ssh. This will install a ssh client and server (openssh) so I can log in remotely and keep working from my laptop. Ah.. I never mentioned this but the "server" is an old HP PIII box.

Next step install the headers needed for Asterisk:

apt-get install kernel-headers-`uname -r`

Download all the packages again:

wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.4.0.tar.gz
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.4.0.tar.gz
wget http://ftp.digium.com/pub/libpri/releases/libpri-1.4.0.tar.gz
wget http://ftp.digiu
m.com/pub/asterisk/releases/asterisk-addons-1.4.0.tar.gz
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-sounds-1.2.1.tar.gz


And follow the installation as with 1.2.x, only a few things changed (maybe more.. correct me please).

On the asterisk package you need to run the configure utility as show below:
tar xvfz asterisk-1.4.0.tar.gz
cd asterisk-1.4.0
./configure
make
make install
make samples


Also on the asterisk-addons or you will get an error message after the make if not.

Some tips I picked up this time (also the last time but I didn't take note of them at that time) are:

a) run lspci - shows the 2 fxo clones I bought (2 years ago by now).

rbast:/usr/src/asterisk# lspci
0000:00:1f.5 Multimed
ia audio controller: Intel Corp. 82801AA AC'97 Audio (rev 02)
0000:01:0b.0 Communication controller: Tiger Jet Network Inc. Tiger3XX Modem/ISDN interface
0000:01:0e.0 Communication controller: Tiger Jet Network Inc. Tiger3XX Modem/ISDN interface
rbast:/usr/src/asterisk#


b) run lsmod - shows the modules loaded. (I have way too much modules)

rbast:/usr/src/asterisk# lsmod
Module Size Used by
wcfxo 12448 0
zaptel 231332 1 wcfxo


Other usefull things to check are:
cat /proc/zaptel/* --> it should show 2 files.

After installation I need to configure my 2 fxo boards:

In zaptel.conf set the following configuration:

fxsks=1-2
loadzone=uk
defaultzone=uk


Then execute:

/sbin/ztcfg -vvvv

In zapata.conf set the following configuration:

[channels]
language=en

context=zap
signalling=fxs_ks
callerid="Line 1"
channel => 1
callerid="Line 2"
channel => 2


Finally reload chan_zap.so

Set sip.conf as follows to have 2 extensions - a grandstream budgetone 100 and then a normal xlite softphone.

[10001]
type=friend
context=sip
regexten=10001
secret=10001
username=10001
callerid="GrandStream1" <10001>
host=dynamic
nat=no
canreinvite=yes
dtmfmode=info
call-limit=1
disallow=all
allow=ulaw

allow=alaw
callingpres=allowed_passed_screen

[10002]
type=friend
regexten=10002
context=sip
secret=10002
username=10002
callerid="XLite" <10002>
host=dynamic
nat=yes
canreinvite=no
disallow=all

llow=gsm
allow=ulaw
allow=alaw


My extensions.conf atm is rather simple. I have 2 sip phones, 2 zap lines and just for testing the following configuration should work:

[general]
static=yes
writeprotect=no
clearglobalvars=no
[sip]
exten => 10001,1
,Dial(SIP/10001,20,tr);
exten => 10002,1,Dial(SIP/10002,20,tr);
exten => _8XXXX,1,Dial,Zap/1/${EXTEN}
exten => _9XXXXXXXXXXX,1,Dial,Zap/1/${EXTEN}
[zap]
exten => s,1,Dial(SIP/10001,20,tr);

The above configuration should ring the 2 sip phones and allow the sip phones to ring any extension on my office through the 1st zap channel (need to read about macros to use both and pick up an available zap channel).

It will also send any call from my pbx to the grandstream phone.

My PBX is an Avaya CM3. I want to set up an H323 trunk, but at the moment anybody dialing extension 8xxx1 and 8xxx2 (I am not trying to hide the extensions number, I really don't remember them) will send the calls to the grandstream sip phone.

The Grandstream configuration is simple and show on the picture attached. To configure it first check the phone ip - activate dhcp or enter an ip using he keypad - and log in. The default password is admin, if you don't know the password you can reset it by going to the "reset" option on the phone menu throught the keypad and enter the mac address of the phone. Look for the grandstream manual on the net as they have some rules of how to change the mac address letters for numbers.

That is all for today.. Good luck!

Usefull links:
http://kb.digium.com/ -> Digium Knowledge Base.

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