Projects 2008

Regular Expressions

Need two things:

1. Theoretical background
2. The tools to apply such knowledge

I’m presenting both:

1. Tutorials

http://gnosis.cx/publish/programming/regular_expressions.html
http://www.zytrax.com/tech/web/regex.htm
http://www.delorie.com/gnu/docs/regex/regex_67.html
http://www.lunametrics.com/blog/2006/11/27/
http://chaos4.phy.ohiou.edu/~thomas/ref/info/rx/Character_Sets.html
http://www.regular-expressions.info/tutorial.html

2. How to use regular expressions.

Regular Expressions in C++ using Netbeans and Boost

Notice that the link above explains how to use regular expressions using Boost with and without Netbeans.

November 15, 2008 Posted by aes | developer | | No Comments Yet

Run and Compile LAM programs

I use this instructions to run LAM programs in a Beowulf cluster

Requirements:

A file which holds the name of the boxes in the cluster (i.e /mnt/lamhosts)
A sharing directory the cluster (i.e /mnt/lam)
A LAM/MPI parallel computing program (i.e. hello.c)
Need to log in as an authorized user
And of course a working Beowulf cluster

1. Copy the file lamhosts, and the program hello.c into /mnt/lamhosts
2. cd /mnt/lamhosts
3. Turn on LAM: lamboot -v lamhosts
4. Compile prog: mpicc -o hello hello.c
5. Run: mpirun n0-x hello
(x: number of machines – 1)
6. Once you finish, turn Lam off: lamhalt

November 15, 2008 Posted by aes | developer | | No Comments Yet

Installing Netbeans

I remember years before trying to install IDE’s was so much painful: dealing with dependencies and trying to get the right configuration. Take a look how easy is the installation nowadays with Ubuntu

Ubuntu 7.10
sudo apt-get install netbeans5.5

Ubuntu 8.04
sudo apt-get install netbeans

Run netbeans:
Applications/Programming/NetBeans

In the center of the main page, click in Add Plugins, and choose what the plugin you want. There are several options:

netbeans6-java J2EE netbeans6-j2ee UML netbeans6-uml C/C++ netbeans6-cpp
Ruby netbeans6-ruby Mobility netbeans6-mobility Soa netbeans6-soa

Additional plugins:
Tools/Plugins

November 15, 2008 Posted by aes | developer | | No Comments Yet

HOW TO INSTALL AND CONFIGURE MRTG IN UBUNTU

1. Installation. Type ‘yes’ when a message pop up for security purposes

sudo apt-get install apache2 snmpd mrtg

Notes:

apache2: can be replaced by opening your browser and typing your path (file:///var/www/…)
snmpd: is not necessary if you’re using scripts without the snmp service(for this configuration it’s required though)
In RedHat: yum install mrtg

2. Now you need to edit the mrtg configuration file to edit the some of the settings
File is located at /etc/mrtg.cfg you need to change the global settings as follows

# Global Settings

RunAsDaemon: yes
EnableIPv6: no
WorkDir: /var/www/mrtg
Options[_]: bits,growright
WriteExpires: Yes

Title[^]: Traffic Analysis for

3. Now we need to assign the snmp community name in snmp configration file /etc/snmp/snmpd.conf

# sec.name source community
# com2sec paranoid default public
com2sec readonly default public
#com2sec readwrite default private

4. Restart snmp

/etc/init.d/snmpd restart

5. Obtain right permissions for the following two instructions

sudo sh

6. Create the mrtg.cfg file

cfgmaker public@localhost > /etc/mrtg.cfg

7. Creating index file for the webserver using

indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html

8. Restart the computer

9. To run MRTG, open your browser and type:

http://localhost/mrtg/

Logs viewer can be helpful, run in the terminal

tail -f /var/log/syslog
or
tail -f /var/log/mrtg/mrtg.log

References:

http://www.debianhelp.co.uk/mrtg.htm
http://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html

Examples:
http://mrtg-pme.sourceforge.net/
http://web.csma.biz/apps/deliverytimes.shtml
http://www.webinject.org/mrtgplugin.html
http://www.cloudnet.com/~tom/mrtg/thresh.html

October 19, 2008 Posted by aes | developer | | No Comments Yet

Regular Expressions in C++ using NetBeans and Boost

Programmers will find really attractive Netbeans and its plugins. This blog focusses in how to use Regular Expressions in C++ using NetBeans and Boost. The following instructions have been tested in both Ubuntu 7.10 and 8.04

1. Install bcp which extracts the Boost libraries
sudo apt-get install bcp

2. If you haven’t installed NetBeans do so
sudo apt-get install netbeans

If the instruction above does not work, seach in Synaptic Package Manager, and if it also fails check the   Software/Sources(System/Administration)
For our particular objective, Netbeans must be version 6.0.1, so update it if required.
Install the C++ plugin from the start page

3. Now that you have installed NetBeans, C++, Boost, the only thing missing before the writing programs is setting up Boost in NetBeans

Need the path of Boost, type in the terminal: ‘whereis boost’
Usually, it is located in: /usr/include/boost
This path must be copied in: tools/options/code assistance/c++

Finally, right click in the project
Set Configuration/Manage Configuration and in Linker/Additional Options type: -lboost_regex

For additional arguments such as an input file, type in:
Run/Arguments

If you want to use just the terminal and an editor such as gedit, install bcp, and in the terminal type:

g++ -o regex_program regex.cpp -lboost_regex
./regex_program

I recommend ‘Regular Expression Plugin’ in Netbeans

In Tools/Plugin
To open: Search for regular, and install ‘Regular Expression Plugin’
Tools/Plugin/regular expression plugin

It can be also be downloaded, and after install within NetBeans

Programming Examples
http://www.onlamp.com/pub/a/onlamp/2006/04/06/boostregex.html?page=4
http://ubuntuforums.org/showthread.php?p=5862093

All about configuration
http://www.boost.org/

For windows’ folks

http://www.fischerlaender.net/development/using-boost-c-libraries-with-gcc-g-under-windows

October 11, 2008 Posted by aes | C, developer | | 1 Comment

Hard and Soft Links

Hard link

$ln path/original_file link_file

link_file is now link of original_file. It’ll be save in ~

Soft link

$ln -s path/original_directory link_directory
link_directory is now symbolic link of original_directory. It’ll be save in ~

http://lowfatlinux.com/linux-link-files-ln.html

October 11, 2008 Posted by aes | developer | | No Comments Yet

SSH

Here are the steps to configure SSH between a client and a server. Usually, the connection can be done with the use of a password. These instructions let the server connects to the client without prompting for any password.

1. In both client and server
cd ~

2. Server
keygen -t rsa

3. Client
mkdir .ssh

4. Server
scp /home/<>/.ssh/id_rsa.pub <>:/home/<>/.ssh/

5. Client
cd .ssh && cat id_rsa.pub >> authorized_keys
chmod 0700 ~/.ssh/
chmod 0600 ~/.ssh/authorized_keys

6. Test from server
ssh <>

October 11, 2008 Posted by aes | developer | | No Comments Yet

Developers2

August 27, 2008 Posted by aes | developer | | No Comments Yet

Developers

August 10, 2008 Posted by aes | developer | | No Comments Yet