Implement a generic data list structure

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. [Read More]

Virtualize an old Windows PC

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. [Read More]

Golang Message Queue: a simple TCP message bus

[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 https://github.com/inge4pres/gmq 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. [Read More]

My first Golang web project is online

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. [Read More]

GlusterFS: is it suitable for me?

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). [Read More]

Set up a private master/slave DNS using BIND

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. [Read More]
BIND  CentOS  DNS  Linux 

Happy birthday server!

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

admin  bash  server 

A smooth migration to the cloud

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. [Read More]

Backup and restore crontabs

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. [Read More]

Zabbix: a powerful yet simple monitoring software

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. [Read More]