Wednesday, January 16, 2008

Tar and Gzip

I always forget the tar and gzip process.. so here is my quick reference.

Creating a tape archive:
tar -cf archive.tar myDirectories/
Note - using the "v" flag prints out extra messages, as verbose mode, though it's not related to extracting files.

Listing the contents of an archive:
tar -tf archive.tar

Extracting all files from an archive:
tar -xf archive.tar
To extract just partial pieces from the archive, supply a file or directory name after the archive name. You can list as many as desiered here, separated by spaces.
tar -xf archive.tar filename

Compress:
gzip archive.tar

Decompress:
gunzip archive.tar.gz

Merged filenames:
Sometimes, you will download files ending with the extension *.tgz - these are essentially identical to files ending with *.tar.gz files. You can gunzip them, and untar them just the same way. If you're working with a recent version of gnu tar, you may be able to take a shortcut, as described below.

My list

No comments, just my list

Mini Anden - http://en.wikipedia.org/wiki/Mini_Anden

Payton List - http://en.wikipedia.org/wiki/Peyton_List

Catherine Blanchet - http://en.wikipedia.org/wiki/Cate_Blanchett

Audrey Hepburn - http://en.wikipedia.org/wiki/Audrey_Hepburn

Grace Kelly - http://en.wikipedia.org/wiki/Grace_kelly

Saturday, December 01, 2007

My Rubik

Ok, first and second layer are easy. Below are the steps I follow to finish the third layer and last face.

Saturday, October 06, 2007

Perl script to automatically dowload files from a web site.

I've been reading Learning Perl book from Randal L. Schwartz and just the introduction gave me the tip to automate a task that otherwise would have taken more time.

Again I am installing Asterisk and a Debian box, I have a list of all the necessary files but now Asterisk put all the sounds files on separate files and not in one package as before.

Instead of downloading 31 pages manually I got a the link to all of them, put them on a file (named filesd) one o each line and run the following Perl script:

#!/usr/bin/perl
open (FILESD, filesd);
while ($pathf = ){
open (WGET, "wget $pathf");
close (WGET);
}


The filesd file is just a plain file like the one shown below:

ricardo@lmntel01:~/test$ more filesd
http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.12.1.tar.gz
http://downloads.digium.com/pub/zaptel/releases/zaptel-1.4.5.1.tar.gz
http://downloads.digium.com/pub/libpri/releases/libpri-1.4.1.tar.gz
http://downloads.digium.com/pub/asterisk/releases/asterisk-addons-1.4.3.tar.gz


I know this could have been done with WGET but I got tired of trying to find the correct flag to download them, and I also know there is no error check, report, fancy things and whistles but hey I just finish the introduction.

Sunday, September 30, 2007

Eclipse + Perl = Epic

Googling around for a gui ide for Perl I found that there is a plugin for Eclipse. As I also use Eclipse for Java I decided to give it a try and knowing nothing else I found it quite useful. No more of those first vi days (no offense, vi is great but a gui is faster).

You can find about EPIC on http://e-p-i-c.sourceforge.net/, and this time I will not going to explain the installation (as I already installed and didn't took notes) but if you follow their installation manual there is no miss:

http://e-p-i-c.sourceforge.net/downloads/EPIC_User%27s_Guide.pdf

Good luck and if there is a better option let me know and I will give it a try.

Eclipse and Java SDK 1.5 on Debian Etch

As I am still trying to learn java, linux, perl, asterisk and everything I can get distracted with I needed to run eclipse on a new box I set up at home with Debian Etch.

I found the below page quite good on the details on how to achieve this. My steps are copied below:

http://www.crazysquirrel.com/computing/debian/java.jspx


$ apt-get -u install java-package
$ fakeroot make-jpkg java_ee_sdk-5_03-linux.bin

