Wednesday, October 28, 2009

Using Mendeley effectively on multiple systems using an external storage drive

If you do not already know, Mendeley is soon to become the defacto standard for storing, indexing, searching, ordering and sharing all your academic research papers. Its free download and easy to setup. Check the website to get a feel for it. I will not describe Mendeley here but will get to my point.

WARNINGS

The solution presented below worked for me. It may NOT work for you. There is destruction of state involved so please go through the complete post and decide for yourself. I am making certain assumptions about this solution, so make sure your assumptions match mine before trying this out.

Assumptions:
  • My environment is Mendeley Desktop v 0.9.4.1 running on Ubuntu 9.04.
  • I assume good familiarity with Linux and esp. Ubuntu.
  • I assume you have 2 working Mendeley setups on both systems. Will still work if you dont have but all steps may not apply.
  • I assume that you have access to the original data that you indexed with Mendeley.
  • The solution may break with future releases of Mendeley esp. if they change some of the document paths.
  • This solution may not easily port to Windows/ MAC though i believe the line of reasoning should still apply.
  • I have used Mendeley possibly since its first release and i am quite familiar with its interface / settings etc.

My Problem

I have 2 Ubuntu 9.04 systems (home and work) that i use for my research and i spend equal time on both of them. So i end up storing a lot of papers (my total collection is about 5000) on both. Once i discovered Mendeley (about 5-6 months back), i would index documents on both my systems separately and then sync up the bibliographies (and corresponding metadata like notes) with Mendeley Web (which is the online component of the Mendeley system). Now, though i had access to the full bibliography on both my systems, i could not access the corresponding documents on both systems i.e. i could only access documents on the system on which they were indexed.

Mendeley currently gives an online account with 500MB storage and allows storing documents in it. My collection is somewhere about 5GB and its not worth syncing that much anyway esp. since some of it is of proprietary nature. But i desperately needed a solution since i am so used to using Mendeley now and need it whenever i am doing my work.

So this is what i did:

Initial Setup
  • I got a 120GB external harddrive and formatted it with ext4 (filesystem doesnt matter).
  • Then I set the properties of the external drive to always mount as /media/extstor2. This ensures that we always have a constant path prefix whenever you attach the drive. This can be easily done by clicking properties of the drive, selecting Volume tab and fixing the mount point settings (works on Gnome).
  • Created two folders called db and papers on the new drive.
mkdir /media/extstor2/db
mkdir /media/extstor2/papers
On my home system
  • I first reset my complete database. WARNING: This will completely destroy the database (i.e. your bibliography and notes but NOT your documents). I hate this step but this was necessary because mendeley stores absolute paths to all its documents (you can dig into their sqlite3 database and see for yourself) and so if you just shift the database onto a new folder all references to documents get messed up. Even using the repair option of Mendeley doesnt fix this. This should be a good feature for them to add soon. 
mendeleydesktop --reset
    • After this i logged into my online account and deleted the entire collection from there. Note that if you have any notes attached to the document, this is the time to save them. There is no easy way to do that except cut and paste into some text editor.Note that the above step is essential because i think Mendeley has a bug where if it synchronizes again with the online account after you have created a new local database things get extremely messy and it crashes. Talking with experience here.
    • Now come the tricks:
    cd /media/extstor2/db
    mkdir Mendeley\ Ltd.
    cd ~/.local/share/data
    rm -rf Mendeley\ Ltd.

    ln -s /media/extstor2/db/Mendeley\ Ltd./ Mendeley\ Ltd.
    • What i am doing above is essentially repointing the database location to the external drive. Note that this also means that you will always require the external harddrive to use Mendeley.
    • Opened up Mendeley again. This time it should start with nothing in it and offer you to login into your online account. DO NOT LOGIN YET.
    • Opened Tools->Options and clicked on File Organizer.
    • Enabled the 'Organize My Files' tab and set the path to /media/extstor2/papers
    • Enabled other options as desired.
    • Now logged in to my online account and let it sync. Nothing should sync as nothing exists but it is good to let the desktop handshake with the web account.
    • I then added all my folders where i keep my collection. Luckily i had not deleted them.
    • After this i let Mendeley index my complete collection (takes time proportional to your collection and system speed). Took about 5-6 hours.
    • Once done, coped all the saved notes to the corresponding papers. Had to do manually :(.
    • Then i synchronized again with the online account.
    At this point we have a working database stored on the external harddrive. Now take this drive to your other system and proceed as follows:

    On the work system
    • Connected the drive to the system and mount it as /media/extstor2 to begin with.
    • Then set the properties of the external drive to always mount as /media/extstor2. This ensures that we always have a constant path prefix whenever you attach the drive. This can be easily done by clicking properties of the drive, selecting Volume tab and fixing the mount point settings.
    • Reset current database. 
    mendeleydesktop --reset
      • Tricks Again
      cd ~/.local/share/data
      rm -rf Mendeley\ Ltd.

      ln -s /media/extstor2/db/Mendeley\ Ltd./ Mendeley\ Ltd.
        • Opened up Mendeley.
        • Opened Tools->Options and click on File Organizer.
        • Enabled the 'Organize My Files' tab and set the path to /media/extstor2/papers
        • Enabled other options as desired.
        • Now logged in to my online account and let it sync. Now i saw everything just the same way as my home system.
        • Added your desired folders for watching files on my work system.

        That's it!!! Problem solved. Enjoy. Let me know if this solution solves somebody else's pain.

        Tuesday, October 13, 2009

        A possible Twitter Worm or Scam!

        I got 4 email messages today saying that 4 people (whom i do not know) are following me on Twitter. Seems to me to be a possible twitter scam with a possibility that it might be a new worm.

        These are my observations for now:
        1. All four accounts belong extremely good looking girls
        2. All seem to be from Mumbai, India.
        3. All have the same Bio line which says "I am smart and simple girl, wanting to make some good friends"
        4. All have about 800 followers and are following about 400 people.
        5. All have almost the same tweets which are a combination of marketing website links and some mundane tweets albeit in different order.
        6. All accounts were created on Oct 6th.
        7. The tweets are posted using a combination of API and Web with lots of them being from the web.API alludes to a script doing the posting.

        Questions i have:
        1. How did they get so many people to follow their accounts in such a short time? Seems to me like some bug is being exploited. Or maybe people really fell into the beauty trap?

        If anyone is interested these are the four twitter accounts
        • http://twitter.com/mariya_gonzales
        • http://twitter.com/pari_choudhary
        • http://twitter.com/mansi_joshi
        • http://twitter.com/janhavi_agarwal

        More updates as i debug this further!

        Monday, October 12, 2009

        Simple way to show India's Diversity

        Westeners who have never been to India or have never heard about it do not seem to get the fact the there is no language called "Indian" or food called "Indian Food" or music called "Indian Music". They just dont get the fact that India is NOT "yet another country with a language, food, culture and tradition". There is so much diversity in the country that the only way to think of India is as a country of countries (I am purposely not saying of 28 countries because there is so much diversity even within states).

        A simple way to show India's diversity would be to take a currency note of any denomination and count the number of languages in which the denomination is translated. There are 17 in total. See for yourself



        To know what those languages are check this link from Reserve Bank of India website. http://www.rbi.org.in/scripts/ic_languagepanel.aspx.