Archive

Archive for the ‘Interoperability’ Category

Howto connect OpenMeetings 2 or 3 with Chamilo LMS 1.9.8

Chamilo LMS 1.9.8 comes with an OpenMeetings plugin. This means that you can organize OpenMeetings videoconference rooms directly from your Chamilo courses.

Now this setup requires a few essential things. The 2 most important are: a working installation of Chamilo (referenced as [C] below) and a working installation of OpenMeetings (referenced as [OM] below), then you need to have:

  • [CH] php5-curl extension installed and running
  • [OM] a user with web services privileges
  • [CH] to configure host, user and password (or salt) inside the “plugins” section, button “Configure” of the OpenMeetings plugin

This is pretty much it, but if you are missing one of these, that won’t work!

Using Chamilo juju charm to setup a dev environment on Digital Ocean

June 23, 2014 8 comments

If you’re in a hurry/on speed, know this:

  • this procedure is slightly more difficult (so longer) than installing the charm on Amazon
  • you can skip directly to “Installing Juju”
  • if you already have juju installed, you can skip to the last 2 lines of the “Installing juju” section
  • if you already have juju-docean installed and configured, you can skip directly to “Provisioning VMs”
  • otherwise, just continue reading, it’s worth a few minutes…

This tutorial regroups a lot of advanced notions, so if you want to know more about one of the following elements, please follow these links:

Before anything else, please note that the following is highly experimental. There are still a series of issues that should be worked out in order to make this process failproof.

Basic setup

Before we start using commands and stuff, you’ll have to note the following:

  • We are using a Chamilo Charm developed by José Antonio Rey (kudos to him) as a voluntary contribution to the project
  • Charms are configurations to install applications (and stuff) inside the Juju framework
  • The Juju framework is developed by the Ubuntu team, so we’re using an Ubuntu (14.04) desktop (or in this case laptop) to launch all the following
  • Digital Ocean is one cloud hosting provider, which is particularly cheap and good for development purposes. The “default” environment for Juju is Amazon, so we’ll have a few additional steps because of this choice. The Digital Ocean plugin to Juju is developed by geekmush on Github, and as far as I know he is not related to either Ubuntu nor Digital Ocean, so he is also worth praising for his contribution
  • Chamilo requires a web server and a database server. In this Charm, it is assumed that we want both of these on separate virtual machines, so you will need two of them (unless you change the parameters a little)
  • Juju is written in Go but relies on several Python libraries. As such, you’ll have to have python installed on your system and maybe Juju will shout because it is missing a few dependencies. Notably, I installed python3-yaml to avoid a few warnings (it is required for the following, although the installer for Juju says it’s optional)

Installing Juju

On a default Ubuntu desktop installation, you’ll have to install Juju first. Because we are going to use Juju connected to Digital Ocean, we need a recent version of Juju, so let’s add it the unconventional way (with the ppa), launching the following on the command line:

sudo add-apt-repository ppa:juju/devel
sudo apt-get update && apt-get install juju
juju version

For some reason, in my case, this created my home directory’s .juju/ folder with root permissions, which then prevented me to reconfigure my environment (requirement for the Digital Ocean Juju plugin), so I changed permissions (my user is “ywarnier”, so change that to your user):

sudo chown -R ywarnier:ywarnier .juju

Then we need to install the juju-docean plugin:

sudo apt-get install python3-yaml
sudo pip install -U juju-docean

Setting up Digital Ocean access

Now we need to configure our Digital Ocean (D.O.) API so the system will be able to call D.O. in our place and create instances (and stuff).

You first need to grab your API key, client ID and SSH key ID from the Digital Ocean interface. You can do that from the Digital Ocean API page. Obviously, you need a Digital Ocean account to do this and a few bucks of credit (although you can get $10 free credit from several places). If your API key says “Hidden”, that’s because you must have it stored somewhere already (for other services?). If you don’t, you’ll have to re-generate one. Your SSH key ID is the name you gave to the SSH key you use from your computer to connect to your new instances. If you don’t have it, that’s probably because you haven’t configured any. Please do in the “SSH Keys” menu item on the left side of your D.O. panel.

 export DO_CLIENT_ID=aseriesof21alphanumericalcharacters
 export DO_SSH_KEY="user@computer"
 export DO_API_KEY=aseriesof32characters

