As a coding challenge I was asked to provide a generic list implementation using a language of my choice and using only primitive types, avoiding the use of high level built-ins. I chose Go because I want to learn it and I know it can be useful to create an abstract, generic implementation. The challenge request to implement at least 4 methods on the generic type: Filter() – returns a subset of the List satisfying an operation Map() – returns the List objects’ map Reverse() – reverse the ordering of the List objects FoldLeft() – join the objects from left to right using a join character As a bonus question I was asked to code unit tests for the aforementioned methods and give an explanation on how the implementation guarantees concurrent access on resources.
A friend asked me if I was able to get back working a Windows 98 PC he had in his house; I have never done it so I said “sure I can!” just to have the opportunity to learn something new, and of course do a friend a favour. My idea was to copy the whole PC and get it running on a virtual machine thus doing what I later discovered is called a “P2V” (Physical to Virtual); the result of which would have been a portable VM which I could then install in my friend laptop to have his old PC back.
[TL;DR] I wrote a Pub/Sub message queue in Go, branch “master” is stable but missing some interesting feature like distributed memory synchronization between nodes in a cluster and encryption. Code at Being a cloud system engineer, my work is to design and implement distributed systems: one of the key principles in designing such architectures is decoupling, which means ensuring the many parts composing the system are able to share informations and complete a sequence of operations without being tied together.
It is true: I fell in love with Go, not because I love Google and his products, but because it really fits my ideology of simplicity and power in a programming language. I started experimenting with the language and thank to his web-oriented approach I quickly came up with one of the simplest single task web application I could write: a URL shortener. What is a URL shortener? It’s a service that will give you a short link for a long URL.
During the last years I’ve been experimenting with GlusterFS and his functionalities as distributed object store; a lot has changed in the software, overall since Red Hat acquired it. I have been using it and find it useful for many projects but not for others: what I love is the community oriented approach with a very responsive team and support for any kind of users (meaning from the 2 nodes web server to a RAID10 Infiniband cluster for high end storage).
One of the very basic need of any startup is setting up a LAN in the workspace and configuring the Internet most used service: DNS. Relying on a public DNS may give you full functionality towards WAN connectivity, but when you need to address some hosts inside your LAN it can be handy to use names instead of IPs (especially with IPv6). Here’s a straight forward guide to get you started with your private DNS in a few minutes.
In an attempt to make someone happier I wrote a script to notify a server admin when his child has gone through a year of uptime 🙂 Platform suggestions accepted, enjoy! happy_bday_server script
The last weekend my colleagues and I had a nice time moving an existing application from a bare-metal infrastructure to AWS. I would like to share some of the focal points involved in such process, in case you’d go through it and would like to know: don’t expect everything to work as usual: you are changing the underlying hardware, moving to a virtualized environment. You can test every single part of the application but infrastructural side effects may occur in a second time relying on the provider: consider well which functionalities should be delegated to the cloud provider (AWS, in this case, offers a lot) or should be managed internally; for example S3 is not a distributed filesystem, and in some cases an RDS instance won’t have the same performance as database installed on an EC2 instance test application compliance, not hardware failure: instead of focusing on stress tests, you should focus first on functionality tests to ensure every part of te application is behaving as expected; hardware failure are easily handled in the cloud, that’s the primary purpose of IaaS.
Here’s a thing I came up with: you’re administering a Linux system with 100 users circa and you’re moving to a new server, you can save crontabs per user with this: mkdir crontabz && cd crontabz; for user in `cat /etc/cron.allow`; do crontab -l -u $user > cron_$user; done you will end up with a list of files cron_xxx, each one has the users’ cron. Hopefully your cron version will use the /etc/cron.
It may come in mind to any IT system engineer to know what is the status of the network, server by server, instance by instance; it happened to me when I was given the responsibility to manage my company’s infrastructure and I was wondering which tool could have helped to do the job. I chose Zabbix to monitor my infrastructure because: despite it’s a bit difficult to install (you need a PHP enabled web server, a database and a C compiler), you will benefit a very user-friendly web interface with lots of functionalities native agents for major OS release are already complied: FreeBSD, Linux, Windows, etc… Compiling to other OS just requires a “configure && make && make install” it offers many monitoring methods via a unique interface: you can group SNMP, JMX, HTTP monitoring in one shot it has multi-step HTTP/HTTPS monitoring, simulating different browsers and clients you can build nice infographics bundling all kind of monitored datas you can manage users and roles to give access to the web interface at your company’s employees you can build custom monitoring scripts to your needs Well let’s see some action now: I would like to post a short tutorial on how to build a custom script to monitor resources used by a Glassfish application server.
Ieri in ufficio mi è capitata una disgrazia, una rara occasione in cui non c’è capacità o competenza che possano aiutarti a risolvere il caso, serve solo fortuna: nel pomeriggio rientro dalla sigaretta e mi sento dire “non abbiamo più rete”. L’azienda dove lavoro si occupa di fornire servizi IT, senza la connessione internet siamo un’auto senza motore, una penna senza inchiostro, inutili. La linea di backup? All’inizio incolpo subito il nostro ISP (Fastweb), che a discapito di una fibra 100Mb ci ha giocato in passato scherzi del genere; quando la verifica evidenzia che non è un loro problema, il panico.
Ieri mi sono trovato con parte della mia famiglia nella loro sala a suonare un po’ il pianoforte, mio fratello Gianmaria e io ci siamo esibiti riproducendo la semplice (ma efficace) musica che accompagna la pubblicità dell’iPad Mini. Il motivetto è in Do maggiore così come viene proposto suonando i due iPad nella pubblicità, di seguito il video. Enjoy!  
In Italia abbiamo molti problemi, ma l’ultimo dei nostri problemi era l’istruzione che vantava uno dei primi posti al mondo fino a pochi anni fa. Ora invece il declino strutturale del nostro Paese ha colpito anche questo settore che era di valore. Parlo di mancanza di fondi per università e ricerca, di formazione non orientata al lavoro e tutto ciò che ne consegue: l’aumento della disoccupazione giovanile e della sfiducia nel futuro è preoccupante perché è nella stesso ordine di grandezza di stati molto indietro rispetto alla media europea.
Stamattina ho lavorato all’Arena Civica di Milano come tecnico del suono. La manifestazione che ho seguito era la cerimonia di chiusura del Ramadan islamico, l’equivalente della Pasqua cristiana. La cerimonia di per sè è stata breve, circa un’ora, ed è stato affascinante assistere a una manifestazione religiosa a cui non avevo mai assistito prima. Il programma è stato il seguente: raduno dei fedeli nel campo dell’Arena presentazione dei celebranti del rito preghiera sermone sfollaggio Innanzitutto ciò che mi ha colpito è stata la mole di persone che erano presenti: circa 15000 tra uomini donne e bambini; da notare che la religione islamica non conta solo fedeli dal medio oriente, gran parte infatti erano di origine africana e indonesiana.
Una cosa che adoro di questo millennio è l’abbondanza di dati: nella storia l’uomo ha sempre cercato di tramandare ai posteri la propria vita e io credo che i dati raccolti e archiviati dall’umanità nel secolo scorso siano in valore di molte volte superiori a ogni calendario Maya o testo sacro. Trovo fantastica la sensazione che si prova guardando un pezzo comico di Valter Chiari di 50 anni fa e immedesimandomi nei miei genitori per esempio, che hanno assistito alle stesse scene.