Andrés Canavesi | Blog

CAT | Configuración

Wikipedia: Latex es un sistema de composición de textos, orientado especialmente a la creación de libros, documentos científicos y técnicos que contengan fórmulas matemáticas.

La idea es mostrar paso a paso de cómo levantar un entorno creación de documentos en Latex en Ubuntu. Esto incluye los paquetes necesarios para tener el “compilador” de pdf junto con un plugin de Eclipse muy útil.

Primero debemos instalar texlive. Este paquete nos instalará una conjunto básico de funcionalidades de Latex.

Desde consola: sudo aptitude install texlive
Desde el gestor de paquetes, buscar simplemente el nombre del paquete.
Sí, es bastante pesado, unos 200 MB.

También podemos instalar la versión full: texlive-full

Hay varios editores de Latex. Personalmente no me gustan los generadores de código así que prefiero formatear todo mi documento a mano. La desventaja es que al principio cuesta un poco más. Como ventaja, se gana un poco más de independencia y el código/texto queda más limpio.

Para facilitar la creación/edición utilizo un plugin para Eclipse llamado Texlipse. Se puede descargar libremente desde la propia web del plugin: http://texlipse.sourceforge.net/ y se instala como cualquier otro plugin de Eclipse.

Este plugin nos permite escribir nuestro documento e ir pasando todo el código a pdf a medida que vamos guardando.

texlipse

Fuente

, , , , , Hide


Selenium is a powerful and popular tool which can be used to test your SmartClient applications.
Selenium executes tests against your running application in a browser emulating user interaction and asserting various conditions.
Selenium provides a record/playback tool for authoring tests without learning a test scripting language. You must be familiar with
Selenium and use of Selenium IDE before proceeding. Refer to the documentation on the Selenium

site.

Use of Selenium with SmartClient applications is no different than using Selenium to write and run test cases with any other application with
the exception on on caveat. Selenium supports the concept of Locators
in order to specify the element you’d like a given Selenium command to operate on. For example Selenium supports XPath based locators, and DOM ID based locators.
XPath based locators are extremely fragile due to complexity of certain highly nested DOM elements you need access to combined with the fact that
XPath support varies across browsers and so your tests might not work across different browsers.

SmartClient occasionally renders a different DOM structure depending on the browser for performance for rendering the UI such that it appears identical across various browsers.
As a result using DOM ID or DOM XPath based locators with SmartClient applications is not advisable. Instead SmartClient supports a new Selenium
locator which is an xpath-like string used by Selenium to robustly identify DOM elements within a SmartClient application. SmartClient locators for Selenium
are prefixed by “scLocator=” and have a readable XPath like value even for cells in ListGrid’s or TreeGrids. Typically these locators will not be hand-written and
are generated by Selenium IDE, Selenium’s test recording tool.
One primary locator is based on the ID of the SmartClient widget and has the syntax ID=<Canvas ID>. This
simplifies the task of writing tests if you know the ID of the Canvas. For reference, the scLocator syntax for
ListGrid cells and DynamicForm FormItem"s can be found at the end of this document.

Setup Instructions

  • SmartClient ships with a Selenium user extension Javascript file : user-extensions.js. When running the Selenium tests make sure you place this file at the appropriate location.
    Refer to the Selenium Documentation for mode details.
  • In order to create tests, we suggest you use Selenium IDE. By default, Selenium looks for a file called “user-extensions.js”, and loads the javascript code found in that file.
    In the standard Selenium distribution, this file does not exist. You should place this file in this common location.
    Refer to the Selenium documentation if you need additional information. Once you have
    Selenium IDE installed, you will need to use the SmartClient user-extensions.js file with Selenium IDE. This is installed by
    putting the pathname to its location on your computer in the Selenium Core extensions field of Selenium-IDEÕs Options=>Options=>General tab.
    Additional Details on how this can be setup can be found here.
  • You will also need to configure Selenium IDE with a SmartClient provided Selenium IDE extensions javascript file : user-extensions-ide.js This is installed by
    putting the pathname to its location on your computer in the Selenium IDE extensions field of Selenium-IDEÕs Options=>Options=>General tab.