Setting up the Digital Ocean Juju environment

Now we need a bit of manual config to be able to use Digital Ocean (last bit, promised). Edit the ~/.juju/environments.yaml file and paste the following:

environments:
 digitalocean:
 type: manual
 bootstrap-host: null
 bootstrap-user: root

Just a note: the “type: manual” line implies it is a bit more complicated than on amazon later on, and we will have to launch a few more commands to provision new machines *before* we deploy Chamilo.

Generating the Juju environment

Now we’re going to create our Juju controller. The Juju controller can be an independent Virtual Machine (VM), or it can be the same as the one on which you will deploy Chamilo. It all depends on your budget and your requirements.

juju docean bootstrap --constraints="mem=1g, region=nyc1"
  2014/06/22 11:50.24:INFO Launching bootstrap host
  2014/06/22 11:51.29:INFO Bootstrapping environmen

Note that we took a decision to use a 1GB (RAM) VM here (mem=1g), in a datacenter in New York (region=nyc1). For the record, I tried creating them in nyc2, which is also a valid D.O. datacenter, but it failed miserably (sometimes not creating the VM, sometimes creating it without IP, sometimes creating it fully, but in the end never returning with a proper success response for my environment to be created), so sticking to nyc1 is probably a reasonable time-saver.

Provisioning VMs

To be able to deploy Chamilo, we’ll use two VMs: one for the web server and one for the database

juju docean add-machine -n 2 --constraints="mem=1g, region=nyc1"
2014/06/22 12:44.59:INFO Launching 2 instances
2014/06/22 12:46.42:INFO Registered id:1908893 name:digitalocean-8d14c9bc671555ff872d8d6731f84d68 ip:198.199.82.172 as juju machine
2014/06/22 12:49.08:INFO Registered id:1908894 name:digitalocean-a9ba29cfe55549f58e5f7e365199c5ed ip:208.68.39.19 as juju machine

Now, the “-n 2” above allows you to create these 2 instances, but you could also launch 2 different instances of different properties, doing it one by one. In our case, I suggest you use version Trusty of Ubuntu for the MySQL machine, to avoid a little bug in the Precise version of the charm:

juju docean add-machine --constraints="mem=2g, region=nyc1"
juju docean add-machine --series=trusty --constraints="mem=1g, region=nyc1"

The important thing here being that you can later identify the machine itself by a simple ID, using juju status:

juju status
environment: digitalocean
machines:
 "0":
  agent-state: started
  agent-version: 1.19.3
  dns-name: 192.241.142.154
  instance-id: 'manual:'
  series: precise
  hardware: arch=amd64 cpu-cores=1 mem=994M
  state-server-member-status: has-vote
 "1":
  agent-state: started
  agent-version: 1.19.3
  dns-name: 198.199.82.172
  instance-id: manual:198.199.82.172
  series: precise
  hardware: arch=amd64 cpu-cores=1 mem=994M
 "2":
  agent-state: started
  agent-version: 1.19.3
  dns-name: 208.68.39.19
  instance-id: manual:208.68.39.19
  series: trusty
  hardware: arch=amd64 cpu-cores=1 mem=994M

If you made a mistake at some point or just wanna try things out, you can destroy these instances with

juju docean terminate-machine 1

where “1” is the ID of the machine, as shown above before each of them.

Deploying Chamilo

Now we’ve got our machines, we just need to deploy the Chamilo Charm and the MySQL Charm (you need MySQL to run Chamilo):

juju deploy cs:~jose/chamilo --to 1
juju deploy mysql --to 2

Please note that the “–to n” option is to specify on which machine you want to deploy the selected service.

Now, we need to configure Chamilo a little. We’re going to give it a domain name (you’ll have to redirect this domain name to the IP of the first machine – the one with the Chamilo service – in order to use it when ready) and a password for the “admin” user (the user created by default):

juju set chamilo domain=test.chamilo.net pass=blabla

Now we still need to tell Juju to link the Chamilo service with the MySQL service:

juju add-relation chamilo mysql

And finally, apply all the above and expose the chamilo service to the public:

juju expose chamilo

If something goes wrong with a service, you can always remove it with:

juju destroy-service chamilo

You can replace “chamilo” by the service with which you are having the issue, of course. If that doesn’t work out, you can always remove (terminate) the machine itself (see above).

Useful tricks

You can connect at any time to any of your virtual machines through the command

juju ssh chamilo/0

where “chamilo/0” is the name appearing below “units” in your services.

You can check the status of all your instances with

juju status

Note that, sometimes, you might end up with dozens or hundreds of instances. In this case, it won’t be as practical to show the status of all instances (I have no solution for that now, but I’m sure there is a way to filter the results of a juju status).

You can launch a command on the virtual machines’ command line like this:

juju run --service chamilo "tail /var/log/juju/unit-chamilo-0.log"

This way, you are actually executing the command remotely and getting the results locally.

You can also see the error log locally, connecting in SSH (first) and then launching:

 tail /var/log/juju/unit-chamilo-0.log

Obviously, that gives you a little more flexibility.

Notes about unexpected errors

One of the “silent” things is that Juju considers the default machine to be Ubuntu Precise. In the case of MySQL, the default Charm is configured for Trusty. This means that if you want to install this package, you need to install a virtual machine in Trusty. Otherwise, you might get some other issues. In my case, the Precise Charm didn’t really work (missing yaml), so I decided to go for Trusty.

You can choose the distribution of your machine with –series=trusty, for example:

juju docean add-machine --series=trusty --constraints="mem=2g, region=nyc1"

We tested the chamilo charm relatively extensively.

Unmounting the whole thing

If this was just a test, and you’re happy, maybe you want to remove everything. If so, the quickest way to do that is to launch a destroy-environment command, but you will first need to destroy each machine and, before that, each services that :

juju destroy service chamilo mysql
juju destroy machine 1 2
juju destroy-environment digitalocean

This should reasonnably quickly remove the whole setup.

You should still check your Digital Ocean’s dashboard, though, as apparently it doesn’t always delete the nodes you created with Juju…

Quick commands list for the impatient

Assuming you’re running Ubuntu 14.04 and that you know which values to change in the commands below:

sudo add-apt-repository ppa:juju/devel
sudo apt-get update && apt-get install juju
sudo chmod -R 0700 .juju
sudo apt-get install python3-yaml
sudo pip install -U juju-docean
export DO_CLIENT_ID=aseriesof21alphanumericalcharacters 
export DO_SSH_KEY="user@computer" 
export DO_API_KEY=aseriesof32characters
juju docean bootstrap --constraints="mem=1g, region=nyc1"
juju docean add-machine --constraints="mem=2g, region=nyc1"
juju docean add-machine --series=trusty --constraints="mem=1g, region=nyc1"
juju deploy cs:~jose/chamilo --to 1
juju deploy mysql --to 2
juju set chamilo domain=test.chamilo.net pass=blabla
juju add-relation chamilo mysql
juju expose chamilo

And connect your browser to test.chamilo.net (that you must have redirected to the corresponding IP first) and login with admin/blabla.


								

Howto install OpenMeetings 2.2 server on a Debian Wheezy box

December 30, 2013 30 comments

This guide is written specifically to cover a lack of quality documentation for the installation procedure of an OpenMeetings 2.2 server on a Debian Wheezy box.

It will be based on the manual available already for this procedure (but relatively badly structured and written in a rather improvable English), by Alvaro Bustos with the help of Federico Christian Tomasczik. Thanks to both of them. My manual is mostly a rewrite of the information in their guide, hopefully with enough precision to allow someone to script it. Also the fact that the guide is only available publicly as PDF is not ideal. Finally, there is a lot of space for interpretation in the dynamic links provided which, in my case, made me mistakenly go for 3.0 instead of my intended 2.2, which had considerable consequences in the particular task I was trying to achieve: write an OpenMeetings plugin for Chamilo.

