Make Dropbox work with multiple OSes / multiple folders

This one’s completely due to my friend Debsankha.
Inquivesta, our science fest website, is a web app hosted via Google App Engine. We, the three developers of the app, use Dropbox to keep our files in sync. This’ll be a short article addressing two obvious issues I faced using the application.

1. How to make Dropbox sync to the same stuff from both Linux and Windows on a dual-boot machine.

The problem I came across while using Dropbox is the following: I have both Ubuntu and Windows installed on my laptop, and use one or the other at times to maintain and update the website. Therefore, it would have been great if I could install Dropbox in both these OSes and sync the same folder from both. I did install it on both OSes, but there was a stupid problem with syncing.

In Windows, when you set the directory in which you want your Dropbox shared folder, Dropbox makes a new folder called ‘My Dropbox’ inside that directory, and syncs it. There is no way to make it sync an already present folder, unless it’s named ‘My Dropbox’ (in which case you should select its parent directory in the Dropbox dialog box).

In Linux, the situation is exactly the same, except Dropbox now wants the name ‘Dropbox’ for its shared folder.

Therefore, you cannot sync the same folder from two OSes.
Stupid, stupid problem. I really think Dropbox should do something about it.

Anyway, Debsankha suggested something very simple and it worked. It’s to use a symlink, or a symbolic link, which is kind of like a shortcut in one place to files and folders in another place, but created at a low level.

Linux

In Linux, I made a symlink named ‘Dropbox’ to my Windows ‘My Dropbox’ folder, and set Dropbox to sync it. Now it was actually downloading files to/uploading files from my Windows Dropbox folder, without any redundant space consumption.

The way to make a symlink from ‘source folder’ to ‘destination directory’ (in my case ‘My Dropbox’ in Windows to ‘Dropbox’ in Linux) in Linux (Ubuntu) is the following:

  1. Using the GUI: Right-click the folder you want a symlink from, and select ‘Make Link’. Copy the symlink that’s created to whichever directory you want it in, and rename it if you want.
  2. From the terminal: Type the following in the terminal:
    $ ln -s ‘source folder’ ‘destination directory’
    Note that the symlink is placed in the ‘destination directory’. It’s not that ‘destination directory’ itself becomes a symlink. Think of the symlink as just a file, and it will be clear.

Windows

I had earlier tried to do a similar thing in Windows using a shortcut, and had concluded:

“It doesn’t. The shortcut syncs as a single .lnk file. Stupid.”

But a comment by Karl on this post has removed this disappointment. I’ll quote him:

“Yes, that is because ordinary Windows shortcuts are just .lnk files that Windows implements as a link to a file/folder, symlinks on the other hand are made on much deeper, filesystem level, the same level your files and folders are.

As of Windows Vista, Windows’s NTFS filesystem also supports symlinks. You can use the mklink command to create them. The syntax is:

mklink link target

In case you want to make a symlink of a directory, you need to use

mklink /D link target

command.

Please notice, that you need to do this using the administrator account (run command prompt as administrator), because the default security police prevents ordinary users from creating symlinks.”

Note that when you make a symlink in Windows, it looks exactly like the file/folder it’s linked to, so it is easy to confuse it for a file/folder actually residing there and taking up space, neither of which is happening. If you modify stuff in the target location, this will change to reflect that. CAUTION: This even works backwards for directory symlinks, so that deleting or modifying stuff contained inside the directory symlink affects the original files. However, the special case of deleting the whole directory that was the symlink itself, doesn’t delete the original directory.

2. How to make Dropbox sync files and folders outside its own folder.

I saw in the Dropbox website that people had a feature request: that Dropbox should be able to sync folders outside a single ‘Dropbox folder’. Dropbox has been delaying this update for a long time, and the users seemed to be very worked up about it. Frankly, now I don’t see what’s the holdup. It’s hilarious. There’s a very simple way to implement it using the above principle. In your Dropbox folder, just make a symlink of whatever file or folder you want synced, using the methods explained before for Linux and Windows.

This came as very obvious to Debsankha, who is used to working in Linux, and he wasn’t gonna post this anyway. I thought, what the heck, some people will definitely be helped with this info (like the ones shouting out their complaints in the Dropbox website).

Advertisements

Default fonts in Chrome appear in Italics

Most of my pages in Google chrome on Ubuntu 10.10 were showing text in bold and italics. I tried changing the default font settings of the browser, but those were okay. Then I tried to change the chrome theme, but that didn’t work either. Then I found a couple of threads that addressed the issue, but they were all directed towards Windows platforms. The essence of the idea, though, worked even in Ubuntu, when implemented a bit differently.

In Windows, I guess you have to open the Arial font from your Windows/Fonts folder. That should do the trick, according to the online forums. If not, try reinstalling it.

In Ubuntu, I instead installed all the Microsoft fonts. This you do by typing in the terminal:

$ sudo apt-get install msttcorefonts

Wait for all the fonts to download and install. Then restart the browser. It worked for me.

Hope Google gets rid of this in future versions.