WSL for a developer environment

Hi all! I’ve been absent in this blog for a while. So I guess this new entry is a good way to back to the road.

First of all, this is my first entry in English. I’m trying to practice, so if you find errors please let me know.

Brief story and why?

At the University, when I started programming, I used Linux environments to get work in all my developer environment. Then, since I started to work as a developer, always I’ve been using macOS, with all its virtues and defects.

But, in a previous project in my work, they decided to give me a PC to work with this stack:

  • NodeJS in the backend
  • Angular in the frontend

So, my first thought was back to the origins and install Ubuntu in that PC. Problems? Yes, drivers: graphic card and trackpad. I said: Ok, no problem. I will work on this. But, was my fault. I couldn’t work in a weird resolution and with a trackpad that was deciding for me where to place.

So, the solution was clear: that PC will work fine only with Windows

WSL

After doing research about the best way to have commands that I already use in macOS and Linux, I read that there is a Linux embedded in Windows, called Windows Subsystem for Linux. Basically, you can have a Linux bash without the limitations of virtualization, and the problems I had with drivers.

I´ve worked with CentOS and Ubuntu, but I decided to use the last one. So, let´s start

  1. Enable WSL for Windows 10. You need to open PowerShell as admin and run
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

2. Go to Microsoft Store and choose your favourite distro. As I said, I will use Ubuntu.

Click on Get and Install it.

3. After that, start Ubuntu. It will take a time to finish the installation, and the first time will ask you for a UNIX user and password.

And now you have Linux in your Windows PC!!!

GIT, NODE, Angular

After you have installed, you would like to test a local environment.

First of all, you need to setup your local git. So, run:

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

For this example, I will install Node and create a sample project in Angular.

For Node, I usually use NVM. So:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash

If you are using the default bash, it will add the env vars directly. Otherwise, add

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

to your rc bash file. Close and re open your terminal.

I will use the latest LTS version

nvm install 14

And I will install Angular for a test project.

npm install -g @angular/cli

And create a new project

ng new test-app

Angular creates a project with all the things you would need to start. Go to the created folder and start the server

cd test-app
npm start

Go to your browser at go to `http://localhost:4200/` and you will see your app

VSCODE

Everything is fine, but in the real life you need to modify your code. So, VSCode will help us using the code in WSL and modifying in Windows.

First of all, download and install the Windows version of VSCode

Open a new terminal of WSL and go to the folder you would like to open in VSCODE, and type

code .

That will open Windows’ VSCode with the content of your WSL folder.

You will see also a recommended install about WSL, please install it. Close VSCODE and open it again from the terminal. It will finish the installation and you will see that is connected and also is taking WSL git configuration.

You will see that hot reload works.

Validar cédula ecuatoriana en Ruby

Nos encontramos desarrollando un sistema con mis amigos @macool y @leviskp y nos encontramos con que no hay una validación para cédula ecuatoriana que realmente funcione. @macool desarrolló un plugin, está escrito en javascript y coffescript, es realmente útil y ya cuenta con algunas contribuciones. Así que basándome en ese código decidí escribirlo en ruby y ponerlo a disposición. Continuar leyendo «Validar cédula ecuatoriana en Ruby»

Instalar Ruby on Rails en Mountain Lion y no morir en el intento

Bueno… realmente al instalar una herramienta en el sistema tienes la opción de que todo te salga de maravilla desde el principio o que estés varias horas (o días) buscando soluciones. Después de estar googleando por algunos días para solucionar una mala instalación de Rails y buscando con @macool en Stack Overflow soluciones sin que ninguna de resultado decidimos hacer una instalación limpia de Ruby 1.9.3 y Ruby on Rails. Y claro, compartir con los que quieran iniciarse en esta herramienta tan poderosa. Manos a la obra Continuar leyendo «Instalar Ruby on Rails en Mountain Lion y no morir en el intento»

Los números de 2012

Los duendes de las estadísticas de WordPress.com prepararon un informe sobre el año 2012 de este blog.

Aquí hay un extracto:

600 personas llegaron a la cima del monte Everest in 2012. Este blog tiene 10.000 visitas en 2012. Si cada persona que ha llegado a la cima del monte Everest visitara este blog, se habría tardado 17 años en obtener esas visitas.

Haz click para ver el reporte completo.

Radio online con Ubuntu

Esta entrada surgió de la necesidad que tenían en la Universidad donde estudio. Era necesario retransmitir a través de internet lo que la Radio Universitaria generaba en vivo. Googleando encontré lo que necesitábamos. Icecast.

Continuar leyendo «Radio online con Ubuntu»

Soporte exFAT en Linux Mint / Ubuntu

Bueno… está entrada surgió a partir de un pequeño problema que tenía… Tenía un disco externo formateado con NTFS pero tenía el problema que no podía usarlo en MacOS… así q me decidí por exFAT al tener en FAT32 la limitante del tamaño máximo de archivos… Todo bien… me funcionó en MacOS y procedí a copiar toda mi info…

Pero al ir a Linux Mint no me reconoció el sistema de archivos… Entonces googleando encontré la solución a este problema…

Continuar leyendo «Soporte exFAT en Linux Mint / Ubuntu»

Google+ con reconocimiento facial

Al igual que Picasa, Google+ ya cuenta con sistema de reconocimiento facial y etiquetado automático. Durante esta semana se ha ido anunciando que el servicio de reconocimiento facial para fotografías en Google+ ya está aquí.

Continuar leyendo «Google+ con reconocimiento facial»

Carbyn, sistema operativo hecho en HTML5

Parece que Google no es el único que quiere adentrarse en las aguas de las aplicaciones Web, pues recientemente ha salido a la superficie un retador formidable, el cual cuenta con su propio arsenal de características listo para hacer una entrada impactante y llamar las miradas de aquellos que buscan soluciones simples y rápidas.

Continuar leyendo «Carbyn, sistema operativo hecho en HTML5»

Usamos más el móvil para navegar que para hablar

La mitad de los usuarios utiliza más el móvil para navegar que para hablar, frente al 23% de los consumidores que usaban el móvil sobre todo para conectarse a la red en 2009, según una encuesta realizada por Yoigo, que desvela que un 89% de los usuarios se conecta a Internet desde el móvil.

Continuar leyendo «Usamos más el móvil para navegar que para hablar»