Showing posts with label Linux - Programming. Show all posts
Showing posts with label Linux - Programming. Show all posts

Monday, December 24, 2012

Install and configure Trac in alwaysdata.com web site

I followed this steps to install Trac in the alwaysdata.com web site:

The main manual is from this page:

http://forum.alwaysdata.com/viewtopic.php?pid=3218#p3218

PYTHONPATH=~/modules easy_install-2.5 --install-dir ~/modules Genshi==0.6
PYTHONPATH=~/modules easy_install-2.5 --install-dir ~/modules Trac==1.0
./trac-admin /home//www/trac/myproject initenv
./trac-admin /home//www/trac/myproject deploy /tmp/deploy 
mv /tmp/deploy/* /home//www/trac
 
Section 5: Small modification
#!/usr/bin/eval PYTHONPATH=/home//modules TRAC_ENV=/home//www/trac/myproject python

Section 6: Small modification
AddHandler fcgid-script .fcgi

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ cgi-bin/trac.fcgi/$1 [QSA,L] 

I also had to solve some issues reported here:
http://forum.alwaysdata.com/viewtopic.php?id=1601

To configure Trac authentication (Trac works with apache authentication) I followed:
http://trac.edgewall.org/wiki/TracModWSGI#ConfiguringAuthentication

$ htpasswd -c /somewhere/trac.htpasswd admin
New password: 
Re-type new password: 
Adding password for user admin


$ htpasswd /somewhere/trac.htpasswd john
New password: 
Re-type new password: 
Adding password for user john

The final .htaccess file is the following:
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ cgi-bin/trac.fcgi/$1 [QSA,L]

    AuthType Basic
    AuthName "trac"
    AuthUserFile /home//www/trac/trac.htpasswd
    Require valid-user

Sunday, August 5, 2012

Agile methodologies and Rails

I have found a very interesting online course called Software as a Service in which you are introduced to agile methodologies and Rails programming.

It can be followed here: https://www.coursera.org/courses

Here there is information about the course book and other important information (the assignments are thought to be done working in a virtual machine, which is available there also): http://beta.saasbook.info/bookware-vm-instructions

Thursday, June 14, 2012

What is big data?

The best definition I've found in the net:

Big Data is a term used to describe large collections of data (also known as datasets) that may be unstructured, and grow so large and quickly that it is difficult to manage with regular database or statistics tools.

Saturday, February 11, 2012

How to redirect output to screen and a file

With the command tee (in Linux) or the command wtee (in Windows)

Example (in Linux)

ls | tee output.txt

Example (in Windows)

dir | wtee > output.txt

Saturday, December 3, 2011

More than 50 cheat sheets for web projects and other programming languages

In this page we can find a fantastic recopilation of cheat sheets for distinct programming languages and web specifications.

http://eomblog.blogspot.com/2011/11/57-estupendas-chuleta-cheat-sheets.html

The full blog is interesting, so we add the url of it.

http://eomblog.blogspot.com/

Thank you to the author for sharing all this information!

Sunday, August 15, 2010

How to find the package where a file is?

You can search for an ubuntu package containing a specific file (such as "algorithm.sty") by going to http://packages.ubuntu.com/. Scroll down to where it says "Search the contents of packages".

Thursday, July 29, 2010

Com contolar processos que funcionen en mode text - Screen

Screen és un programa que permet (entre altres coses) controlar processos que funcionen en terminals remotament.

Funciona de la següent manera:

- Obrim una finestra, (que controlarem remotament). Per a fer-ho, des d'un terminal executem:
screen

- Obrim altres finestres des d'aquesta, des d'on podem cridar nous processos
Ctrl A + c (de create)

- Per a desacoblar les finesters
Ctrl A + d (de dettach)

Ara el terminal no conté els processos, i obrint-ne un altre els podem recuperar:
screen -r (de recover)

Per a més info: http://www.kuro5hin.org/story/2004/3/9/16838/14935

Thursday, July 22, 2010

Codificació de caràcters UTF-8 / ISO-8859-1

La codificació de caràcters pot portar molts problemes.
Aquí explica com s'ha de fer per convertir tot el sistema a UTF-8

http://www.oreillynet.com/onlamp/blog/2006/01/turning_mysql_data_in_latin1_t.html

Friday, June 11, 2010

Linux - Servidor - Carpetes

Engegar / Aturar el servidor Apache

/etc/init.d/apache2 start | stop | restart

Directori on afegir els fitxers

/var/www

Si no volem moure els fitxers de dins un directori a aquest directori, podem fer un softlink de la següent manera

ln -s /path/OrigDir /var/www/newDir

Instalation of Freeling - Language Processing Tools in Ubuntu 9.10

Documentation is found in Freeling installation page. However, I've had several problems when following the described steps.

I followed the installation from .tar.gz source packages. Here I will describe the differences between what I did and the explanation from the .tar.gz installation page.

1. Install development tools

Ok

2. Install packaged requeriments
I installed the following package instead of
sudo apt-get install libboost-dev
sudo apt-get install libboost1.40-all-dev
(due to problems with libboost-filesystem)

3. Install non-packaged requeriments

Ok

4. Install Freeling
Previous installations OK
Installation of Freeling
sudo ./configure
sudo make
sudo make reported a bug when using libtool. I solved them by following the explanation of here. Basically, with the addition of these lines in file Freeling/libtool
# An echo program that does not interpret backslashes.
ECHO="echo"
+#well this $ECHO is referred to as $echo everywhere in this file. So:
+echo="$ECHO"

# Used to examine libraries when file_magic_cmd begins with "file".
MAGIC_CMD=file

sudo make
sudo make install
Problems with freeling/data/Makefile.am. I solved them by following the explanation of here.
Basically, with the Modification of all lines like
asdata_DATA = es/*
to
asdata_DATA = es/*.*
These lines refer to asdata, cadata, esdata, gadata, commondata, itdata... (one for each lang).
sudo make install
Now all was ok!

Examples
In the directory Freeling/src/main/simple_examples/
g++ -o sample sample.cc -ldb_cxx -lmorfo -lfries -lomlet -lpcre
I needed to add the library lboost_filesystem
g++ -o sample sample.cc -ldb_cxx -lmorfo -lfries -lomlet -lpcre
-lboost_filesystem

Error d'execució al carregar una llibreria

L'error era aquest: la llibreria estava posada a una ruta errònia. Poso l'explicació que m'ha servit.

liblablabla.so.5: cannot open shared object file: No such file or directory

Problem: An application is running on Linux 7.x which uses gcc 3.2.x. It gets one of the following error messages:

libstdc++.so.5: cannot open shared object file:
No such file or directory
libgcc_s.so.1: cannot open shared object file:
No such file or directory
Explanation: libstdc++.so.5 (the library for gcc 3.2.x) is installed in /usr/local/lib However, the system will only seach /usr/lib (where the 2.95.0 and other older libraries are stored).

Solution: Create symbolic links to make the libraries appear in the old folder:

ln -s /usr/local/lib/libblablabla.so.5
/usr/lib/libblablabla.so.5
ln -s /usr/local/lib/libblablabla.so.1
/usr/lib/libblablabla.so.1

Programes informàtico-matemàtics

Llibreria per al càlcul de VAPS i VEPS molt grans: ARPACK (en Fortran), ARPACK++ (interfície per a C++)
  • Per a Ubuntu hi ha un paquet deb.

SIMPLEX - Programació lineal
  • CPLEX: El millor, de pagament
  • GLPK: Free software, va bé. Implementat en C++, té una interfície en R. Els problemes s'especifiquen en MATHPROG, un llenguatge per a especificar problemes.
  • COIN-OR: Free software

Programes matemàtics gratuïts

Software educatiu

Eines AUTO per a la compilació de projectes

Al directori arrel /
configure.in
Makefile.am
A cada carpeta
Makefile.am
Executem
aclocal : arxiu aclocal.m4 amb macros
autoconf : configure.in -> scripts configuració
automake -a (--foreign) : Makefile.am -> Makefile.in
autoheader : Plantilla configure
Finalment
./configure
make