Because that’s probably the easiest way to do it for anyone reading this manual, I will be explaining on the basis of a Digital Ocean virtual machine (or “Droplet”). I found that the $40/month (4GB of RAM) image works fine, but you can try with a 2GB one, maybe that works out too.
If you never tried Digital Ocean before, you have two options:

      You create an account, pay $20 in advance with PayPal, create a new Droplet, choose Debian Wheezy 64bit (I picked New York 2 Data Center, but it *really* shouldn’t matter where it is) and jump to the beginning of this tutorial or
      Find a machine where you can install Debian Wheezy (either virtual or physical), make sure it’s got an internet connection and start working

And of course, any Debian Wheezy machine would do.

For the sake of simplicity, I’ll assume you got root access to it.
I’ll also pass the OpenMeetings “client” install. If you don’t know how to install Flash, you should look for that information somewhere else.

I usually use VIM as an editor, so if the Debian box is new, I install vim:

apt-get update
apt-get install vim

Finally, I’ll assume that your server is available through a simple IP address or a domain name. Below, I will assume a ficticious URL of “video.openmeetings.net”. Replace that string with yours however you see fit.

Without further ado, let’s begin.

For some reason, Red5 seems to be failing to start when it cannot find a fully qualified domain name (FQDN) for the server on which it runs. To avoid this, simply put the right (or a fake) domain name in /etc/hosts, at the end of the first line. Following the logic above, I’m calling it video.openmeetings.net. Feel free to call it whatever you like, but try to use something that isn’t used by anyone else:


127.0.0.1 localhost video.openmeetings.net

Create an /etc/apt/sources.list.d/openmeetings.list with the following contents:

deb-src http://http.debian.net/debian/ wheezy main
deb http://http.debian.net/debian/ wheezy contrib non-free
deb http://http.debian.net/debian/ wheezy-updates main contrib
deb-src http://http.debian.net/debian/ wheezy-updates main contrib
deb http://www.deb-multimedia.org wheezy main non-free

Create an /etc/apt/sources.list.d/oracle-java.list with the following contents (because OpenMeetings does not officially support OpenJDK yet):

deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main

Then do the following (on the command line):

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update && apt-get install -y --force-yes deb-multimedia-keyring oracle-java6-installer

You’ll have to agree to the Oracle Binary Code license terms with the last command (in the oracle-java6-installer). This is manual (as far as I know, there is no way to automate it).

Now, we want to make sure this installed version of Java will be the one used for the rest of the processes on this server, by updating the alternatives and picking the one that says java-6-oracle and “jre” in the same path:

update-alternatives --config java

If this is a new, clean, server, the command will only mention that there is only one alternative, so that there is nothing to select.

You may want to also automatically set the environment variable, feature which is provided by the following package in WebUpd8’s repository:

apt-get install oracle-java6-set-default

Now we want to install Libreoffice, as it will be used by JODconverter (installed below) to convert documents:

apt-get install -y --force-yes libreoffice

On Digital Ocean’s machines, the download is super-fast (around 10 seconds for 450MB) and the whole installation should take about 30 seconds max.

We also need to install a few conversion libraries:

apt-get install -y --force-yes imagemagick libgif4 libjpeg62 libmp3lame0

…and the SWFtools (this is one of the trickiest parts for Debian/Ubuntu installations, but luckily someone packaged it)

cd
wget http://assiste.serpro.gov.br/libs/swftools_0.9.1-1_amd64.deb
dpkg -i swftools_0.9.1-1_amd64.deb

Note: for 32bit, you’ll have to download http://assiste.serpro.gov.br/libs/swftools_0.9.1-1_i386.deb

Now the ffmpeg library needs to be installed by hand in order to get access to a more recent version of the lib. In effect, Debian Wheezy “deb-multimedia” repository’s version is 1.0.8 and we’d like to get 1.1.2. Note that, during the “make” process (which might take more than 10 minutes), you can continue the installation with the other steps in a parallel terminal. Just don’t forget, at the end, to launch the checkinstall process.