You will see the follwing output:
Creating temporary directory: /tmp/make-jpkg.fktzTQ6486
Loading plugins: blackdown-j2re.sh blackdown-j2sdk.sh common.sh ibm-j2re.sh ibm-j2sdk.sh j2re.sh j2sdk-doc.sh j2sdk.sh j2se.sh sun-j2re.sh sun-j2sdk-doc.sh sun-j2sdk.sh
Detected Debian build architecture: i386
Detected Debian GNU type: i486-linux-gnu
No matching plugin was found.
Removing temporary directory: done

The above command didn't work with the package
java_ee_sdk-5_03-linux.bin so first I tried to make it work. First use the command below to see you have the latest java package installed. I have .28 that is current enough.

$ apt-cache policy java-package | head -2
java-package:
Installed: 0.28

Second try to lie to the installer telling that the installation type if i386 (google arround the message of "plugin not found" and that was the advice). You do this step by entering the following line:

$DEB_BUILD_GNU_TYPE=[i386]-linux fakeroot make-jpkg java_ee_sdk-5_03-linux.bin
The trick is on hte DEB_BUILD_GNU_TYPE that you pass to the process. But as I was still using the java_ee_sdk-5_03-linux.bin from sun it didn't work because the problem was not the plugin but the USER (me) and instead of java_ee_sdk-5_03-linux.bin I should have been using jdk-1_5_0_12-linux-i586.bin. This is the JDK for what make-jpkg was done and after downloading it I was able to make it work.

$fakeroot make-jpkg jdk-1_5_0_12-linux-i586.bin

dpkg-deb: building package `sun-j2sdk1.5' in `/tmp/make-jpkg.trHEuC6948/sun-j2sdk1.5_1.5.0+update12_i386.deb'.
copy sun-j2sdk1.5_1.5.0+update12_i386.deb into directory /home/ricardo/java_source/
The Debian package has been created in the current directory. You can
install the package as root (e.g. dpkg -i sun-j2sdk1.5_1.5.0+update12_i386.deb).

Removing temporary directory: done
After that the package is done and now you only need to run dpkg to install it:
$dpkg -i sun-j2sdk1.5_1.5.0+update12_i386.deb


Check your Java Version just in case you have 2 and you have to use alternatives (explained in another blog) to select the Sun one as default and not the GNU one (usually installed but not in this case).

# java -version
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)



Installing Wireless D-Link DWL-G520+ on Debian etch

I got a desktop pc, nothing fancy and old p4 with 700MB RAM and a 40GB disk. I will be using it at home where I normally use my work Laptop (Latitude D620 with Ubuntu 7.04) and there is wireless access.

Instead of Ubuntu I installed Debian on it, I downloaded the netinstall of Debian 4 (etch) and did the basic installation. For the first step I did the installation in the office connecting the pc to the network as I am not good doing everything from zero.

Once the pc was up and running I started investigating about my wireless card. I am using a D-Link DWL-G520+. I has been working great on a windows box for the last year and was time to move it to linux.

Looking around you find two main options (although I found some new drivers) using ndiswrapper and acx100.

Much of the googling I read mentioned that acx100 was the correct one for the g520 so I install that one. The installation is simple enough and the steps are below. Note that I've been using it for the last 24hrs and I am not happy with it. I even try to put the Ubuntu install cd and forget about debian/acx100 as the connection fails every now and them (I have on my desk my laptop and this pc and while the pc fails some times and have to either restart X or reboot the machine due a complete freeze the laptop stays connected all the time, arghhh).

The information on how to install the driver ison the acx100 wiki page. The steps I followed are listed below:

http://acx100.sourceforge.net/wiki/Distribution_list/Debian


(as root)

# apt-get update

# apt-get install acx100-source wireless-tools

# module-assistant prepare

(the below step is a menu driven, you have to build the acx100 module)
# module-assistant # It will show a menu to build and install it.
|---> Select / acx100 / Build
|----> Yes
|----> Yes
# modprobe acx

If you want you could load the driver automatically with:
#echo acx >>/etc/modules