That’s it, we’re done configuring the environment.

Recording Selenium tests with Selenium IDE

Once you have your application running in Firefox, open Selenium IDE from the Tools ==> Selenium IDE menu option. If the Selenium IDE is in record mode,
then clicking or carrying out other operations like typing in a text field with automatically record the appropriate Selenium commands with the SmartClient locator.
There’s no need for you to manually enter the locator, the recorder does this for you! Sometimes users many want finder grain control of what Selenium command
is created instead of having the Selenium IDE recorder do this automatically. For example if you want to verify the value of a particular cell in a ListGrid.
Instead on typing in the command “verifyTable” and manually enter the SmartClient Locator (scLocator), you can simply right click on the table cell or any other
SmartClient widget and the most suitable Selenium commands will appear in the context menu along with the scLocator path for the clicked element. See image below.


Common scLocator syntax

List Grid cells

//ListGrid[ID="itemList"]/body/row[itemID=1996||itemName=Sugar White 1KG||SKU=85201400||1]/col[fieldName=SKU||1]

  • This assumes the ListGrid has an explicit ID
  • the ‘body’ part might be ‘frozenBody’ if the field in question was frozen
  • row[......] identifies the row (record)
  • itemID= – that’s the primary key field from the dataSource the grid is bound to
  • itemName= – that’s the title field value for the record
  • SKU=… – that’s the cell the user clicked’s value
  • 1 – that’s the index of the row (rowNum)
  • col[.....] – identifies the column in the grid
  • fieldName=… – field name for the field the user clicked
  • 1 – that’s the index of the column

Form Items

//DynamicForm[ID="autoTestForm"]/item[name=textField||title=textField||value=test||index=0||Class=TextItem]/element

This example is the data element (text entry box) for a text field

  • this form has an explicit ID
  • item[...] identifies the item
  • name (field name, if set)
  • title (title, if set)
  • value (current value if set)
  • index (index in the form items array)
  • Class (SC class of the item – in this case TextItem) after the “/” we identify the part of the item in question options here include:
  • “element” – the data element
  • “canvas” – for CanvasItems – points to the canvas embedded in the item
  • in this case the xpath might continue to contain, for example children of the canvas or elements within it (cells in a listGrid, etc)
  • “textbox” – the “text box” – this is the area where content is written out for items without a ‘data element’ – like header items
  • “[icon=<...>]” – the icon element — “<...>” would contain the “name”
    of the icon


Known Limitations

  • Support for multi-select for SelectItems with selection mode “grid” (non-default)
  • Support for Drag & Drop due to limitations in Selenium

, , , , Hide


Al instalar Debian desde cero el navegador de archivos que trae Gnome no es muy amigable (por lo menos para mi), este abre una nueva ventana por cada carpeta que abrimos.
Para setear por defecto la vista “file browser” vamos a Sistema->Preferencias->System profiler and benchmark
Al abrirse la ventana vamos a nautilus->preferences y tickeamos el valor que dice “always_user_browser”
Nautilus file browser

, , , , Hide


a2enmod rewrite

nano /etc/apache2/sites-enabled/000-default

/etc/init.d/apache2 force-reload

Fuente

, , Hide


Creamos el directorio donde vamos a alojar nuestro dominio.
$ mkdir /var/www/mydomain.com
Luego:
$ nano /etc/apache2/sites-available/mydomain.com
<VirtualHost *>
ServerAdmin webmaster@example.com
ServerName  www.mydomain.com
ServerAlias example.com
# Indexes + Directory Root.
DirectoryIndex index.html
DocumentRoot /var/www/mydomain.com
# CGI Directory
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>
# Logfiles
ErrorLog  /var/www/error.log
CustomLog /var/www/access.log combined
</VirtualHost>
$ a2ensite mydomain.com
Reiniciamos apache
$ /etc/init.d/apache2 restart
<img src=”http://http://portalhispano.org/wordpress/wp-content/uploads/2009/09/apache.png” alt=”apache logo” />
<a href=”http://www.debian-administration.org/articles/357#virtual_host”>Fuente</a>

