Tutti gli articoli di calcifer

Lasagne vegetariane senza besciamella

20141116_200803_Via Nino Bixio

Oggi ho provato a fare delle lasagne vegetariane senza usare besciamella. E’ una ricetta che ho inventato al momento, ma l’esperimento è riuscito e le lasagne ottenute non sono niente male!

Ingredienti (per una teglia di 30cm x 20cm):

  • Lasagne (4/5)
  • 250 gr di ricotta
  • 2 uova
  • 1 zucchina grande
  • 2 carote
  • 1 porro
  • 1 cipolla
  • mezza verza
  • mezzo cavolfiore

Preparazione del Ragù di Verdure

Tagliate a pezzetti un po’ grossi le verdure: cavolfiore, carote, zucchine.
La verza sarà difficile tagliarla a pezzettoni, basta tagliarla a striscioline.
Fare soffriggere cipolla e porro e mettere tutte le verdure ESCLUSE le zucchine. Le zucchine è meglio metterle a metà cottura perchè hanno un tempo di cottura inferiore alle altre verdure.
Coprire con un coperchio in modo da far cuocere al vapore per circa un’ora. Ricordatevi però che il tempo indicato è PURAMENTE INDICATIVO. L’importante è che le verdure si cucinino e si inteneriscano SENZA diventare una “pappa”.

Mettete sale e pepe secondo i vostri gusti.

La “Finta besciamella”

Nel frattempo mettete la ricotta insieme alle uova e ottenete una crema che sarà la nostra “finta besciamella”.

La Lasagna

Io ho cotto nell’acqua bollente salata le lasagne per metà della cottura indicata nella scatola. Questo permette di diminuire e migliorare la cottura una volta che le metterete in forno nella teglia, ma presenta una controindicazione: le lasagne bollenti sono difficili da manipolare e posizionare nella teglia. Forse sarebbe bastata una cottura classica solo al forno. E’ una prova da fare…

Gli strati nella teglia

A questo punto ci sono da farcire gli strati di lasagna nella teglia.

Non l’ho unta con niente, nè olio, nè burro, nè margarina. Ho semplicemente messo un po’ della “finta besciamella” sul fondo, poi ho messo la lasagna e poi il ragù di verdure.

Si continua così a formare più strati. Quando arrivate in cima alla teglia, cercate di avere la lasagna, sulla quale metterete la “finta besciamella” che vi rimane e una bella spolverata di grana grattuggiato (per ottenere la doratura e la crosticina).

Mettete in forno a 200° per circa mezz’ora, con la teglia nella parte alta del forno sempre per ottenere la doratura.

 

Chiaramente le verdure per il ragù possono essere diverse da quelle che ho usato io, quindi ci si può sbizzarrire a fare diverse varianti di queste lasagne. L’importante è ottenere qualcosa di simile ad un ragù, quindi niente verdure che si spappolano troppo. Chiedete pure se qualcosa non vi è chiaro o se avete dei consigli per migliorare la ricetta!

Drupal: how to delete Fields with a lot of data inside

The problem:

in my Drupal Production instance, i need to remove some Fields. They are no more used but they are full of data already. in their DB tables i have millions of records and many GB occupied. What is the best way to clean my instance and save a lot of space?

The Solution:

The easiest thing you can do, is to go to Drupal > Administration Pages > Content Types > Manage Fields and remove the Field. I did it. The page start to load, but never finish.

What happens inside Drupal? Fortunately, nothing really dangerous, but it was clear to me that this wasn’t the best way to perform my task.

So i decided to understand better how Drupal purge massive data.

Essentially, Drupal has two phases of deletion:

  1. as you remove a node, or a field or something else (using Administration Pages or Drupal core functions), it marks the element as “deleted”. In my case, if the name of the Field was “myfield”, in the table field_data_field_myfield, the DB field “deleted” is set to 1.
  2. a cron job (“Purges deleted Field API data” by Field Module) has the responsability to phisically delete record mark as deleted.

It’s better to manage each of these phases, in this way:

  1. The first phase has nothing particular complicated, but if it has to mark a lot of records as deleted, it can run in several seconds or minutes. so, it’s not a good idea to launch it from a web page. it’s better to create a cron job that programmatically remove elements, and tune it depending on your system performance (1000 elements per minute, or 10000 elements per minute, etc.)
  2. the cron job is more complicated and there are different changes to do:
    1. in modules/field/field.module, you can find the hook_cron implementation. as you can see in the code, there is a $limit variable that is set to 10 by default. so, this job runs every five minutes and manage 10 ELEMENTS. If you have to delete millions of elements, you will finish in some years… I’ve changed the value in 1000 or 10000.
    2. the cron job uses field_config and field_config_instance tables to decide what it has to delete. if the Field that you want to delete it’s not present in ALL these tables, it doesn’t consider your Field, even if in the Field table there are elements marked as deleted. So, check these tables.

If you have any questions, I’m happy to answer you!