#cp tiacx111c16 /lib/firmware/`uname -r`/acx/1.2.1.34
(manually created `uname -r`/acx )

#vi /etc/network/interfaces
# The wireless network interface
allow-hotplug wlan0
iface wlan0 inet dhcp

#shutdown -r now

That was it, after the reboot the machine detected the wireless networks around. Selected mine and enter password and was logged (again I fails time to time).



Monday, September 10, 2007

Synergy 1.3.1 Windowz XP and Ubuntu 7.04

For the last weeks I've been using my laptop with Ubuntu and my office desktop with the corporate windows xp. I was using the Terminal Server Client to work on my desktop but switching between windows was quite boring.

In the past when I used to have windows on boths boxes I run synergy to share the keyboard/mouse but didn't install it yet.

First thing the sudo apt-get install synergy althouth it didn't show any error it didn't show any success either so I remove it.

Next googling around I found the following link with a good explanation on what to do to get started, the link is: https://help.ubuntu.com/community/SynergyHowto

So the steps are:

a) download Synergy the tar.tz from the Synergy project page http://synergy2.sourceforge.net/. The direct link is:
http://kent.dl.sourceforge.net/sourceforge/synergy2/synergy-1.3.1.tar.gz

Untar the file on your home directory.

b) Next install necessary libraries:
sudo apt-get install libxtst-dev
sudo apt-get install build-essential

c) Now configure this but specify the location of the libraries.. if not an error of X cannot be found will appear.

sudo ./configure -x-libraries /usr/lib -x-includes /usr/includes
sudo make install

d) The previous step created synergc (client) and syngers (server) on your home director. The webpage mentioned below ask us to move the mto /user/bin so we do a:

sudo mv /usr/local/bin/synergyc /usr/bin
sudo mv /usr/local/bin/synergys /usr/bin
e) The next step is to configure synergy. The system uses a file called synergy.conf , there is an example on the installation folder at /synergy-1.3.1/examples/synergy.conf.

The configuration is quite easy, I have to say that easier than setting this between to windows boxes. Basically you say which are your 2 boxes and then where is which one respecting the other.

Here you have to use the hostname of your linux box and the name of the windowz box you set up on the windowz client.

So my synergy.conf looks like this:



On the windows machine you set up the ip/hostname (you choose) of your linux box and click on the advance button at the end to set up the name assigned to this machine:



On the advance settings just check the name, if you are having problems just make sure that the name on the below screen is the same as the one on the synergy.conf on your linux box. If they are not the same you will get errors on your client machine.



After this run the server synergys --config synergy.conf from your command line (check previous page you can mv the synergy.conf to your home directory and just run synergy) and start the client, you should be able to use your linux mouse/keyboard on both boxes!!!

Please read the document from the ubuntu documentation mentioned above.

Regards
Richard

Wednesday, September 05, 2007

Configuring Minicom on Ubuntu to connect to Cisco Router

Ok, that was a large title for this task but what the heck. What needs to be done to achieve this? We need a piece of software called minicom (this has been around for ages, google it and you will learn a lot) and follow the next steps shown below:

a) install minicom and follow the normal procedures

sudo apt-get isntall minicom

b) check your serial ports.

We need to know the serial ports on your machine, so a dmseg would do the trick. Look for ttyS and take note of the number after it, in my case I have ttyS0 ready to use.

richard@wok:~$ dmesg|grep ttyS
[ 1.430818] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 1.431528] 00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
richard@wok:~$


c) launch minicom as root

$sudo minicom

You will see a page as the one below. The first lines shows the configuration (I already modified mine, so yours must be the default ones).


c) Press control + a and Z to go to the menu. The first thing we will change is the dialing string so select the letter "O" for "command string" on the below menu.



d) The previous step should have brought you to the image below. With the arrows keys select "Modem and dialing" and press enter.