apt-get install -y --force-yes libart-2.0-2 libt1-5 zip unzip bzip2 subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libsdl1.2-dev libx11-dev libxfixes-dev libxvidcore4 libxvidcore-dev zlib1g-dev libogg-dev sox libvorbis0a libvorbis-dev libgsm1 libgsm1-dev libfaad2 flvtool2 lame
cd /opt
wget http://ffmpeg.org/releases/ffmpeg-1.1.2.tar.gz
tar zxf ffmpeg-1.1.2.tar.gz
cd ffmpeg-1.1.2
./configure --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-libgsm --enable-gpl --enable-nonfree
make
mkdir /usr/local/share/ffmpeg /usr/local/share/man /usr/local/include
checkinstall

The “make” command is probably the step that will take the most time of the whole installation (around 12 minutes, just by itself).

Press “Enter” 3 times to select the default options suggested by the installer.
This will (slowly) make a Debian package (ffmpeg_1.1.2-1_amd64.deb) and install it (as I mentioned, this might take more than 12 minutes on the suggested virtual machine).

It is suggested you “hold” this package version, to prevent Debian from trying to update it during the next apt-get upgrade. To do this:

apt-mark hold ffmpeg

At this point, feel free to delete everything you want from the /opt directory where we downloaded and built the ffmpeg package:

rm -rf /opt/ffmpeg*

Install the MySQL server (there is a default database used by OpenMeetings but it’s not meant for production).

apt-get install mysql-server

Give it a root password (twice). Note that it’s considered *really bad practice* to leave a blank password, so please think about something simple and safe instead of avoiding your responsibility. It also has nothing to do with system’s root password.

Connect to MySQL to prepare the openmeetings database:

mysql -uroot -p
mysql> CREATE DATABASE openmeetings DEFAULT CHARACTER SET 'utf8';
mysql> GRANT ALL PRIVILEGES ON openmeetings.* TO 'openmeetings'@'localhost' IDENTIFIED BY 'some-password-here' WITH GRANT OPTION;
mysql> quit

Now we’re ready to install OpenMeetings. You should get the latest stable version from here: http://openmeetings.apache.org/downloads.html
Other sources are likely to be less stable and I certainly did loose a lot of time on this, so I definitely recommend the stable. The following code is based on the stable that was downloadable at the time of writing, so you might want to check the link above. Beware that the link above does not provide a direct link for the download: it sends you to a mirrors page, from which you’ll have to pick a mirror. The command below downloads it directly from one of the mirrors.

mkdir /opt/red5
cd /opt/red5
wget http://www.webhostingjams.com/mirror/apache/openmeetings/2.2.0/bin/apache-openmeetings-2.2.0.tar.gz
tar zxf apache-openmeetings-2.2.0.tar.gz
rm apache-openmeetings-2.2.0.tar.gz
cd webapps/openmeetings/WEB-INF/classes/META-INF/
mv persistence.xml persistence.xml-ori
mv mysql_persistence.xml persistence.xml
vim persistence.xml

For the sake of copy-paste speed, you can launch all but the last command in one go with:


mkdir /opt/red5 && cd /opt/red5 && wget http://www.webhostingjams.com/mirror/apache/openmeetings/2.2.0/bin/apache-openmeetings-2.2.0.tar.gz && tar zxf apache-openmeetings-2.2.0.tar.gz && rm apache-openmeetings-2.2.0.tar.gz && cd webapps/openmeetings/WEB-INF/classes/META-INF/ && mv persistence.xml persistence.xml-ori && mv mysql_persistence.xml persistence.xml

vim persistence.xml

Here is where you’ll have to configure the XML file to set the db name, username and password for the openmeetings database we created above.
Find the “Url=” part. A few lines below, you’ll find a Username and a Password fields. Place the right ones there and save (with :wq if using VIM).


, Username=openmeetings
, Password=some-password-here" />

Now we’ll install the Java to MySQL connector (MySQL Connector/J aka MySQL JDBC).

cd /opt
wget http://ftp.sunet.se/pub/databases/relational/mysql/Downloads/Connector-J/mysql-connector-java-5.1.28.tar.gz
tar zxf mysql-connector-java-5.1.28.tar.gz
cp mysql-connector-java-5.1.28/mysql-connector-java-5.1.28-bin.jar /opt/red5/webapps/openmeetings/WEB-INF/lib/mysql-connector-java.jar
rm -rf mysql-connector*

