Alessio Caiazza

Il sapere umano appartiene al mondo.

Released About Me 1.0.5

This About Me release fixes image path when blog URL isn’t the same of WP URL, and also add supports for the following social networks:

  • GoodReads

  • Orkut

  • Google Profile

  • Google Reader

  • Qype

  • Ebay

  • RedGage added in 1.0.4

If you are interested in Qik.com support please consider installing the development snapshot.

If you are interested in About Me development milestones you can find it here enhancement and proposal for the release 2.0.

(l0g.in 40EDa_)

[redirector] Sinatra + Heroku=> Micro-applicazioni di cui non preoccuparsi

Oggi mi son imbattuto in un problema che ho risolto grazie a sinatra ed heroku.

Nei giorni scorsi avevo deciso di usare il domino bb.alessiocaiazza.info come mia pagina personale su bitbucket, solo che poi ho comprato il dominio l0g.in e avrei preferito usare code.l0g.in.

Fin qui nulla di male, ma come fare con tutti i link che avevo disseminato in giro per il web? Avrebbero puntato ad una pagina di errore? No!

Mi è venuto in mente che con sinatra è possibile catturare le url con delle regexp…quindi…

#
# redirector
#
# (c) 2009 - Alessio Caiazza 

require 'rubygems'
require 'sinatra'

REDIRECT_TO='http://l0g.in'

get '/' do
    redirect REDIRECT_TO
end

get '/*' do
    redirect "#{REDIRECT_TO}/#{params[:splat][0]}"
end

e poi deploy su heroku e custom domain service …..fatto!

Ho colto l'occasione per provare hg-git, quindi ho pubblicato tutto su github.

(l0g.in 3zyK8N)

Firmare gli archivi jar

Un po’ di tempo fa mi ero imbattuto nel problema di utilizzare online un'applet generata con Processing che utilizzasse CaptureMJPEG.

Ero giunto alla conclusione che fosse necessario firmare l'applet e qualche giorno dopo mi sono procurato tramite CaCert una chiava utilizzabile per la firma del codice.

Quello che segue è un rapido riepilogo dei passi necessari per la firma dei jar.

Individuazione della chiave

kaiman:applet nolith$ keytool -list -storetype pkcs12 \
-keystore keystore.p12
Immettere la password del keystore:  **********************

Tipo keystore: pkcs12
Provider keystore: SunJSSE

Il keystore contiene 1 entry

id di alessio caiazza a root ca, 2-giu-2009, keyEntry,
Impronta digitale certificato (MD5): 81:57:63:80:D9:71:61:CD:6D:1E:CA:1D:28:0C:19:F8

Firma

kaiman:applet nolith$ jarsigner -storetype pkcs12 \
-keystore keystore.p12 micc_histo.jar \
"id di alessio caiazza a root ca"
Enter Passphrase for keystore: ****************************

Per quanto riguarda gli applet esportati con Processing è necessario firmare il proprio jar e core.jar (i jar di CaptureMJPEG sono forniti già firmati dalla versione 1.0.1)

(l0g.in 3zxDPt)

New GPG key

Today I changed my gpg key, here you can find a declaration and here the new key.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512,SHA1

Sun, 31 May 2009 

For a number of reasons, i've recently set up a new OpenPGP key, and
will be transitioning away from my old one.

The old key will continue to be valid for some time, but i prefer all
future correspondence to come to the new one.  I would also like this
new key to be re-integrated into the web of trust.  This message is
signed by both keys to certify the transition.

the old key was:

pub   1024D/9F04ED5E 2004-01-15 [expires: 2010-02-21]
      Key fingerprint = B79A 36D6 A269 F302 3D49 8678 34F2 527D 9F04 ED5E

And the new key is:

pub   4096R/440C5437 2009-05-31
      Key fingerprint = 87C3 BF5F 034A 6801 338A 7963 4C1E 7C65 440C 5437

To fetch the full key (including a photo uid, which is commonly
stripped by public keyservers), you can get it with:

  wget -q -O- http://alessiocaiazza.info/nolith.gpg | gpg --import -