e) Now you are on the image below. Press A to set the cursor on the first line and delete everything (I use to have the following configuration ~^M~AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0^M ). One done press ESC or RETURN to go back to the menu.


f) Now back on the menu select "Serial Port Setup" with the arrow keys.


g) Using the letters configure the options:
A - For Serial Device
E - For Bps/Par/Bits

Copy the configuration below, the option "E" will bring a new menu where you select the details. The option A has to match with what you find on the dmseg step "b" of this guide.



h) Exit to the main menu and reset minicom. Restart it so the changes would take effect (maybe there is an option to make the changes live without restarting minicom but this is a small step).

After rebooting minicom with the Cisco router connected with the blue cable to your pc/laptop just turn the Cisco on and you will see the details on the screen and you are good to go. Example below:


I will add more details/tips along the way.

As always good luck!

Saturday, September 01, 2007

FTP Server: Proftpd

I put a server to share files with friends and I had in my hands a little project on how to share them. For this time I chose to use the always friendly FTP service. Googling around I found Proftpd as one of the heavyweights for this and decided to install it. It can be found at: http://www.proftpd.org/.

I am using Debian, 3.1 with kernel 2.6.22.6. Installation thanks to apt is quite easy..

a) apt-get install proftpd .. that was it. no more. (there is a question on installing as inetd or standalone, you should choose your favorite).

The next steps were to set it up so I can create ftp users "virtual" without shell access (they are not that good friends!) and limit them to upload/download only in certain directories.

First add the following on /etc/proftpd/proftpd.conf

# Set /home/FTP-shared directory as home directory
DefaultRoot /media/muploads

# Lock all the users in home directory, ***** really important *****
DefaultRoot ~

AuthUserFile /etc/proftpd/ftpd.passwd
AuthGroupFile /etc/proftpd/ftpd.group


Umask 022 022
AllowOverwrite off

DenyAll




Umask 022 022
AllowOverwrite off

DenyAll



/media/muploads/uploads/>
Umask 022 022
AllowOverwrite on

DenyAll


The directories /media/muploads/uploads and /media/muploads/downloads should exist already.

Second you have to create the users. For this you need to download a file called ftpasswd. This script would be used to create 2 files, ftp.passwd and ftp.group. Both files replaces the system group and passwd files. Read the documentation to learn more about them.

ftpasswd --passwd --name=user --uid=501 --gid=500 --home=/media/muploads --she
ll=/bin/false
ftpasswd --group --name=ftpvirt --gid=500 --member=user


The first command with the --passwd flag will ask you for a password for the user "user", just add it.

The next step is to add the shell /bin/false to the /etc/shells file. If this step is not done when user "user" tries to log in it would get an error as the shell doesn't exist. Note that the shell actually doesn't exist as we don't want the uses to telnet or ssh to the pc but adding the line /bin/false to the file solves the problem.

The final step is to change the permissions of the directories.

on /media/muploads do a:

chown 500:501 downloads
chown 500:501 uploads
chmod 777 uploads


The userid and groupid are the same for all users and directory. It doesn't matter that they don't exists (keep an eye if you have several users not to use this ids). The chmod 777 is quite extreme and you should use something more secure.

The result, an ftp server that allows connections from virtual users. Diverts them directory to a general home directory and not systems home directories and that are allowed to download from one directory and only upload into another.

As always I am sure there are security holes the size on the moon on this procedure but it is a start.

Installing new hard disk on Debian

I got a new disk 40GB disk (found it on the office ether of unused stuff) and installed it on my little Debian server that only has a 20GB disk on it.

The usage of the new disk would be something very productive for the organization, we will use it to share movies!. Ok probably IT Security will kick my ass if they found out but we will deal with that later.

So the steps to add the disk are quite simple. This is an IDE disk and the first step is to connect the hardware (power, ide cable etc). Power up and the fun begins.

