Sveglia con Radio Deejay su HomePod

Grazie a Les miscellanées numériques e a Maccanismi, uno script che permette di inviare lo stream di Radio Deejay a Homepod e che può essere programmato come sveglia.

tell application "iTunes"
    pause 3
    set current AirPlay devices to AirPlay device "Living Room"
end tell

tell application "iTunes"
    open location "http://radiodeejay-lh.akamaihd.net/i/RadioDeejay_Live_1@189857/master.m3u8"
    play
end tell

Links:

Farine

Da “La macchina del pane“, le tabelle per identificare le tipologie di farine italiane e francesi:

CLASSIFICAZIONE FARINE ITALIANE (DPR 09-02-2001, n. 187): 

              Tipo                     Ceneri (in milligrammi su 100g di farina)
Farina di grano tenero tipo 00                 < 550
Farina di grano tenero tipo 0                   < 650
Farina di grano tenero tipo 1                   < 800
Farina di grano tenero tipo 2                   < 950
Farina integrale di grano tenero          1300-1700

Sapendo che una farina “00” genera max 550mg di ceneri diventa semplice individuare l’equivalente farina francese: Continue reading “Farine”

Step by step guide to a wordpress docker

This guide is a quick-and-dirty, copy-paste ready step by step guide to a docker based clone of a live wordpress site.

It is based on Gear11 tutorial and depends on Gear11 Docker available on Github. No fancy, this page is a copy of the github README edited for personal purpose, you may want to refer to original documentation for a detailed guide.
Continue reading “Step by step guide to a wordpress docker”

Tiles

I have just published on github tiles.

When I was repairing home, I looked into different solutions for bathtub/floor tiles, choosing different colors. This led to a journey into graph coloring, looking for the best algorithm, and the above Maven project.

As of today, I have two tests:

  • Random colors: the color of each tile is randomly chosen
  • Welsh-Powell colored tiles: no adjacent tiles share the same color. Since this is a greedy algorithm, we end up with an unevenly distribution of tiles

Eventually, I will implement an in-between solution: no touching colors, but a better distribution.

Snapshot of a Bugzilla database

Bugzilla is not my preferred choice when choosing a bug/issue/incident tracking system : I found Jira (way) more powerful and flexible, even a the price of an increased complexity and learning curve (for the administrator).

Some times ago I worked on a bugzilla installation used mainly to track software development for a large, enterprise-level ERP.

One requirement was to display the status of the database at a particular time in the past (for reporting purposes), but Bugzilla doesn’t have such tool (it has other nice reports btw). Continue reading “Snapshot of a Bugzilla database”

Using a Liveradio Cube with WPA (solved)

The Liveradio Cube is a inexpensive Internet Radio with WIFI capabilities. Having it working on my home network has been quite tricky. This thread pointed to using WPA.

How to configure the Airport Express for WPA (and not WPA/WPA2):

1. In airport utility choose manual setup.
2. Under the Wireless tab select ‘802.11b/g compatible’ for ‘radio mode’.
3. Click option button and select ‘WPA personal’ in Wireless security: NOT the wpa/wpa2 one!! Set your password to 13 characters.
4. ‘Update’ and reboot the Airport.

Classici sotto l’ombrellone

Su Liber Liber sono disponibili i classici Iliade (nella traduzione di Vincenzo Monti) e Odissea (nella traduzione di Ippolito Pindemonte) in formato .txt.

Questi gli script calibre per convertire in formato .mobi, compatibile con Amazon Kindle:

ebook-convert iliade.txt iliade.mobi \
    --input-encoding=iso8859-1 \
    --output-profile=kindle \
    --single-line-paras \
    --authors=Omero \
    --title=Iliade \
    --isbn=978-88-17-12969-0 \
    --chapter="//h:p[re:test(., 'LIBRO ')]"
ebook-convert odissea.txt odissea.mobi \
    --input-encoding=iso8859-1 \
    --output-profile=kindle \
    --single-line-paras \
    --authors=Omero \
    --title=Odissea \
    --isbn=978-88-17-02071-8 \
    --chapter="//h:p[re:test(., 'LIBRO ')]"

Bonus:

ebook-convert principe.txt principe.mobi \
    --input-encoding=iso8859-1 \
    --output-profile=kindle \
    --authors="Niccolo Machiavelli" \
    --title="Il Principe"  \
    --chapter="//h:p[re:test(., 'Cap.')]/following-sibling::*[1]"

Remote encrypted backup using gpg and rsync

Bare bones script to encrypt and copy all .pdf, .xls and .csv files in current directory to a remote server using rsync (I recommend rsync.net)

#! /bin/bash
R_USER="<your_user>"
R_HOST="<your_host>"
BASENAME=`basename "$PWD"`

echo "Your destination:"

read GPG_DEST

find . -iname '*[pdf|xls|csv]' -exec echo '{}' \; | while read f
do
    if [ ! -f "$f".gpg ]; then
        gpg -e -r $GPG_DEST "$f"
    fi
done

rsync -r --exclude=*.pdf --exclude=*.xls --exclude=*.csv --include=*.pdf.gpg . "$R_USER@$R_HOST:Documents/$BASENAME"