Download the JOD converter to be able to convert files uploaded to OpenMeetings. Note that we’ll leave it into /opt for now, as OpenMeetings allows us to select the source for this converter. Also note that the version we download is version 3, while the one available in Wheezy is version 2.2.2 (I have no idea if this is relevant, but considering it is not to be installed or anything, the effort is not really worth the question in this case).


cd /opt
wget http://jodconverter.googlecode.com/files/jodconverter-core-3.0-beta-4-dist.zip
unzip jodconverter-core-3.0-beta-4-dist.zip

Newer versions might come in the future, so make sure you check http://code.google.com/p/jodconverter/downloads/list for any other version.

Now our red5 folder is ready to be put online, so we’ll move it to somewhere more permanent.

mv red5 /usr/lib
chown -R nobody /usr/lib/red5

Starting and stopping OpenMeetings is kind of complex, because there are several services involved. Luckily, someone wrote a script for us which, although not perfect, will help us solve this problem quickly:

wget https://cwiki.apache.org/confluence/download/attachments/27838216/OpenMeetings+2.x+run+script+Squeeze.zip?version=1
unzip OpenMeetings+2.x+run+script+Squeeze.zip\?version\=1


mv OpenMeetings\ 2.x\ run\ script\ Squeeze/red5 /etc/init.d/
chmod +x /etc/init.d/red5

And then we can finally start OpenMeetings (or should I say the Red5 server, which serves OpenMeetings):

/etc/init.d/red5 start

Now load it from your browser on http://video.openmeetings.net:5080/openmeetings/install and follow the information carefully.
Please note that the database doesn’t have to be configured through the web interface: it’s already been done in the XML file (remember?).

You will have to indicate the paths to the different conversion services, though.
To do this, you only need to know the following:
FFMPEG Path = /usr/local/bin
JOD Path = /opt/jodconverter-core-3.0-beta-4/lib

This should be enough for you to complete the installation and be able to use OpenMeetings! Have fun!

Bonus: if you want your server to be able to send e-mails, do the following:

apt-get install exim4
dpkg-reconfigure exim4-config

And then type “Enter” for every question except the one with 5 options beginning with “Internet sites”. There, you should select the first option “Internet sites” if you don’t know better, of course. Then go on with just “Enter” through it until you’re back on the command line.

1 laptop + 2 lcd = 3 pantallas para un solo escritorio, bajo Linux

December 18, 2013 Leave a comment

Por los que están interesados en aumentar su capacidad de visualización de aplicaciones en su lugar de trabajo, los costos empiezan a ponerse democráticos (pantalla 19″ alrededor de $100, adaptadores también) para extender su laptop no con una pantalla más, sino con 2.

El tema es que las cosas todavía no son “tan” sencillas (pero deberían serlo dentro de muy poco) para usuarios de Linux, porque el kernel 3.11 (el estable usado en Ubuntu 13.10) no tiene un muy buen soporte para el tipo de extensión necesario.

No os preocupeis demasiado, que el kernel 3.12 en realidad es muy sencillo instalar, gracias a nuestros amigos de Ubuntu Handbook, quienes nos dan una lista de 4 comandos que entrar en una terminal para actualizar Ubuntu 13.10 al kernel deseao. Bueno, ojo que conlleva unos riesgos, ya que podría no funcionar bien su Ubuntu con este kernel (depende mucho del hardware que uno tenga, y de los drivers que fueron instalados en este), pero de generar problemas, basta con ir a ver las opciones avanzadas de arranque de Ubuntu, seleccionar el kernel anterior (3.11) en modo normal, para volver al modo anterior y desinstalar el kernel no funcional.

En mi caso particular, como lo iba a explicar, funcionó todo bien. Seguí las instrucciones del blog de Ubuntu Handbook y reinicié mi máquina, y ya funcionó la tercera pantalla. Demostración? Aquí va…Image

(la captura está en francés, pero ya os dais una idea de lo que representa)

Entonces, cual es lo que teneis que hacer ahí? Pues es bastante simple…

