Saturday, July 28, 2012

Dropbox Setup

Dropbox Installation

Go to http://www.dropbox.com and set up an account. Once you’ve installed the application, you’ll have a folder $HOME\Dropbox. Create a new folder $HOME\Dropbox\config–this is where we’ll store all of our personalized configuration files.

You can store these configuration files in Github or Bitbucket–but that may be overkill for files that rarely, if ever, need to be merged. Dropbox stores prior versions of files–that should be good enough.

Configuration

Create a folder for any application that you wish to configure. For example, create $HOME\Dropbox\config\vim to store all of your vim configuration files. When you move from machine to machine, you can symlink your vim configuration files from your home folder to the corresponding files in your Dropbox folder.

For example:

$HOME/.vimrc -> $HOME/Dropbox/config/vim/.vimrc

Eclipse Juno

Installation

Note that we use separate installations of Eclipse for various languages:
  • Java
  • C/C++
  • Scripting: Javascript, Bash and Python
Download Eclipse Juno JEE.
If you are setting up a Python tool chain, unzip the folder into
$HOME/local/eclipse-juno/eclipse-python
Create a bash script to launch this e.g. eclipse-python.sh. Create your new work space with a folder structure as follows:
/home/asmith/workspaces/juno/python

General Plugins

Mercurial Plugin

Install the Mercurial plugin from here:
http://marketplace.eclipse.org/content/mercurialeclipse-was-hgeclipse
The update site is
http://cbes.javaforge.com/update
Add this update site. Go to Help->Install New Software...

Next, add the Mercurial plugin site.

Be sure to install only the MercurialEclipse plugin. Do NOT install the Windows Binaries.

Follow the remaining instructions and you’ll have Mercurial support in Eclipse.

Scripting Languages

Note that you should create a separate installation specifically for scripting languages.

Python

Python support has been integrated into the Aptana Studio Plugin. It’s open source and available at http://www.aptana.com.

Java

Unzip Juno into $HOME/local/eclipse-juno/eclipse-java/ followed by the Mercurial plugin as outlined above.

Maven

You’ll need the m2eclipse plugin to support Maven projects. Add the following repository to Eclipse:
http://download.eclipse.org/technology/m2e/releases
Once it’s installed, go to Window->Preferences->Maven->Installations and change the default to a maven2 installation (maven3 has compatibility issues with many plugins). Also, change User Interface to default to the XML editor for pom.xml files—the structured editor is sluggish.

Color Themes

Aptana provides theming for Python. For Java, you’ll need the Eclipse Color Theme plugin available at http://eclipsecolorthemes.org/. I currently use vibrant ink.

Blogger Setup

Blogger Setup for Markdown

This blog is now hosted on GitHub: https://github.com/nkabir/praxis

It’s a collection of Markdown pages along with links to images hosted in a public Dropbox folder. This enables me to edit everything in vim.

Articles detailing the benefits of Markdown:

By hosting the source material in a GitHub project, I can rearrange the articles over time while retaining the ability to publish the content to different blogging sites. GitHub automatically processes Markdown content for easy viewing. Plus, anyone is free to fork the project and submit corrections or additional content.

Project Layout

The praxis project is laid out with a folder per article. Each folder (e.g. praxis/blogger-setup) has a file named post.md that contains the article. There is a corresponding folder Dropbox/Public/praxis/blogger-setup that contains all images associated with the article.

Note that you can store your images with your github project—-but I prefer to edit images on a Mac (while editing text in Linux) so synchronizing via Dropbox eliminates a commit/push step for the images.

Conversion to Blogger

Following instructions from here, make sure that Edit HTML Line Breaks is set to Use
tags
and that Compose Settings is set to Interpret typed HTML.

Posting to Blogger

The following steps convert Markdown to HTML for Blogger:

$ pandoc --no-wrap --from=markdown --to=html post.md | xclip

A better solution is to use Google’s Blogger API (v3). But access requires permission. I’ve submitted a request but have not heard back from Google.