Or, to fetch my new key from a public key server, you can simply do:

  gpg --keyserver http-keys.gnupg.net --recv-key 440C5437

If you already know my old key, you can now verify that the new key is
signed by the old one:

  gpg --check-sigs 440C5437

If you don't already know my old key, or you just want to be double
extra paranoid, you can check the fingerprint against the one above:

  gpg --fingerprint 440C5437

If you are satisfied that you've got the right key, and the UIDs match
what you expect, I'd appreciate it if you would sign my key:

  gpg --sign-key 440C5437

Lastly, if you could upload these signatures, i would appreciate it.
You can either send me an e-mail with the new signatures (if you have
a functional MTA on your system):

  gpg --armor --export 440C5437 | mail -s 'OpenPGP Signatures' nolith@abisso.org

Or you can just upload the signatures to a public keyserver directly:

  gpg --keyserver http-keys.gnupg.net --send-key 440C5437

Please let me know if there is any trouble, and sorry for the
inconvenience.

Regards,

    --nolith

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iQIcBAEBCgAGBQJKIrouAAoJEEwefGVEDFQ3G0kP/2VVV6nOZyGq37S3vYtd7Aiy
koYGhYmZiKycA56PM+EDW46iGGRGFS1eBRn+aB0yDKIxi4r0NJ4g+j8K1ADfULNk
LG1W8eH0KVPtxR8PzW2wkSfMmwz0P4dR/ZGvtCLKvUBNeZvc72PH7O3IcoAlbK9T
scTPGkIvDJPfdYBPSJp7yUdPPFOzUKzGWehin8Jep+78QFWH5+9aAkRzlxJaC/OY
Q9E/3Oz9fB/xuwtWqRnYHv9zadGpPFqorskhkqilBidsmBaGm+kxg7Y9TRGPw3Jd
zLk+Cg3UFO1+qPTSS70axJ74AAwwiBvh5jX699mbXNabhTCU/cKi9Q3GdJayYP5b
9/TneMXfNpsjYaETGQ+ue1MsZW0UX9fFQ5t8ZxGFWA7sIQ2+wsuZlW1v+vWWdeFn
WMW8/tpuDNZ3/1ggmqkZZvXfNxpO8rfUhhpc1uUvwLSRp+Ao0owHDVeOLXVu2tvq
6oAdfT92fveA38xbBgej0PctWOcEe6cRST9fhilXGR/vnqa/WECmw6+kiY52DyLR
8yIY/YJL0YLKVxYwSwuEbMDYat0xkimugSEPWDiTwxMmf0lUxeN/d2ko5NdAyTku
uEW5TE1HSBqpexBqaQ1wRctYc0v3s9Nf2AVIITf76YDyNjTSFlPZuryNIKLHsD6Y
IaschVs1gJnzPSzTA1VviEYEARECAAYFAkoiui4ACgkQNPJSfZ8E7V5KSwCfcnYw
AEey1qw63XrFQ8aNbTFqQJUAniK6mB/r5zvPBJw0doUinBYQZsTf
=2/N1
-----END PGP SIGNATURE-----
(l0g.in 3zvHP6)

heroku.com il deploy di applicazioni rack-based è un gioco

Ieri sera ho scoperto un servizio interessante, si chiama Heroku ed è un hosting di applicazioni basate su rack come ad esempio Ruby on Rails o Sinatra.

Fino a qui nulla di nuovo, ma il loro sistema si basa sulla semplicità della procedura di deploy che come ben sa chi ci ha provato, non è proprio al livello di una applicazione php.

Per provare un po’ questo sistema ho deciso di creare una mini applicazione con sinatra che esegue l'hash MD5 di alcune stringhe. Vediamo come funziona.

Prerequisiti

È necessario installare la gemma heroku; per l'applicazione dell'esempio serviranno anche le gemme sinatra e thin.

$ sudo gem install heroku
$ sudo gem install sintra 
$ sudo gem install thin

Per il deploy serve git. Scaricabile da qui.

Fatto questo è necessario registrare un account su Heroku.

L'applicazione

Creiamo il file hasher.rb dentro la cartella hasher.

require 'rubygems'
require 'sinatra'
require 'digest/md5'