Primero, hay que tener una computadora (cualquiera) con Ubuntu instalada (Debian va también), una pantalla adicional (no es necesario tener 2, pero si solo teneis una, no importa mucho fregarse todo este procedimiento) y, muy importante, un adaptador USB a VGA (o DVI).

Por ejemplo, yo me compré un Trendnet TU2-DVIV por alrededor de 50€ en una tienda cercana y me funciona bien.

Una vez todo este material listo, quizás querais probar sin actualizar el kernel. Con suerte, funciona: solo hay que prender la pantalla, conectar el cable VGA al adaptador y enchufar el otro lado del adaptador en el puerto USB de la compu. De ahí es probable que haya que ir a Configuración -> Monitores para dar clic en “Detectar pantallas”, y luego (clic en la tercera pantalla detectada) activar esta nueva pantalla (no se porque, en mi caso no se había activado sola).

Si no se detecta ninguna nueva pantalla, hay que actualizar el kernel al 3.12. Para esto, seguir el procedimiento del Ubuntu Handbook descrito arriba, reiniciar e ir a la sección Configuración -> Monitores y (me repito) activar esta tercera pantalla. Quizás reposicionarlas un poco, y listo!

Espero haya sido útil para los que no tienen idea de como hacerlo (como yo hace una semana). Ojo que se puede poner más de una pantalla via USB, dependiendo de la cantidad de puertos libres que tiene.

Correo de lectores – Desarrollo de modelo de negocios

October 25, 2013 Leave a comment

Un lector nos escribe:

“Queria hacerte una pregunta sobre los modelos de comercializacion para el chamilo, ya que conozco una compañia de un amigo, que quiere distribuir chamilo pero no bajo la licencia GPL. Queria saber si la empresa BeezNest, tiene algun modelo de comercializacion alternativo para el Chamilo tipo open source, licencia BSD o alguno similar en donde el cliente pague una licencia por el uso del sistema y que el codigo fuente sea opcional entregarlo.”

Mi respuesta:

“Hola estimado,

Chamilo *no se puede* distribuir bajo ninguna otra licencia que GNU/GPLv3 o superior. Es una infracción legal tratar de hacerlo de otro
modo, así que te recomiendo sugieres a tu amigo verificar sus derechos según la licencia.

Por lo tanto, tratando de modificar este modelo, tu amigo se transformaría automáticamente en un enemigo del proyecto Chamilo, lo que dudo que quiera hacer. Si desea desarrollar un modelo de este tipo, deberá apuntar a soluciones no libres, tipo e-ducativa, Blackboard, Desire2Learn, e-Doceo, etc. No se puede obtener los beneficios de un producto de software libre (por ejemplo en este caso actuar de manera independiente) y al mismo tiempo los de un producto de software privativo (en este caso vender la licencia).

Queda terminadamente prohibido por la licencia. Eso es para el aviso importante (me hizo abrir los ojos bien grandes lo que leí).

De otro lado, el proyecto Chamilo es un proyecto de software libre radical: no acepta ninguna parte que no esté bajo licencia de software libre. Acepta la inclusión de otras licencias consideradas de software libre y compatibles con GNU/GPLv3 según la Free Software Foundation, pero su calidad surge de esta visión radical: la educación no puede estar frenada por asuntos comerciales!

Aun así, BeezNest basa su modelo de negocio sobre Chamilo gracias a la provisión de servicios de distintos niveles a sus clientes, los cuales
nunca impactan el proyecto software mismo de manera negativa:

* soporte
* instalación
* capacitación
* desarrollo (la totalidad de los útiles para el público se contribuye al proyecto)
* consultoría
* diseño e implementación de infraestructura

Y tu, que opinas? La parte legal es estricta, pero te parece que Chamilo es demasiado radical?

Montar partición sobre un archivo

October 7, 2013 Leave a comment

Si necesitas una partición adicional en un servidor en la nube ó necesitas particionar en caliente (mientras tu pc ó servidor está corriendo) entonces te será muy útil lo siguiente.

En Linux es posible usar un loop device como una partición virtual, para ello se apoya en el módulo loop dentro del kernel, el cual está disponible dentro de la mayoría de  distribuciones. De esta manera tenemos almacenado dentro de un solo archivo todo el contenido que un disco o partición de disco podría almacenar.