Creamos el directorio donde vamos a alojar nuestro dominio.
$ mkdir /var/www/mydomain.com
Luego:
$ nano /etc/apache2/sites-available/mydomain.com
<VirtualHost *>        ServerAdmin webmaster@example.com        ServerName  www.mydomain.com        ServerAlias example.com
# Indexes + Directory Root.        DirectoryIndex index.html        DocumentRoot /var/www/mydomain.com
# CGI Directory        ScriptAlias /cgi-bin/ /var/www/cgi-bin/        <Location /cgi-bin>                Options +ExecCGI        </Location>

# Logfiles        ErrorLog  /var/www/error.log        CustomLog /var/www/access.log combined</VirtualHost>
$ a2ensite mydomain.com
Reiniciamos apache
$ /etc/init.d/apache2 restart
<img src=”http://http://portalhispano.org/wordpress/wp-content/uploads/2009/09/apache.png” alt=”apache logo” />
<a href=”http://www.debian-administration.org/articles/357#virtual_host”>Fuente</a>

, , Hide


Una de las tantas cosas que hago muy de vez en cuando y que siempre me olvido de la sintaxis correcta.

Creamos un directorio para el nuevo usuario

$ mkdir /home/andres

# useradd andres -d /home/andres

# passwd andres

No tags Hide


Utilizo la distribución Ubuntu debería ser muy similar en otras distribuciones.

Hay varios servidores FTP, el que yo uso se llama vsftpd

# aptitude install vsftpd

Editamos el archivo de configuración en el cual tendremos que editar algunas propiedades, es bastante intuitivo.

# nano /etc/vsftpd.conf

Otra alternativa es pure-ftpd

# aptitude install pure-ftpd

Luego de instalado agregamos un usuario (en este caso no es un usuario virtual):

pure-pw useradd andres -u ftp -g ftp -d /home/andres -t 25 -T 25 -c “andres”

Fuente

, , , , Hide


Yo utilizo Ubuntu que está basado en Debian. Si utilizas otra distro como Suse o Fedora, no debería ser muy diferente (mas que nada la parte de instalar nuestros programas).

Abro una consola:

# Instalo SVN
sudo apt-get install subversion

# Directorio para los repos
mkdir -p /algun/directorio/repos

# Crear el repo
svnadmin create /algun/directorio/repos

# doy permisos al servidor web
chown -R www-data:www-data /algun/directorio/repos

# instalo el modulo de apache necesario
apt-get install libapache2-svn

# editar el archivo: /etc/apache2/mods-available/dav_svn.conf y escribe:
<Location /svn>

DAV svn

SVNPath /algun/directorio/repos

AuthType Basic

AuthName “SvnRepo”

AuthUserFile /etc/apache2/dav_svn.passwd

Require valid-user

</Location>
# para agregar usuarios:
htpasswd -c /etc/apache2/dav_svn.passwd usuario1

Luego para agregar otro usuario debemos quitar el parámetro -c para que no vuelva a crear el archivo.

Quedaría entonces

htpasswd  /etc/apache2/dav_svn.passwd usuario2

# reinicia apache:

/etc/init.d/apache2 restart

Luego para chequear si todo funciona bien, abre un navegador y tipea http://localhost/nombre_del_repo

Ya estamos listos para utilizar nuestro repositorio!

Luego para manipularlo hay varias herramientas, entre ellas, la propia consola, el plugin de Eclipse (el cual uso) e incluso existen aplicaciones gráficas que he porobado y andan muy bien como ser RapidSVN y especialmente una herramienta que se integra bien con Nautilus que se llamada justamente NautilusSVN

Algunos comandos básicos.

, Hide


Find it!

Theme Design by devolux.org