get '/' do
  erb :home
end

post '/md5' do
  unless params[:str].nil?
    "<code>MD5(#{params[:str]}) -> #{Digest::MD5.hexdigest(params[:str])}</code>"
  else
    redirect '/'
  end
end

# Accettiamo solo richieste in POST
get '/md5' do
  redirect '/'
end

use_in_file_templates!

__END__

@@ home

<p>
Questa è una semplice webapp (esagerato!) per spiegare come funziona 
<a href="http://heroku.com">Heroku</a>.<br></br>
Puoi trovare l'articolo relativo nel mio 
<a href="http://bit.ly/nkw0V" rel="me">blog</a>.
</p>

<form action="/md5" accept-charset="utf-8" method="post">
  <input type="text" name="str" value="Write here..." id="str"></input>
  <input type="submit"></input>
</form>

Per il deploy con rack è necessario creare anche il file config.ru

#rack config file
require 'hasher'
run Sinatra::Application

Il deploy

Ora giunge il momento di mandare online la nostra applicazione

#creiamo il repository git nella cartella corrente
$ git init
Initialized empty Git repository in /Users/nolith/Documents/Projects/hasher/.git/

#aggiungiamo tutti i file nella cartella al controllo di versione
$ git add .

#eseguiamo il commit dei file
$ git commit -m 'Import iniziale: hash md5'
[master (root-commit)]: created 21b62e4: "Import iniziale: hash md5"
 2 files changed, 41 insertions(+), 0 deletions(-)
 create mode 100644 config.ru
 create mode 100644 hasher.rb

#creiamo una nuova applicazione su heroku
# sarà possibile rinominarla in seguito
$ heroku create
Enter your Heroku credentials.
Email: utente@server.it
Password:
Uploading ssh public key
Created http://growing-summer-43.heroku.com/ | git@heroku.com:growing-summer-43.git
Git remote heroku added

#eseguiamo l'upload dell'applicazione
$ git push heroku master
Counting objects: 4, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 784 bytes, done.
Total 4 (delta 0), reused 0 (delta 0)

-----> Heroku receiving push
-----> Rack app detected
       Compiled slug size is 004K
-----> Launching..... done
       App deployed to Heroku

To git@heroku.com:growing-summer-43.git
 * [new branch]      master -> master

#Proviamo la nostra applicazione
$heroku open

Alcune note

La prima volta che si utilizza un comando di heroku vengono richieste le credenziali di accesso e viene fatto l'upload di una chiave pubblica ssh (Come creare una coppia di chiavi per ssh).

Finito! Siamo online!

Conclusioni

Quanto mostrato si può fare anche per una applicazione Rails, in questo caso non servirà il file config.ru. Attualmente il deploy di una applicazione basata su rack non è dei più semplici, anche se devo dire che mod_rails ha notevolmente migliorato le cose. Dobbiamo però considerare anche il fattore economico, per piccole applicazioni di test heroku è gratuito, per applicazoni che necessitano di risorse consistenti direi che la scelta di basarsi su AWS è un vantaggio non da poco, i benefici offerti dalla struttura di Amazon sono impossibili da ottenere ad un costo contenuto per uno sviluppatore indipendete o una PMI.

(l0g.in 3zhDy9)

Social Links plugin with rel="me", Identi.ca, Bitbucket and Github support

UPDATE: I’ve forked Social Links, please refer to About Me.

Today I made a little patch of Social Links Wordpress Plugin in order to add identi.ca, Bitbucket and Github support and for adding rel="me" tag to the generated links (see XFN for more details).

I’ve uploaded the plugin on bitbucket, so you can see the diff with Social Links 1.0.11. If you want to install it, go to the download page.

(l0g.in 3zcCHW)
Alessio

Hello. My name is Alessio Caiazza. I'm also known as nolith. I love writing code and technology. I'm passionate about production engineering.

This is where I write my thoughts trying to follow IndieWeb principles.

Staff Backend Engineer, Delivery @ GitLab

he/him/his

IU5BON HamRadio callsign

"Il sapere umano appartiene al mondo."

An IndieWeb Webring 🕸💍