Visualizzazione post con etichetta tech. Mostra tutti i post
Visualizzazione post con etichetta tech. Mostra tutti i post

mercoledì 24 agosto 2011

Android Honeycomb 3.2 + mtpfs

In protest against Google censorship of Blogger blogs in some countries, this post has been moved to Wordpress.

Questo post è stato spostato su Wordpress in protesta contro la censura applicata da Google su richiesta dei governi di alcuni paesi.

domenica 21 agosto 2011

The many paths to disk UUIDs

In protest against Google censorship of Blogger blogs in some countries, this post has been moved to Wordpress.

Questo post è stato spostato su Wordpress in protesta contro la censura applicata da Google su richiesta dei governi di alcuni paesi.

giovedì 18 agosto 2011

Are Gnome and KDE giving up the desktop battle?

In protest against Google censorship of Blogger blogs in some countries, this post has been moved to Wordpress.

Questo post è stato spostato su Wordpress in protesta contro la censura applicata da Google su richiesta dei governi di alcuni paesi.

lunedì 8 agosto 2011

Logging for HAProxy on CentOS 5.x

In protest against Google censorship of Blogger blogs in some countries, this post has been moved to Wordpress.

Questo post è stato spostato su Wordpress in protesta contro la censura applicata da Google su richiesta dei governi di alcuni paesi.

sabato 6 agosto 2011

Installing Android SDK on Eclipse (Fedora 15)

In protest against Google censorship of Blogger blogs in some countries, this post has been moved to Wordpress.

Questo post è stato spostato su Wordpress in protesta contro la censura applicata da Google su richiesta dei governi di alcuni paesi.

giovedì 4 agosto 2011

Rewriting addresses in Postfix with regular expressions

Today my employer asked me to look into Postfix. We should take an address like root@some.obscure.host.local.lan and make it into root.some.obscure.host@domain.tld.

Looking at the (good) documentation from Postfix, I managed to get a solution. You should change in /etc/postfix/main.cf:

canonical_maps = regexp:/etc/postfix/rewrite

and the /etc/postfix/rewrite file will contain:

/^(.*)@(.*)\.local\.lan$/     ${1}.${2}@domain.tld

sabato 23 luglio 2011

Ignore a word in a regular expression

Today a friend of mine asked me a tricky regexp related question: he wanted to match against a set of strings like:

WORD_FOO
WORD_BAR
WORD_FOOBAR
WORD_QUUX
WORD_FAR

He did want to match and store any string starting with WORD_ and followed by a valid word, unless it was FOO. So it should match all the aforementioned lines but WORD_FOO.

Tricky.

He was using something like /^(WORD_[^\s]+)$/, so I suggested using [^\s|VERSION] (I did wake up only a few moments before), but of course that doesn't work, since it would exclude all strings containing the characters V, E, R, S, I, O, N.

It took me some digging, but finally I found this answer on StackOverflow that documents the use of negative look-arounds.

Using these constructs I managed to get this regex: WORD_((?!FOO\W)\S+) that satisfies the requirements (you can check it on Rubular).

How does it work?


(?!FOO\W) checks the next characters of the string. If they DON'T (!) contain the word FOO followed by a non-word (whitespace, etc) character (\W), then the matching will be made against \S+ (one or more non whitespace characters). So you'll get the second part of the word in your \1, $1, etc.

If you want to ignore all sub-strings starting with FOO, you can get rid of that \W.

mercoledì 20 luglio 2011

Good tip on better font rendering in Fedora

I just finished reading this good tip on how to obtain better font rendering on Fedora.

Results are good, so I just wanted to share the link :)

martedì 19 luglio 2011

OTRS Apache + mod_perl configuration on Debian/Ubuntu

In protest against Google censorship of Blogger blogs in some countries, this post has been moved to Wordpress.

Questo post è stato spostato su Wordpress in protesta contro la censura applicata da Google su richiesta dei governi di alcuni paesi.

lunedì 18 luglio 2011

Find and download VirtualBox guest additions ISO for Fedora 15

RPMFusion release of VirtualBox doesn't bring VirtualBox guest additions ISO, so you're off to download it yourself.

The ISO is available from the official site download section, just go to the folder of your version and look for the VBoxGuestAdditions.iso file.

domenica 17 luglio 2011

Running an external process from Ruby

Running an external process from a Ruby script is quite easy: use backticks (output = `command`) or the %x method (output = %x[command]).

There are more options like system and exec and even more advanced ones like popen, popen3 and popen4 that allow you to manage process stdin/stdout/stderr.

