Adobe Lightroom basics

  1. Lightroom is all about non-destructive editing – so don’t try to save over your originals.
  2. Lightroom doesn’t ‘contain’ files, it just holds data about them – so don’t go deleting your originals thinking that they’re safely stored in Lightroom.
  3. Lightroom’s backups don’t back up your originals – you still need to do that.
  4. Lightroom’s catalog is just a database, and databases can become corrupted – backup regularly, and keep older backups for a while.
  5. Lightroom needs to know where the files are – don’t move or rename files outside of Lightroom, i.e. in Explorer or Finder, otherwise you’ll have a long job fixing all of the links.
  6. Lightroom will not match your cameras rendering when working with raw files as it’s just raw data, but you can use the new profiles to emulate the manufacturer’s look for some cameras, or you can build your own profile to match.
  7. Lightroom offers a choice of different colour spaces when you output, and AdobeRGB/ProPhotoRGB will look odd in programs that aren’t colour managed (like web browsers). Use sRGB for screen output like emailing or uploading to the web.
  8. Lightroom’s Grid view behaves differently to other views – anything you do in Grid view applies to all selected images, whereas other views only apply to the most selected image.
  9. Lightroom has 3 different levels of selection, not 2. Notice the difference, otherwise you could accidentally apply a setting to multiple different images.
  10. Lightroom’s Flags are local to the folder or collection, whereas star ratings and labels are global. This means that a photo can be flagged in one collection but not flagged in the folder.
  11. The first view of an imported Raw file before Lightroom renders its own preview often disappoints new users of lightroom.
    What you first see is the camera produced jpeg, which has ‘in camera’ software adjustments applied, sharpening, contrast, saturation etc (depending on what settings you have programmed the camera to apply)
    Then almost instantly, Lightroom renders its own jpeg preview, which is an accurate portrayal of how the raw file would look if converted to a jpeg without any extra enhancement at all.
    The idea being that you apply your own editing to a the blank canvas of the raw image, rather than rely on the cameras idea of how the image should look.
  12. Don’t export your images to edit in “Photoshop etc”, use the preferences to set up “Photoshop etc” as an external editing programme and then use the Lightroom ‘Edit With’ function, thenwhen you have finished editing, use the ‘Save’ function (and not ‘Save As’) to return your edited copy to Lightroom.

The Very Basics of How Lightroom Works

You take a photograph and transfer it to your computer, it is stored in a folder somewhere on your hard disk. Within that photograph file is stored some meta-data about the photograph (the EXIF data) including f-stop, shutter speed etc etc.

When you import a file into LR you are essentially telling LR about a file on disk. It looks at the file, reads the metadata and creates a record within it’s own database (called a LR catalog) and stores what it knows about the photograph in that record. What is key to understand LR is that at all times the original photo remains unchanged, it stays in it’s original state regardless of what you do in LR. LR creates a JPEG ‘preview’ of the photo, stores it against the record in it’s database and that’s what it displays when you are in library mode.

If you edit the photograph LR takes the original photo, applies the effect of the changes you’ve made and displays what the photo looks like with these changes applied. It does NOT change the original photo data. It keeps a note of these changes in it’s database, against the record it created for the picture when you imported it.

If we assume we’ve taken a photograph and used LR to increase the exposure by 1 stop then LR has a record for that photo and against that record are the instructions to ‘increase exposure by 1 stop’. When you view the photo from within lightroom that instruction is applied to the original data and you see a lighter file. Again be clear – the original photo data remains the same. If you use some other piece of software to ‘look’ at the photo on disk you will see it as you took it, no changes applied.

If you now want to do something with your ‘new’ photo, lets say post if on Flickr, you have to export it, with the LR changes applied and thus create a new file. You now have 2 copies of the same photo, one the original and one the version with changes applied. Having done whatever you needed to with the ‘new’ file (lets assume uploaded to Flickr) you can delete it, safe in the knowledge you can create another identical copy from within LR should you need it (assuming you do no further edits to it with LR).

If we understand the above then hopefully we can see that in order to have an adequate backup of our body of work we need to ensure two things are safe:

  1. The original photo file
  2. The LR catalog where all out work (edits to be applied) are stored.

LR offers a method of backing up it’s catalog automatically, that process makes a copy. What’s important is the user ensures that copies of the backup-up catalog are stored somewhere other than the same disk of the same computer. If you lose the hard disk and all your backups are on it you lose the lot.

That’s the basic position, it gets a whole lot more complicated once to start to consider virtual copies, metadata sidecar files etc.

Source and more information: Adobe Lightroom Flickr group FAQ

Disable cron log on syslog and enable cron.log

By default, Ubuntu logs all cron activity directly to syslog (/var/log/syslog), instead to a dedicated file like /var/log/cron.log.

In my opinion, it is best to keep them separate if you have several cron jobs running on your server.

To enable this behavior, what we must do is edit the syslog configuration file /etc/syslog.conf, and modify the following lines:

  • Change *.*;auth,authpriv.none with *.*;auth,authpriv,cron.none, this will avoid the messages to be recorded on the syslog file.
  • Uncomment (removing the # character) the line starting cron.*, this will record the messages to the specified file on that line.

Then, we need to restart the syslog service, doing the following:

$ sudo /etc/init.d/sysklogd restart

And maybe, restarting the cron service also:

$ sudo /etc/init.d/cron restart

Sources: this and this.

Fixing WMI Service (root\cimv2 namespace missing)

I was working on a VBScript code that uses the Windows Management Instrumentation (WMI) to query the running processes on the local machine, something like this:

strComputer = "."
strProcess2Kill = "something.exe"
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery("Select * from Win32_Process Where Name = " & strProcess2Kill)
For Each objProcess In colProcess
	'Now we will each one of the running processes "something.exe"

This code works in, at least, Win2k, WinXP, WinVista and Win7 (not sure if works on WinNt 4). The problem I had (as you can see here) was that the box where it should have been deployed (Win2k) showed an 0x8004100E error (Namespace specified cannot be found) on the 4th line of the code.

When I ran the following script to query all the namespaces on root:

strComputer = "."
Set objSWbemServices = GetObject("winmgmts:\\" & strComputer & "\root")
Set colNameSpaces = objSwbemServices.InstancesOf("__NAMESPACE")
For Each objNameSpace In colNameSpaces
 Wscript.Echo objNameSpace.Name

I got this:


As you can see, the CIMV2 namespace was not present and it should have been. So, something was wrong with the WMI installation on that box.

Then, I ran a very nice tool called wmidiag.vbs (pointed by user Uros Calakovic on my StackOverflow question) to diagnose several problems with WMI. Unfortunately, the tool gave me the same error and no proposed solution. He also mention a couple of interesting screencasts that more than one may find useful.

At the end, Google gave me the final answer once again. Reinstalling the WMI into the Windows Registry and rebuilding the WMI Repository did the trick (I did both, but maybe only the Repository rebuilding helped me this time).

In any case, to rebuild the WMI Repository, these are the only required steps:

  • Stop the WMI service (net stop winmgmt)
  • Go to %windows%/system32/wbem (in my win2k, winnt, on XP would be windows)
  • Rename or remove the repository directory
  • Start the WMI service again (net start winmgmt)

And for reinstalling WMI, you should run these commands on a console:

winmgmt /clearadap
winmgmt /kill
winmgmt /unregserver
winmgmt /regserver
winmgmt /resyncperf

Como instalar Drupal en otros idiomas distintos al inglés

Hasta hace poco, el primer paso para instalar la traducción al español (o cualquier otra) del CMS Drupal era descargarla desde la sección Translations en la página del proyecto, pero esto ha cambiado con la introducción de Drupal Localize, un sub-sitio donde se está concentrando todo el trabajo de traducción al resto de idiomas distintos del inglés.

Para comenzar una instalación limpia de Drupal en español, lo primero que hay que hacer dirigirnos a la sección Download de Drupal Localize, donde encontramos el link hacia el servidor FTP donde se guardan las traducciones. Descargamos el archivo PO correspondiente para el core de la versión de Drupal que vayamos a usar (si es la versión 6, podemos usar este vínculo).

Luego, le cambiamos de nombre al archivo para dejarle solo el código del idioma y la extensión (en vez de tenerlo como por ejemplo, lo dejamos como es.po).

Después, colocamos este archivo en el directorio profiles/default/translations (es probable que tengamos que crear el directorio translations).

Finalmente, nos dirigimos al instalador de Drupal y ya debería aparecer la opción Español al comienzo del procedimiento.

Drupal instalation

Guía para comer chifa en Toronto

El Chifa es como se le llama a la comida china en el Perú, aunque se diferencia de esta comida oriental en la fusión con el paladar e ingredientes peruanos, que a nuestro gusto, la hace exquisita (por supuesto que la cocina china típica es una maravilla por si sola).

En Toronto abundan los restaurantes chinos y asiáticos en general (principalmente coreanos, vietnamitas, japoneses, thailandeses), por lo que uno no se puede quejar de la variedad de comida. Aunque siempre se extraña el Chifa.

Afortunamente, no es imposible encontrar este tipo de comida aquí. El primer paso es ir a New Sky Restaurant, en 353 Spadina Avenue, Toronto:

[googleMap name=”New Sky Restaurant” width=”425″ height=”350″ directions_to=”false”]353 Spadina Avenue Toronto, ON, Canada[/googleMap]

Una vez en el sitio, debemos pedir la carta de Chifa, hay al menos una mesera que entiende algo de español y sabe de que estamos hablando con lo de Chifa.

Nos traerán una carta en español, con los típicos platos que encontramos en cualquier chifa en el Perú, así que podemos comenzar a pedir con confianza Arroz Chaufa, Wantan Frito (lo que más extrañaba del chifa), Pollo Chi Jau Kay, Sopa Wantan, KamLu Wantan y por supuesto, no podemos olvidar pedir Inka Kola, que con todo combina (lamentablemente no encontramos en la carta Pollo Tipakay).

El último paso es disfrutar como si estuviéramos en el Perú.

Call a WebService from VBScript

While I was writing some code on VBScript to avoid manual tasks that we currently do with a bunch of files, I needed to automatically upload some information extracted from all these files to a SQL database. One way to do it is using a Web Service that receives the data and store it into the database.

Our Web Service is able to receive the following protocols: SOAP 1.1, SOAP 1.2 and HTTP POST. For simplicity, we are going to use HTTP POST, which receive the parameters in the query string format (param1=value1&param2=value2&…). In the other protocols (SOAP) we would need to send the parameters in a XML way (which is more powerful but a little more extensive to implement).

The expected HTTP request will be:

POST /WebService.asmx/WebMethod HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: length


And the response (in XML format):

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="">string</string>

So, to call the Web Service directly from the VBScript, we can use the following code:

'The object that will make the call to the WS
Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
'The object that will receive the answer from the WS
Set oXMLDoc = CreateObject("Microsoft.XMLDOM")
strParam = "string to pass"
'Tell the name of the subroutine that will handle the response
oXMLHTTP.onreadystatechange = getRef("HandleStateChange")
'Initializes the request (the last parameter, False in this case, tells if the call is asynchronous or not "POST", "http://localhost/WebService.asmx/WebMethod", False
'This is the content type that is expected by the WS using the HTTP POST protocol
oXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
'Now we send the request to the WS
oXMLHTTP.send "parameter=" & strParam
Sub HandleStateChange()
	Dim szResponse
	'When the call has been completed (ready state 4)
	If oXMLHTTP.readyState = 4 Then
		szResponse = oXMLHTTP.responseText
		oXMLDoc.loadXML szResponse
		'If the WS response is not in XML format, there is a problem
		If oXMLDoc.parseError.errorCode <> 0 Then
			WScript.Echo "ERROR:"
			WScript.Echo oXMLHTTP.responseText
			WScript.Echo oXMLDoc.parseError.reason
			WScript.Echo "Result: " & oXMLDoc.getElementsByTagName("string")(0).childNodes(0).Text
		End If
	End If
End Sub

The ready state tells us about the connection with the Web Service:

  • 0: Uninitialized – open() has not been called yet.
  • 1: Loading – send() has not been called yet.
  • 2: Loaded – send() has been called, headers and status are available.
  • 3: Interactive – Downloading, responseText holds the partial data.
  • 4: Completed – Finished with all operations.

Convert a String to a Stream

In C#, to convert a String into a Stream object, we need to use the GetBytes method (from the Encoding.ASCII package), this way:

byte[] bytes = Encoding.ASCII.GetBytes(xmlContent);

And then, use that byte array when instantiate a Stream (for example, MemoryStream or FileStream):

MemoryStream stream = new MemoryStream(bytes);

Windows 7 bug affecting Subversion

There is a bug on Windows 7 (and Windows Server 2008 R2) that relates to corrupted files error messages and affects several SVN’s operations (like commit and update). The detailed error message you can get is something similar to:

svn: Can't move '[repo]\.svn\tmp\entries' to '[repo]\.svn\entries': The file or directory is corrupted and unreadable.

And you can even get a Windows error message telling you about a corrupted file.

As I found in here and here, there is nothing to be afraid of, it is just another bug/error on Windows that is going to be fixed on SP1 (but there is already a hotfix ready to install). I haven’t finished test it myself (just missing the restart after the hotfix installation).

The hotfix’s download requires you to give your email address to Microsoft before they send you the link where you can download it (some way annoying). I have uploaded on my own server to avoid the process if I need it again, so you can get it from here if you want (remember that you should NOT download executables from non-trusted sources as they can contain viruses and harm your computer).

Forbid access to svn directories on Apache Web Server

Using Subversion to deploy and maintain updated web applications like WordPress, Joomla or even your development on a web server is very handy. One of the downsides I have found to this solution is that your web root will have hidden .svn directories all over the place (one per each directory on your application). This directories will not be hidden for the web server, so it is important to forbid browsers the access to them.

If you are using Apache, you can use the tips on this page.

If you use Apache 2.2 (I have not test it on other versions, but it should work also on 2.0 version) and have access to the configuration files, you can create the file /etc/apache2/conf.d/svn with the following content:

<Directory ~ "\.svn">
    Order allow,deny
    Deny from All

This will deny access to all the .svn directories on your web server. After you have create this file, do not forget to restart the web server so the changes can take effect.

Edit (26/May/2011): This can also be achieved using:

<DirectoryMatch .*\.svn/.*>
    Deny From All