Vagrant Lab for Postgres
Since a few days ago I’ve played (wink, wink) with Play, Lagom and Reactive Systems, I’ve found in the need of trying Some Scala and implement a REST API to access a Postgres Database, so instead of downloading, installing and configuring a database in my local machine I’ve felt tempted to use Vagrant instead.
Vagrant you say?
Vagrant is a tool for building and managing virtual machine environments in a single workflow. This tools “packages” our special box which is a small VM. A remarkable aspect is Vagrant relies on “providers” for virtualization. In this case, we’ll proceed first to install both Vagrant AND Virtualbox.
The beauty of Vagrant is that several boxes with preconfigured OSs, tools and services are ready to be implemented. Just search here for a Vagrant box of your needs.
Prerequisites:
- Vagrant.
- VirtualBox
sudo apt install virtualbox-qt
sudo apt install vagrant
Let’s get to it!
Get Postgres Vagrant box.
Open a Terminal. Create a directory in which you will download and place your Vagrant Machine.
The previous image comprises the following actions we have performed:
- Create a Postgres_Vagrant directory
- Download our Vagrant box.
- Open Vagranfile for this box.
Uncomment the following line of Vagrantfile
config.vm.network "private_network", ip: "192.168.33.10"
Add
config.vm.network "forwarded_port", guest: 5432, host: 5432, host_ip: "127.0.0.1"
Save and close the Vagrantfile. Go back to your terminal and execute
vagrant up
This command will start the vm for this exercise.
Now we open VirtualBox and effectively our vm is ready.
That’s all! Now we can focus our effort on building our REST API to access a database, but that’s for another day).
Edit!
Since I’m now in Russia, the Postgresql locale was set to «ru_RU.UTF-8», but it’s necessary to change it to support locale to match my language «en_US.UTF-8».
Change it like this
Thanks faqforge!
Clipmarks: Copia lo que quieres que otros lean
Clipmarks es un servicio para tomar notas (literalmente copiar fragmentos) de páginas.
Ya instalado, creamos un clipmark pulsando un botón, y pasamos a modo clip. Ahora los párrafos sobre los que pasemos con el ratón se resaltarán con un borde naranja. Para añadir al clipmark nos ponemos sobre el párrafo y hacemos click. Quedará marcado de color verde para diferenciarlo. También podemos añadir al clipmark texto seleccionado.
Una vez creado, podemos asignarle etiquetas. También podemos enviarlo por mail, o directamente a nuestro blog para que se publique. Por último tenemos la opción de hacerlo público o privado. La ventaja de hacerlo público es que pasamos a un sistema de comentarios, votos, etc. propio de las modernas aplicaciones web.
Para firefox instala este add-on.
Su web oficial nos muestra este corto video.
Rich Snippets para Productos
Propiedades de producto reconocidas, en paréntesis el nombre de la propiedad en el Microformato.
Propiedad |
Descripción |
brand |
Marca del producto. Ej. ACME. |
category |
La categoría a la que el producto pertenece. Ej. «Books—Fiction», «Heavy Objects», o «Cars». |
description |
Descripcion del product |
name (fn) |
Nombre del product |
price |
Precio. Número flotante, también acepta formato moneda. |
photo |
URL de la foto del producto |
url |
URL de la página del producto. |
Propiedades de producto reconocidas, en paréntesis el nombre de la propiedad en el Microformato.
Propiedad |
Descripción |
brand |
Marca del producto. Ej. ACME. |
category |
La categoría a la que el producto pertenece. Ej. «Books—Fiction», «Heavy Objects», o «Cars». |
description |
Descripcion del product |
name (fn) |
Nombre del product |
price |
Precio. Número flotante, también acepta formato moneda. |
photo |
URL de la foto del producto |
url |
URL de la página del producto. |