A good resource with more examples is Nate Murray's 6 Ways to Run Shell Commands in Ruby.

mercoledì 13 luglio 2011

Find packages starting with a string with apt or aptitude

Searching for packages with apt-cache or aptitude is quite easy, but what if we want to find a package name starting with a specific string?

With apt-cache:

$ apt-cache search mysql | grep '^mysql'
mysql-cluster-client - MySQL database client (metapackage)
mysql-mmm-agent - Multi-Master Replication Manager for MySQL - agent daemon
mysql-mmm-common - Multi-Master Replication Manager for MySQL - common files
mysql-mmm-monitor - Multi-Master Replication Manager for MySQL - monitoring daemon
mysql-mmm-tools - Multi-Master Replication Manager for MySQL - tools


With aptitude:

$ aptitude search ^mysql
p   mysql-admin  - GUI tool for intuitive MySQL administration
p   mysql-client  - MySQL database client (metapackage)                              
v   mysql-client-4.1  - 
p   mysql-client-5.1  - MySQL database client binaries
i A mysql-client-core-5.1  - MySQL database core client binaries
[...]

domenica 10 luglio 2011

JMeter e il load testing che vorrei

Questo è un rant. Ve lo dico subito, così potete non leggerlo.

In questo post voglio lamentarmi di JMeter, non perché sia un cattivo strumento di load testing, anzi, è sicuramente il migliore del panorama open. Il problema è che non è abbastanza.

La complessità delle web application moderne è tale che i test di carico basati su banali sequenze di URL richiamate in serie non garantisce affatto un risultato credibile.

Un tool moderno dovrebbe essere in grado di generare "modelli di comportamento degli utenti", in modo da poter testare carichi reali delle web app, sia partendo da una singola navigazione (con analisi dei possibili comportamenti applicabili in una pagina), sia estrapolando i modelli da log già esistenti di utilizzo. Inoltre, dovrebbe permettere di emulare automaticamente i comportamenti del browser riguardo al caricamento di immagini, css, js, etc. Ad esempio:

  • l'utente effettua il login alla webmail (load della pagina di login e tutti gli elementi correlati, chiamata POST per il login, caricamento dell'interfaccia della webmail e relativi elementi correlati)
  • l'utente controlla la inbox e clicca su uno dei messaggi (chiamata GET o AJAX per spostarsi alla visualizzazione del singolo messaggio)
  • l'utente risponde al messaggio (ancora, chiamata GET o AJAX per caricare l'interfaccia di composizione del messaggio; all'interno di tale interfaccia potrebbero essere presenti altre chiamate al server, ad esempio per l'auto-completion nel campo degli indirizzi)
  • l'utente invia il messaggio di risposta, viene ricaricata la inbox (chiamata POST o AJAX che implica anche un test di carico per il server di posta, chiamata GET o AJAX per ricaricare la inbox)
  • l'utente effettua il logout (chiamata GET o AJAX, caricamento della pagina di saluto)

Il tool, sostanzialmente, dovrebbe essere in grado di ricostruire le interfacce tra i vari elementi della web app e permettere di costruire i modelli di comportamento senza tener conto dell'implementazione spicciola, ma lavorando su concetti più ad alto livello.

Poi, per replicare un carico reale della piattaforma, si potrebbero creare diversi gruppi a cui applicare diversi comportamenti (ma questo si può già fare con JMeter).

Con una base del genere, poi si potrebbe iniziare a sperimentare sul serio, per misurare le prestazioni del sistema in casi che ancora non si sono verificati (es. pubblicazione in homepage di qualche grosso portale ed "effetto slashdot", pubblicazione di una news "virale" o vero e proprio attacco virale (facebook worms) alla piattaforma per cui la condivisione tra utenti cresce esponenzialmente, etc).

domenica 3 luglio 2011

Google+, Android, la pervasività del social

Da quando ho questi aggeggi Android, ho usato i servizi di Google molto più di quanto avessi mai fatto prima. E' strano, per me, perché non amo molto Google, né il cloud. Il cloud non lo amo per nulla, in effetti.
Almeno com'è implementato ora.

Mi piacerebbe - e forse, chissà, col tempo ci arriveremo - poter scegliere separatamente infrastruttura e servizi, per esempio. Vorrei poter scegliere di usare Google+, ma salvare le foto su Flickr. Oppure Smugmug. O, ancora, in raw su Amazon S3 o Dropbox.

Vorrei poter leggere i feed (magari anche offline, grazie alle funzionalità di HTML5) e salvare i bookmark su un servizio di mia scelta, non necessariamente usando Google Reader e Google Bookmarks. Per esempio, io ora uso Fastladder per aggregare i feed e una installazione di scuttle su un server privato per salvare i bookmark.

Sarebbe bello se ci fossero delle API aperte (W3C? Mi senti?) per permettere ai vari servizi di scambiarsi i dati e migrarli quando IO lo decido. E se un giorno volessi togliere tutto? Facile, farei un backup dello storage (Amazon S3? Dropbox? Ubuntu One?) e poi cancellerei tutto.
Milioni di broken link :)
(e di oggetti storati nella cache di Google o salvati su altri milioni di hd nel mondo)

Ormai sono anni che si parla di Semantic Web come di quello che sarà il Web 3.0, ma forse sarà la standardizzazione del cloud e dei servizi che su di esso si appoggiano a costituire il prossimo passo.

Mount an Android Honeycomb device under Linux

So, Android Honeycomb only uses the MTP protocol for the USB connection. Linux has decent support with mtpfs, and the instructions are quite easy to follow (this article is based on that one).

First of all, after installing mtpfs, create a new directory (I'm using transformer since I own an Asus Transformer, feel free to use whatever you want):

$ sudo mkdir /media/transformer
$ sudo chmod 755 /media/transformer
$ sudo chown your_username:root /media/transformer

Then edit /etc/fstab

$ sudo vim /etc/fstab

And add:

mtpfs  /media/transformer  fuse  noauto,users,umask=033,allow_other  0 0

Save, exit, then mount

$ sudo mount /media/transformer 

Important: umount the device before unplugging, or you risk corrupting the filesystem.

venerdì 24 giugno 2011

Android, day one (and an half)

So, I finally got my Android smartphone AND tablet. I've been toying with them for about a day now and I wanted to share some toughts and some thing I learned.

  • Don't plug Asus Transformer USB charger on your UPS, it didn't play well for me (bad smell, I tought it burned but it works fine on a wall plug)
  • Android doesn't connect to wifi network if the SSID contains spaces
  • Most Android devices doesn't work out-of-the-box on wifi channel 13 (this sucks)
  • Android is marketed as "open", but most "apps" on the market are closed source and the App Market model isnt open at all. Also, the "app" model isn't open.
  • Many web sites recognize mobile browsers. Sadly, most fail to check the screen resolution: what's the point in providing a mobile version on a 1280x800 pixel screen (tablet)?
  • Flash runs smooth. Better than on my desktop. Adobe, you fail badly.
  • Skype sucks also on mobile.
  • Problem is: GTalk sucks too. Maybe in ten years we all will be using GNU Free Call. But I want it now.

Updates will follow.

venerdì 10 giugno 2011

Compiling Pound 2.6e with openssl-1.0.0d on CentOS 5.6

In protest against Google censorship of Blogger blogs in some countries, this post has been moved to Wordpress.

Questo post è stato spostato su Wordpress in protesta contro la censura applicata da Google su richiesta dei governi di alcuni paesi.

lunedì 6 giugno 2011

Compiling Pound 2.6e on CentOS 5.x

In protest against Google censorship of Blogger blogs in some countries, this post has been moved to Wordpress.

Questo post è stato spostato su Wordpress in protesta contro la censura applicata da Google su richiesta dei governi di alcuni paesi.

sabato 28 maggio 2011

Install Skype on Fedora 15 x86_64

In protest against Google censorship of Blogger blogs in some countries, this post has been moved to Wordpress.

Questo post è stato spostato su Wordpress in protesta contro la censura applicata da Google su richiesta dei governi di alcuni paesi.

Can't bear with Gnome 3

I finally installed Fedora 15, as anticipated.

And with Fedora 15 comes Gnome 3. I tried using it. But my patience was quite short: they changed a lot of interaction in subtle ways, so the gap with the previous version is not only based on the new graphical aspect, but also on different behavior.

Gnome 3 managed to get me on KDE 4. Problem is: while Gnome 3 is blazing fast, KDE 4 is slow. In the past I tried it on my netbook and I tought it was slow due to hardware shortcomings, but now I'm using it on my 3-core Phenom 2.3GHz with 8Gb RAM and Radeon HD4890 video card (open source drivers).

It's... slow. Painfully slow. Switching desktop it's so slow I checked if it was doing that in software, but desktop effects are active.

But despite Gnome 3 technical superiority, all the glitches at the moment are more important to me than the speed. Maybe I'll try something more exotic, like Openbox + AWN (like AriOS), but for the moment I'll stick with KDE.

I'll give Gnome another chance in a few months...