Category Experiments

Weekend Learning!

Weekends are great if you want to learn something new. Weekends are great for bored programmers.

Yesterday I found myself in “that” situation: I am bored, nothing to do, a weekend waiting for me. There are many things that I can learn in a small time (well, sometimes just an overview or a “getting started” are a good start), but where to find them?

So, I started this repository on GitHub, named Weekend Learning (https://github.com/francescomalatesta/weekend-learning).

Hope you’ll like and if you want, contribute to it by making a PR!

Oh, and yes… have a nice weekend 🙂

Go Experiments – #1 – Rsz

I recently started to play with the Go language. I felt the need to change languages, paradigms and to study something new.

Meanwhile, my girlfriend needed a tool to quickly resize her images, for some university projects. What best occasion to study something new? I read many articles about Go, that suggest to use the language for some specific applications, like CLI tools or microservices. Exactly what I needed.

So… here’s Rsz!

I love command line interface tools. I started using them more seriously some months ago, when I began using Linux everyday. I love how much they can cut times for repetitive tasks.

I have not compiled it yet, so if you want to use it you will need to have Go installed on your machine. However, in the next days/weeks I will add some new features and the compiled executables for both Linux and Windows platforms.

Have a nice day, and happy holidays! 🙂

Poems #5 – A Zacinto

A Zacinto, by Ugo Foscolo

Né più mai toccherò le sacre sponde
ove il mio corpo fanciulletto giacque,
Zacinto mia, che te specchi nell’onde
del greco mar da cui vergine nacque

Venere, e fea quelle isole feconde
col suo primo sorriso, onde non tacque
le tue limpide nubi e le tue fronde
l’inclito verso di colui che l’acque

cantò fatali, ed il diverso esiglio
per cui bello di fama e di sventura
baciò la sua petrosa Itaca Ulisse.

Tu non altro che il canto avrai del figlio,
o materna mia terra; a noi prescrisse
il fato illacrimata sepoltura.

Poems #4 – Ho Sceso, Dandoti il Braccio

Ho Sceso, Dandoti il Braccio by Eugenio Montale

Ho sceso, dandoti il braccio, almeno un milione di scale
E ora che non ci sei è il vuoto ad ogni gradino.
Anche così è stato breve il nostro lungo viaggio.
Il mio dura tuttora, né più mi occorrono
Le coincidenze, le prenotazioni,
le trappole, gli scorni di chi crede
che la realtà sia quella che si vede.

Ho sceso milioni di scale dandoti il braccio
Non già perché con quattr’occhi forse si vede di più.
Con te le ho scese perché sapevo che di noi due
Le sole vere pupille, sebbene tanto offuscate,
erano le tue.

Poems #3 – X Agosto

X Agosto, by Giovanni Pascoli

San Lorenzo, io lo so perché tanto
di stelle per l’aria tranquilla
arde e cade, perché sì gran pianto
nel concavo cielo sfavilla.

Ritornava una rondine al tetto:
l’uccisero: cadde tra spini:
ella aveva nel becco un insetto:
la cena de’ suoi rondinini.

Ora è là, come in croce, che tende
quel verme a quel cielo lontano;
e il suo nido è nell’ombra, che attende,
che pigola sempre più piano.

Anche un uomo tornava al suo nido:
l’uccisero: disse: Perdono;
e restò negli aperti occhi un grido:
portava due bambole in dono…

Ora là, nella casa romita,
lo aspettano, aspettano in vano:
egli immobile, attonito, addita
le bambole al cielo lontano.

E tu, Cielo, dall’alto dei mondi
sereni, infinito, immortale,
oh! d’un pianto di stelle lo inondi
quest’atomo opaco del Male!

Hostr – A simple PHP CLI tool to manage your hosts file!

Hi everyone! A few hours ago I release on Github my latest version of Hostr, a PHP CLI tool that you can use to manage your hosts file with an expressive and easy syntax.

Before you say it: yes, I know that out, into the wild, there are many other similar tools. However, I wanted to do some practice with the Symfony Console component and, later, with the Box2 tool that I used to create the .phar file.

That’s all. It took me, in total, three/four days of work. And it was really funny.

Cool! How can I try it?

Great! All you have to do is open your terminal, switch to sudo and type the following instructions:

wget http://hellofrancesco.com/projects/hostr.phar 
chmod 755 hostr.phar && mv hostr.phar /usr/local/bin/hostr

The first line will download in the current folder the .phar file.

The next line will change the file permissions to 755 and move it in the /usr/local/bin folder

Done. How can I use it?

Well, now that you have installed it, type

hostr

to verify if it was installed successfully.

Now you can use every single command. There are, actually, 7 commands that you can use.

  • show
  • add
  • remove
  • backup
  • restore
  • tidy
  • check

For more details, Take a look to the project page on Github!

Changin’ the OS – A Month Later

One month ago, I decided to switch my OS, from Windows to Ubuntu. 14.04, to be precise. I promised that I would write a post one month later, to draw some conclusions about it.

So… What happened? Generally, everything was ok.

Cool Things:

  • Some people warned me about some issues with drivers installation… but nothing happened and everything worked (and works) as expected;
  • Every software I use is available on Ubuntu. I had some doubts about Gimp, but it has awesomely improved from the last time I used it (many years ago);
  • Less mouse, more keyboard: last month I was thinking about buying a new mouse. Today I look back to these days and think “lol wut”;

Bad Things:

  • Sometimes you can stumble upon some little bugs here and there. However, nothing really serious after all… and if you like to experiment, it will be absolutely satisfying;

Ubuntu/Linux, you have my sword.

Poems #2 – San Martino

San Martino, by Giosuè Carducci (Italian Version)

La nebbia a gl’irti colli
piovigginando sale,
e sotto il maestrale
urla e biancheggia il mar;

ma per le vie del borgo
dal ribollir de’ tini
va l’aspro odor dei vini
l’anime a rallegrar.

Gira su’ ceppi accesi
lo spiedo scoppiettando
sta il cacciator fischiando
su l’uscio a rimirar

tra le rossastre nubi
stormi d’uccelli neri,
com’esuli pensieri,
nel vespero migrar.

Poems #1 – O Terra, Aspettami

During the last week I decided, with my girlfriend, to begin learning poems. To be more precise, one poem every two weeks. I will chose mine, she will chose another one for her. After the two weeks period we will repeat each other the chosen poem.

Why?

I need to train my memory. Being a programmer means being very good to use Google. However, this is not so healthy for my memory. I made some research about that and I discovered that a good way to deal with this “problem” can be to start learning some poems.

That’s all!

Ok, so?

Here’s the first poem I choose for this first two weeks period.

O Terra, Aspettami, by Pablo Neruda (Italian Version)

Riportami, o sole,
al mio destino agreste,
pioggia del vecchio bosco,
riportami il profumo e le spade
che cadevano dal cielo,
la solitaria pace d’erba e pietra,
l’umidità dei margini del fiume,
il profumo del larice,
il vento vivo come un cuore
che palpita tra la scontrosa massa
della grande araucaria.

Terra, rendimi i tuoi doni puri,
le torri del silenzio che salirono
dalla solennità delle radici:
voglio essere di nuovo ciò che non sono stato,
imparare a tornare così, dal profondo
che fra tutte le cose naturali
io possa vivere, o non vivere: non importa
essere un’altra pietra, la pietra oscura,
la pietra pura che il fiume porta via.

Laravel API Boilerplate – JWT Edition

I have just published on Github my new side-project, made in the last weekend: Laravel API Boilerplate – JWT Edition.

I often found myself in the need of build an API to test an idea. I don’t like to repeat boring operations and, in this last period, I am often using three awesome packages:

So… why don’t work on a simple integration, to solve the problem once for all?

I shared it because I am not the only one to have this needs. Quite sure about it 🙂

So… feel free to take it, PR new features if you want and give my some feedback!