a) run fdisk /dev/hdb to partition the disk (check dmseg to see the name it has, in my case hdb that is the standard).
b) on fdisk I just created a primary partition and used 100% of the disk. This depends on the purpose of the disk so study your options. Once the partition is created quit fdisk saving the changes.
c) next step is to format the partition. I am using ext3 so the command to run is
mkfs.ext3 /dev/hdb1
d) next you create a mount partition
mkdir /media/muploads
e) next you mount the disk
mount /dev/hdb1 /media/muploads
f) finally change your fstab settings so the disk is mounted on every boot.
vi /etc/fstab
add the following line
/dev/hdb1 /media/muploads ext3 defaults 0 2


That was all. I am sure betting things can be done for RAID, etc. Notes are welcome (almost).
Good luck

Book: Five Years at the Epicenter of the Dot.Com Juggernaut


I just finished reading this book - Five Years at the Epicenter of the Dot.Com Juggernaut by James Marcus - and unfortunately I couldn't see the put my experience on the authors tale. I enjoyed the book and found it amusing and educational on my search to see how business are made but as I work on a dot.com myself I was hoping to find an outside look of what I daily see.

My work on a dot.com is not as glamorous as James's but I believe I leave my footprint on the not so "dot.com" part of the business (after all I am a telephony administrator/engineer on it) and also I have to say and I join the on the late shift (5 years after the company appear) so I was not on the stock options group - although I new some of them and when the company was finally bought there were no millionaires on the building except the top execs - as he was.

Going back to the book, first I would like to write reviews like his but this is just a group of characters put together in bad sentences with what is on my head, so Sorry James!. I leave the book with the wish to read as much as possible. I love the passion on reading the author has and shows on his writing. I consider myself lucky to be able to read more than 15 books a year that although I know is nothing - my father easily reads 4/5 times that number - is much more than all the people I know. I want to start reading the not so marking books, most of my reading is bestseller top shelf nice cover good reviewed type of book. I want to read and enjoy those not so known authors that haven't sold their souls to the publishing machinery, it is just september so I still have a chance to get it.

Another point of the book that I didn't like was that the book could have been about a beer factory and not one of the pioneers on the tech boom. I know the author mentions it all the time but every business wants to revolutionize his market anyway so if you replace the amazon for other success history the books remain the same. What I am trying to see is that I see it more as a history about corporate work than a specific book about working in amazon. Again sorry James but I don't think you will never read this anyway, I really think nobody would ever read this in fact!

In summary a good read, I like books like The Search or Google more to learn about dot.com companies but I recommend the book (this is my editorial at the end!) to everybody.

Friday, August 24, 2007

Another Asterisk 1.4.11 installation

I haven't tested this installation at the time of the post (want to leave the office!!) but as always I keep my notes here to go back my steps later if needed.

The installation is simple as always.



a) Check version of GNU Make is greater than 3.79, just run

rbtest:/home/ricardo/asterisk_intall# make -v
GNU Make 3.81


b) Install some dependencies (errors show during the installation of pwlib)
$ apt-get install libldap2-dev
configure: error: pwlib needs the GNU Project fast lexical analyzer generator flex
$ apt-get install flex
configure: error: pwlib needs the GNU Project parser generator bison
$ apt-get install bison


19 apt-get install kernel-packages ncurses-dev fakeroot bzip2
20 apt-get install kernel-package ncurses-dev fakeroot bzip2
21 apt-get install yaird fakeroot
22 apt-get install make-kpkg kernel_image
23 apt-get install kernel_image
24 apt-get install sudo
25 apt-get install iniramfs-tools
26 apt-get install initramfs-tools
27 apt-get install bzip2
28 apt-get install libncurses-dev
30 ap-get install wget
35 apt-get install linux-headers-`uname -r` build-essential libnewt-dev libusb-dev




c) Download packages asterisk:

rbtest:/home/ricardo/asterisk_intall# ls -ltr
total 16772
-rw-r--r-- 1 ricardo ricardo 11218944 2007-08-24 16:25 asterisk-1.4.11.tar.gz
-rw-r--r-- 1 ricardo ricardo 1563752 2007-08-24 16:25 zaptel-1.4.5.1.tar.gz
-rw-r--r-- 1 ricardo ricardo 81178 2007-08-24 16:25 libpri-1.4.1.tar.gz
-rw-r--r-- 1 ricardo ricardo 1000286 2007-08-24 16:26 asterisk-addons-1.4.2.tar.gz
-rw-r--r-- 1 ricardo ricardo 3249876 2007-08-24 16:26 asterisk-sounds-1.2.1.tar.gz
drwxr-xr-x 2 root root 4096 2007-08-24 18:03 libpri-1.4.1
drwxr-xr-x 24 root root 4096 2007-08-24 19:11 asterisk-1.4.11
drwxr-sr-x 14 root root 12288 2007-08-24 19:21 zaptel-1.4.5.1
rbtest:/home/ricardo/asterisk_intall#


d) Download packages openh323

wget http://downloads.sourceforge.net/openh323/pwlib-v1_10_3-src-tar.gz
wget http://downloads.sourceforge.net/openh323/openh323-v1_18_0-src-tar.gz

rbtest:/home/ricardo/openh323_install# ls -ltr
total 5704
-rw-r--r-- 1 root root 3742730 2006-03-26 12:28 openh323-v1_18_0-src-tar.gz
-rw-r--r-- 1 root root 2079871 2007-01-25 00:01 pwlib-v1_10_3-src-tar.gz
drwxr-xr-x 9 1010 3000 4096 2007-08-24 18:28 pwlib_v1_10_3
drwxr-xr-x 7 1010 3000 4096 2007-08-24 18:40 openh323_v1_18_0
rbtest:/home/ricardo/openh323_install#



e) Install Openh323

tar zxvf pwlib-v1_10_3-src-tar.gz
cd pwlib_v1_10_3/
./configure
make


export PWLIBDIR=/home/ricardo/openh323_install/pwlib_v1_10_3
cp $PWLIBDIR/lib/libpt_linux_x86_r.so.1.10.3 /usr/lib
cd ..



It is very important that you set the PWLIBDIR to your path, othewise OpenH323 will not find it.


tar zxvf openh323-v1_18_0-src-tar.gz
cd openh323_v1_18_0/
./configure
make opt


export OPENH323DIR=/home/ricardo/openh323_install/openh323_v1_18_0
cp $OPENH323DIR/lib/libh323_linux_x86_r.so.1.18.0 /usr/lib


Aain we must set the OPENH323DIR variable, so Asterisk can know here to look for OpenH323. We copy the library manually to the system directory, as we do not care about the rest of OpenH323 features.


f) Install zaptel, libpri, asterisk

tar zxvf zaptel-1.4.4.tar.gz
cd zaptel-1.4.4
./configure
make menuselect


At this point use the menuselect utility to select which Zaptel hardware - if any - you have on board. Please remeber that if you want to exit keeping the changes you made, you must press x, while q will quit without saving and the left arrow will get you back to the previous menu. Even if you do not have Zaptel hardware, you should compile the ztdummy driver.

make
make install

Now we install libpri

tar zxvf libpri-1.4.1.tar.gz
make
make install
cd ..

Now we build Asterisk itself:

tar zxvf asterisk-1.4.8.tar.gz
./configure
make menuselect


At this point, you should go to the Channels menu and see that H323 is enabled. If it's not, vey likely you did not set OPENH323DIR or PWLIBDIR, so configure cannot enable H.323 by default.

make


You will get the following error, so run the make again:
When compiling with H.323 support, the first time you run make it will end with an error telling you to run make again. This is okay, just do it as it says.

***************************************************************

********** Re-run 'make' to pick up H.323 parameters **********

***************************************************************
make[1]: *** [h323/libchanh323.a] Error 1


make

make install
make samples
cd ..


This should be it. I checked that my /etc/zaptel.conf was missing. Not sure if this is because I didn't have any hardware installed. Just in case I copied
150 cp /home/ricardo/asterisk_intall/zaptel-1.4.5.1/zaptel.conf.sample /etc/zaptel.conf

Run the moprobe on zapte/ztdummy

151 modprobe zaptel
152 lsmod
153 modprobe ztdummy
154 lsmod

Change the default zone on zaptel.conf to UK

156 vi /etc/zaptel.conf


Run the configuration and obviously 0 boards configured message appear:
157 ztcfg -v

Started Asterisk
158 asterisk -vvvvvvvvvvvvvvvvvvvvvvvvvvc


Will test this solution. Will do the installation of add-ons and sounds later as add-ons brings an h323 solution by itself.

Enabling H.323
In order to enable H.323, you simply edit /etc/asterisk/h323.conf as follows:

gatekeeper = DISCOVER
context=h323


This will tell it to find the gatekeeper automatically and to route incoming calls to context h323.
To place an outbound call fron Asterisk, you just dial:

exten => 21,1,Dial(h323/21)

This will find the terminal 21 through the Gatekeeper and will call it as needed.


Main article retrieved from:
http://astrecipes.net/index.php?n=286

Thursday, August 23, 2007

Install Sun Java on Ubuntu 7.04

The installation of Java is quite easy. The default installation has the GNU version of Java, to run Sun engine first install the following packages:

sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

Then check the version of Java running, the GNU version should still be the default one:

ricardo@lmnwok1:~$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 (Ubuntu 4.1.2-0ubuntu5)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ricardo@lmnwok1:~$

To select the new Sun engine run the update-alternatives as below and select the option you want to use:

ricardo@lmnwok1:~$ sudo update-alternatives --config java

There are 3 alternatives which provide `java'.

Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
2 /usr/lib/jvm/java-6-sun/jre/bin/java
*+ 3 /usr/lib/jvm/java-gcj/jre/bin/java

Press enter to keep the default[*], or type selection number: 2
Using `/usr/lib/jvm/java-6-sun/jre/bin/java' to provide `java'.
ricardo@lmnwok1:~$


Now when checking the version you will see the new one:

ricardo@lmnwok1:~$ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
ricardo@lmnwok1:~$



After this as in my other post change the JRE used by Eclipse.

Tuesday, August 21, 2007

Ubuntu 7.04 on Dell Latitude D620

I got that urge again of installing linux on my laptop. I've been using Fedora in the past but after the latest crash (that needed to get a new hard disk but I had to admit that I don't know if Fedora crash the disk or the disk crash Fedora) and as I normally install Debian on the servers (and due all the people I know and magazines and post I have read about Ubuntu) I decided to install Ubuntu on my laptop.

I went to the Ubuntu site and downloaded the image for the CD, run it on my laptop and first I was surprised about the installation process. Normally I install windows, leave enough space for Linux and then install Linux on the free space.

Ubuntu is different from the start. The cd is a LiveCD, once it is loaded on the desktop there is a shortcut to install Ubuntu. You click on it and you go on with the wizard. The only part that you have to keep an eye is on the disk partitioning. The automatic wizard resize existing file disk option didn't work (some kind of error) a friend at the office mentioned that he had the same problem and selected the option to do it manually. I choose it and altered my windows partition and it did an automatic resize of it (don't know if it worked as I haven't use my windows partition yet), once you have enough space you create you swap and you other mounting points. As this is my first attempt I created only "swap" and "/".

Next the installation is quite simple, once finished I run this two install packages:

# sudo apt-get install 915resolution (reboot)

On which you need to edit the /etc/default/915resolution file.
MODE=Auto
XRESO=1440
YRESO=900
BIT=

And...
# sudo apt-get install network-manager-pptp


I am still playing with this last one.

I will add more notes later as soon as I get my feet wet on Ubuntu (first thing I noticed is that I have to sudo everything.. I miss root)

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)