En nuestro caso fue aplicado dentro de Ubuntu y Debian aunque no debería haber ningún problema si es otra distribución. Empecemos.

Lo primero que haremos es habilitar el módulo

modprobe loop

verificamos que esté habilitado

lsmod | grep loop

Si en caso no se encuentra o tampoco aparece en /dev/loop*, agregar en el archivo /etc/modules

loop
lp

Y reiniciamos el SO

Usamos dd para crear un archivo de 1GB, en este archivo será donde irá toda nuestra partición

dd if=/dev/zero of=/opt/vdisk count=2048000

Lo atamos a cualquier loop device

losetup /dev/loop0 /opt/vdisk

Verificamos que esté correctamente atado

losetup -a
/dev/loop0: [fe00]:786448 (/opt/vdisk)

Y ya tenemos nuestra partición, luego procedemos a formatearla para poder “montarla” como una unidad cualquiera y poder usarlo.

mkfs.ext4 /dev/loop0

Creamos el directorio donde montaremos la partición.

mkdir /mnt/virtual

Montamos el loop device, recordar usar el mismo loop que uso líneas arriba.

mount /dev/loop0 /mnt/virtual

Si quisieramos desligar el loop device del archivo

umount /mnt/virtual
losetup -d /dev/loop0

Probablemente de usarlo frecuentemente sea necesario que se monte automaticamente tras cada inicio del SO, esto es posible añadiendo al archivo /etc/fstab

/opt/vdisk      /mnt/virtual       ext4   loop=/dev/loop0,user,auto,noatime       0 0

Y listo! Ya tenemos nuestra partición “virtual”.

Nginx + CDN + GoogleBot or how to avoid many useless Googlebot hits

If you’re like me and you’ve developed a CDN distribution for your website’s content (while waiting for SPDY to be widely adopted and available in mainstream distributions), you might have noted that the Googlebot is frequently scanning your CDNs, and this might have made your website a bit overloaded.

After all, the goal of the CDNs are (several but in my case only) to elegantly distribute contents across subdomains so your browser will load the page resources faster (otherwise it gets blocked by the HTTP limit or any higher limit set by your browser of simultaneous content download).

Hell, in my case, this is the number of page scans per day originating from the Googlebot on only one of my CDN-enabled sites (I think there are like 5 different subdomains). And these are only the IPs that requested the site the most:


3398: 66.249.73.186
1380: 66.249.73.27
1328: 66.249.73.15
1279: 66.249.73.214
1277: 66.249.73.179
1109: 66.249.73.181
1109: 66.249.73.48
1015: 66.249.73.38
822: 66.249.73.112
738: 66.249.73.182

As you can see, it sums up to about 13,000 requests in just 24h. On the main site (the www. prefixed one), I still get 10,000 requests per day from the Googlebot.

So if you want to avoid that, fixing it in Apache is out of the scope here, but you could easily do it with a RewriteCond line.
Doing it in Nginx should be relatively easy if you have different virtual host files for your main site and the CDN (which is recommended as they generally have different caching behaviour, etc). Find the top “location” block in your Nginx configuration. In my case, it looks like this:

        location / {
                index  index.php index.html index.htm;
                try_files $uri $uri/ @rewrite;
        }

Change it to the following (chang yoursite.com by the name of your site):

        location / {
                index  index.php index.html index.htm;
                # Avoid Googlebot in here
                if ($http_user_agent ~ Googlebot) {
                    return 301 http://www.yoursite.com.pe$request_uri;
                }
                try_files $uri $uri/ @rewrite;
        }

Reload your Nginx configuration and… done.

To test it, use the User Agent Switcher extension for Firefox. Beware that your browser generally uses DNS caching, so if you have already loaded the page, you will probably have to restart your browser (or maybe use a new browser instance with firefox –no-remote and install the extension in that one *before* loading the page).

Once the extension is installed, choose one of the Googlebot user agents in Tools -> Default User Agent -> Spider – Search, then load your cdn page: you should get redirected to the www page straight away.

%d bloggers like this: