Posts

Also available as an atom feed.

Webinar: Quick Development of WebApps in Rails

Written on: Wed, Nov 07, 2018

Categories:

Tags:

Resources related to the webinar hosted by ITMPI on Nov 6, 2018. Link to the webinar: https://www.itmpi.org/Recordings/adolfo-villafiorita About Ruby and Ruby-on-Rails: Ruby On Rails, material, documentation, and information about Ruby on Rails Ruby Lang, material, documentation, and information about the Ruby programming language Ruby Gems, find, install and publish RubyGems…

Yankpad

Written on: Sun, Oct 28, 2018

Categories: notes

Tags: emacs,jekyll

Text snippets can speed writing code quite a bit, but, somehow, I never managed to get used to the solutions Emacs provides, such as Yasnippet and Skeleton. As a consequence, I seldom, if at all, use text snippets. A few days ago I came across Yankpad, an Emacs lisp package…

Comanche, the Comment Manager for static websites

Written on: Mon, Oct 15, 2018

Categories:

Tags: jekyll,sinatra,ruby

Comanche is a Sinatra application to manage comments on a static website. What is does It is a lightweight and privacy-friendly alternative to Disqus, along the lines of Isso. I wrote it as a quick hack to manage comments on my webpage. The behavior is relatively simple. Comanche makes two…

Asset bundling from the command line

Written on: Sat, Sep 29, 2018

Categories: notes

Tags: jekyll,javascript,css

I wanted a simple solution to bundle and fingerprint the assets of my homepage, which is built with Jekyll. Existing solutions seemed an overkill. It turned out that I could achieve the same result with a simple script. Web Assets Management Asset Bundling. Performances of webapps and websites can be…

Making my Website leaner

Written on: Fri, Sep 28, 2018

Categories: notes

Tags: jekyll,javascript,css

I decided to make my website a bit leaner, by reducing the size of its JavaScript and CSS assets. Here are the results of experimenting with two frameworks, Foundation and Spectre.css. Starting Point The starting point is my website as of Sep 2018, which comes with Foundation 6.5.0-rc.2 and jQuery…

Nginx Rewrites

Written on: Wed, Dec 20, 2017

Categories: notes

Tags: web_development,nginx

Nginx rewrite rules allows one to specify how URLs have to be redirected. This is useful when you make changes to your web content which break URLs external sites might still reference, like, for instance, when you move or delete some posts. Consider, for instance, the following rewrite directive: server…

Nginx Locations

Written on: Wed, Dec 20, 2017

Categories: notes

Tags: web_development,nginx

This note contains some of the configuration rules I use on my web server at home. The web server servers content of three different websites. Note. If you are using OSX and brew, the location of Nginx configuration file is /usr/local/etc/nginx/nginx.conf. Locations Locations are a way to link a URL…

Basic TeX

Written on: Wed, Dec 20, 2017

Categories: notes

Tags: tex,latex,tools

BasicTex is an official and greatly simplified version of TeX which ships with the essential stuff only.

The package is 72M, which is a lot smaller than the 3G of the standard distribution.

You can grab it from the MacTex page: Smaller Downloads.

Page Titles in Rails Apps

Written on: Mon, Jul 04, 2016

Categories: notes

Tags: rails

Giving meaningful page titles to distinguish different views is a nice touch you can easily add to your Rails application. The most popular approach on StackOverflow seems to be that of defining a @title variable in the controller, which can then be used in the application layout (See, for instance…

Restoring Keybinding changed by major mode

Written on: Thu, Apr 28, 2016

Categories: notes

Tags: emacs,elisp

The Markdown major mode in Emacs binds M-<right> and M-<left> to markdown-demote and markdown-promote, respectively. On a Mac keyboard, the key combinations above correspond to “Option” + right/left arrow. A more “natural” binding of these keys, in my opinion, is with forward and backward word, the behavior these two keys…

Grep in Emacs

Written on: Wed, Apr 06, 2016

Categories: notes

Tags: emacs,elisp

M-x grep in Emacs is a great command and I use it quite often. Two issues I have with the command: most of the times I need to explicitly specify -r and I am never sure what directory grep will start searching from. Functions and packages, such as rgrep and…

Please install activerecord-mysql2-adapter

Written on: Wed, Nov 11, 2015

Categories: notes

Tags: rails,web_development,mysql

I recently got this error on a Rails 3 application I am working on: % rake assets:precompile RAILS_ENV=production rake aborted! LoadError: Please install the mysql2 adapter: gem install activerecord-mysql2-adapter (can’t activate mysql2 (~> 0.3.10), already activated mysql2-0.4.1. Make sure all dependencies are added to Gemfile.) Since it is the second…

Updated Bookstream

Written on: Sun, Jul 05, 2015

Categories: news

Tags:

I have updated the bookstream page, adding a timeline (built with Timesheet.js) and some statistics.

This is one of the advantages of using ERB and having access to Ruby for building pages.

Determining the URL of CalDAV Calendars

Written on: Sat, Jul 04, 2015

Categories: notes

Tags: caldav

iCloud Go to your ~/Library/Calendars folder. You will find a bunch of ID.caldav directories: each of these folders correspond to a calendar (or a set of of calendars) and contains either another directory or an Info.plist file. The Info.plist file stores the URL of the calendar. Open the Info.plist file…

Simple Email Obfuscator for Middleman

Written on: Mon, Jun 01, 2015

Categories: notes

Tags: middleman,ruby

Markdown natively supports mail obfuscation for emails put in angular brackets. However, if you are using a different markup format (most notably Textile), you do not have any specific support. To reduce the risk of emails being harvested from my website, I defined the following function in the helpers section…

Using CSV data in Middleman

Written on: Sat, May 30, 2015

Categories: notes

Tags: middleman,ruby

Middleman allows you to specify data in yaml format, as explained in the Data Files page. However, certain data is best represented in CSV (comma separated value). Fortunately, it is relatively simple to write a middleman extension to read csv data. Installation Create a lib directory in the root of…

Ruby Command Line Parsers

Written on: Mon, Jan 05, 2015

Categories: notes

Tags: ruby,parser

This is a list of Ruby Gems to simplify parsing of command lines and managing text output. Generic Links: Ruby Toolbox CLI Option Parsers to get the full list CLI Option Parser Examples to get a detailed discussion of various CLI parsers Tools I have looked at: OptParse is the…

Emacs CalDav

Written on: Sun, Jan 04, 2015

Categories: notes

Tags: emacs,caldav

Using Emacs to manage your Calendar/Diary This post summarizes my attempts to manage my CalDav based calendars in Emacs. Managing your Calendar/Diary in Emacs Emacs has three main packages for managing a diary: Diary Mode ships with Emacs and allows one to manage an agenda stored as a plain text…

One Level Up

Written on: Tue, Dec 30, 2014

Categories: news

Tags:

I have moved my home page one level up, removing the “home” element in the path.

My home now lives at http://ict4g.net/adolfo/.

A rewrite rule ensures all old URIs still work. Thus, if you really want, you can still access my home also from http://ict4g.net/adolfo/home/index.html.

Reading IMAP Mail in Emacs on OSX

Written on: Sat, Dec 27, 2014

Categories: notes

Tags: emacs,email

Introduction Reading mail in Emacs is tricky (unless you are using Emacs as your only mail reader), but it can have various advantages. This post summarizes how to use Emacs as one of the applications to read email from multiple IMAP accounts. The solution I am using to read IMAP…

Focaccia

Written on: Mon, Dec 22, 2014

Categories: cooking

Tags: bread

Dissolve salt in water; dissolve yeast in water (if you are using the fresh one) Put flour, yeast (if dry), sugar, some oil (40ml) in a bowl Mix water and flour and work well (10 minutes or so). You should get a sticky dough. The more you mix, the better…

Money and Happiness

Written on: Fri, Dec 12, 2014

Categories: notes

Tags: management

I came across If money doesn’t make you happy, then you probably aren’t spending it right, a paper by Dunn, Gilbert, and Wilson and I found it very interesting. You can download it from Science Direct, if you want. The main message is that people are not happy because they…

Format a USB key in MS-DOS FAT16 format with diskutil

Written on: Wed, Dec 10, 2014

Categories: notes

Tags: terminal,osx

The Columbus V-900 logger requires a MicroCard formatted using the MS-DOS FAT16 format. The Diskutil application, however, does not allow to specify this format. The task can be achieved using the CLI, however. Quoting from Spotwise. List the devices available (to ensure we format the right one): $ diskutil list…

Written on: Sun, Nov 16, 2014

Categories: notes

Tags: emacs

If you use Emacs, there are various choices for navigating the file system. This is a recap of the main choices. Dired The first option is dired, which allows one to navigate a file hierarchy using the keyboard. Dired is built-in in Emacs. Dired can also be effectively used as…

Colored Bash Prompt

Written on: Sun, Nov 09, 2014

Categories: notes

Tags: osx,linux,terminal

Color you Bash Prompt To color your prompt, use something like: $ export PS1=”[\033[38;5;COLOR_CODEm]PROMPT[\033[39m] “ where COLOR_CODE is an integer representing a color PROMPT is what you want to show on the prompt For instance: $ export PS1=”[\033[38;5;1m]\u@\h$[\033[39m] “ colors the prompt green (1 is the color code for green)….

Switching to Middleman

Written on: Thu, Oct 30, 2014

Categories: notes

Tags: middleman,jekyll,web_development

I just switched my homepage from Jekyll to Middleman. The frameworks are very similar and the migration has been relatively painless. The following notes recap the motivations for the switch and what I had to to move to the new framework. Remark. The following notes were written when I was…

Source Code in Org Mode

Written on: Sun, Sep 28, 2014

Categories: notes

Tags: emacs,org-mode,ruby

To enable execution of ruby code in OrgMode files, put in your .emacs file (require ‘ob-ruby) You can then insert ruby code in your org file using the following tags: #+BEGIN_SRC ruby a = 2 + 3 b = 10 * 2 [a + b, a] #+END_SRC Evaluate with C-c…

Change OSX Terminal Settings from Command Line

Written on: Wed, Jul 16, 2014

Categories: notes

Tags: terminal,osx

Changing fonts and colors should be easy, also with terminals. Alas, neither iTerm2 nor OSX Terminal seem to have an easy way of doing this: you need to define a profile or change some of the options of the current profile. This is often an overkill. Various solutions exists on…

Quick Rising Bread

Written on: Sun, Jul 13, 2014

Categories: cooking

Tags: bread

Put flour and salt in a bowl Dissolve the yeast and the honey in the water Add the liquid to the flour … no need to work the mix up: just make sure the ingredients are well mixed.a Cover with a bit of flour Cover and wait for 1.5 hours…

Running Multiple Services on localhost/Fast Completion

Written on: Mon, Jun 16, 2014

Categories: notes

Tags: web_development

A simple solution to a micro-problem. The micro-problem: when testing applications running on different ports on localhost, URL completion on the browser is ineffective. In fact, there will be different completions of “localhost”, such as localhost:3000, localhost:4000, localhost:8080, to name a few. Every time you run a specific service on…

Shower Slide Generator

Written on: Thu, Jun 12, 2014

Categories: news

Tags:

I recently came across the Shower slide generator, which generates nice HTML-based presentations. Since I’m quite fond of S9, I built a template pack to deploy an S9 presentation using shower. You can grab it from my Github home: slideshow shower Some of main advantages of S9 include: slides are…

Pancakes

Written on: Fri, Apr 18, 2014

Categories: cooking

Tags: eggs,breakfast

You can either use baking soda or yeast to make the pancakes fluffy. Baking soda yields the best results, in my opinion. Preparation: Put the dry ingredients in a bowl If you are using yeast, dissolve it in the milk Add the milk, oil, and the egg to the dry…

Switching to Nginx

Written on: Sat, Apr 12, 2014

Categories: notes

Tags: osx,web_development,nginx

Last Friday I switched the web server running on my Mac Mini (MacOS) from Apache to Nginx. The main motivations for moving to Nginx, in my case, are: Nginx is faster at serving static content Configuration is simpler Nginx can be easily updated using Homebrew Here is a recap of…

No-Knead Bread

Written on: Mon, Mar 31, 2014

Categories: cooking

Tags: bread

If you use fresh yeast, dissolve it in the water. Mix in a bowl all ingredients. You will get a fairly liquid and sticky preparation (see picture). It does not need to be knead very much: just make sure the ingredients are well mixed. Cover with kitchen film and wait…

Book about to be released

Written on: Mon, Feb 10, 2014

Categories: news

Tags:

Introduction to Software Project Management is about to be released The book will be available in the U.S. from February 20, 2014 and in Italy soon afterwards. Reserve and get your copy from: CRC Press Amazon.com Amazon.it More information about the book and additional material can be found on the…

Columbus 1.4.1

Written on: Thu, Feb 06, 2014

Categories: news

Tags:

Columbus 1.4.1 (the viewer of GPS tracks generated by the Columbus tracker) is out.

You can download it from the Columbus Home Page

Columbus 1.4.0 is out

Written on: Sat, Jan 25, 2014

Categories: news

Tags:

Columbus 1.4.0 (the viewer of GPS tracks generated by the Columbus tracker) is out.

You can download it from the Columbus Home Page

RHoK June Announced

Written on: Tue, May 07, 2013

Categories: news

Tags:

RHoK is coming back to Trento! Please join us for the fifth edition of RHoK Trento! RHoK Trento will take place June 1-2, 2013 at FBK. Help up build a better world, while having fun, learning for experienced programmers, and enjoying the famous RHoK Trento hospitality! Register for free at:…

SPM Website

Written on: Wed, Feb 27, 2013

Categories: news

Tags:

The website of the SPM course is up and running: http://spmbook.com (updated on May 13, 2016 with the new location).

With minimal content at the moment, it will grow as the course moves along.

Written on: Tue, Jan 01, 2013

Categories: news

Tags:

I just made available a ruby script (and simple layout) to generate photo galleries in Jekyll. The script is a pre-processor which takes as input a list of directories (containing JPEG or PNG) and populates them with textile files to display the pictures as a gallery. Grab the sources from…

ZURB Foundation

Written on: Sat, Nov 24, 2012

Categories: news

Tags:

I have migrated the website layout to ZURB Foundation, mainly out of curiosity for the framework. The migration has been painless and relatively fast (thanks also to Jekyll, which neatly separates presentation from content). The new layout is, in my opinion, cleaner. I did not have to customize much, but…

RHoK Trento Sold Out!

Written on: Sat, Nov 24, 2012

Categories: news

Tags:

RHoK Trento is sold out! We have 75 people registered to the hackathon and 20 people registered for the crash course on Ruby on Rails. It is a big success! … We will look whether we can accommodate any further last-minute requests in the next few days. I’m really happy…

RHoK Trento

Written on: Fri, Jun 01, 2012

Categories: news

Tags:

A new website is available about RHoK Trento (link updated on 2012-11-23 to reflect the new location).

You can also view the map of participating centers and the kick-off presentation.

New ICT4G Blogs

Written on: Fri, Jun 01, 2012

Categories: news

Tags:

Follow us on the two new ICT4G blogs dedicated to our applications:

BringTheFood Blog (link updated on 2012-11-23 to reflect the new location) SAMO Blog

RHoK Trento

Written on: Wed, May 16, 2012

Categories: news

Tags:

RHoK is coming back to Trento! On June 2-3 come and join us to hack for humanity… a chance to develop for mobile and the web, work with motivated and experienced teams, build tools that can have an impact. For this edition, the involvement of Trento Rise and the EIT…

SPM 2012

Written on: Thu, Mar 01, 2012

Categories: news

Tags:

The website for the 2012 edition of the Software Project Management course is up and running.

You can find it here: SPM-2012

RHoK Trento on RAI Radio 2

Written on: Fri, Feb 24, 2012

Categories: news

Tags:

The regional branch of RAI Radio 2 broadcast, on the 24th of January, an interview with Aaron Ciaghi, Andrea Nodari and myself about RHoK Trento and the activities of the ICT4G unit. (RAI is the Italian public broadcasting company.)

You can [listen to the show][inteview]

RHoK on the Mozambican Press

Written on: Mon, Jan 09, 2012

Categories: news

Tags:

The Mozambican press published an article about to the participation of the Mozambican Team to RHoK Global, which was held last December in various locations around the world (see RHoK Map). The team, formed by students of the First Summer School of ICTs (see Savana on SSICT), collaborated with one…

Bookstream Page

Written on: Wed, Jan 04, 2012

Categories: news

Tags:

I have added a Bookstream page, where I’m listing the books I read.

I added the book I just finished reading… more to come, of course.

Newspaper “Savana” on the Summer School of ICT

Written on: Tue, Dec 20, 2011

Categories: news

Tags:

The newspaper Savana has published an article about the First Summer School of ICT, which we held last November in Maputo, Mozambique. It has been a wonderful experience and it is nice to see that the initiative has been appreciated locally not only by the students, but also by the…

Publications updated

Written on: Fri, Dec 16, 2011

Categories: news

Tags:

I started refactoring my publication list… You can now find an updated version of my publications that includes the possibility of looking at abstracts and downloading BibTeX entries.

Have a look at the Publications page!

Twitter Bootstrap

Written on: Thu, Dec 08, 2011

Categories: news

Tags:

I switched the layout of the home page using Twitter Bootstrap. Very nice framework, the migration took a couple of hours (which include: adding a new layout for the front page, learning how to use git branches, migrating the typographical styles from my old css). It seems like git, jekyll,…

RHoK Trento Pictures

Written on: Wed, Dec 07, 2011

Categories: news

Tags:

The pictures of RHoK Trento are now available on the RHoK Trento Photostream on Flickr.

RHoK Trento Update

Written on: Sat, Dec 03, 2011

Categories: news

Tags:

Some numbers and data about the first day of RHoK Trento: 44 people showing up and working on hacks! 9 different problems have been chosen and are currently being worked on: Areas of interest include (but are not limited to: agriculture, health, emergency management). See: RHoK Trento for details about…

RHoK Global Dec. 2011

Written on: Fri, Dec 02, 2011

Categories: news

Tags:

Saturday the 3rd of December and Sunday the 4th of December we are hosting RHoK. The event is going to be held in 35 locations. I’m proud to announce that Trento will collaborate with a small team of dedicated people located in Maputo, Mozambique! Thanks to all the people who…

… New Website!

Written on: Fri, Oct 28, 2011

Categories: news

Tags:

It’s that wonderful time of the year again! … I switched to yet another technology: I am now back to Emacs and command line. The website is now powered by Jekyll, a static blog-aware website generator. Whether it will make easier to keep the website updated, this is difficult to…

Book now available

Written on: Mon, Nov 22, 2010

Categories: news

Tags:

Design and Safety Assessment of Safety Critical Systems, the book I co-authored with Marco Bozzano and published by CRC Press, is now available for sale. You can get it from the CRC Press Website and Amazon.com. We also setup a website for the book, http://www.safety-critical.org, where you can find some…

Book ready to ship

Written on: Fri, Nov 05, 2010

Categories: news

Tags:

Design and Safety Assessment of Safety Critical Systems, a book I co-authored with Marco Bozzano and published by CRC Press, is about to hit the market. The planned release date is November 19, 2010. The book is on sale from the CRC Press Website, Amazon.com, and Amazon.co.uk. We are also…

Kindle DX Latest Generation Screen

Written on: Wed, Sep 22, 2010

Categories: news

Tags:

I recently upgraded my Kindle DX (the “International” one) to the new Kindle DX Latest Edition. The main driver for switching was the new, brighter screen (50% brighter, according to the Amazon web site). The decision, however, was taken on a leap of faith, since I could find little information…

New Website

Written on: Wed, Jul 21, 2010

Categories: news

Tags:

I finally decided to update my website. After considering for a while a switch to some more powerful framework, such as a Wiki Engine (Instiki, PMWiki), a CMS (Radiant CMS, Joomla), and even testing whether it is really true you can build your own Wiki Engine in twenty minutes using…