How do I visualize nicely a CSV file in *macs?

January 31, 2012 5 comments

Once you load the CSV file enter the org-mode: M-x org-mode. Then select the entire data and create a table: C-u C-c |.

Categories: Emacs and friends Tags: ,

How do I clean unused stuff installed by MacPorts?

January 30, 2012 Leave a comment

Read Jan’s blog entry.

sudo port -f clean --all all
sudo port -f uninstall inactive
Categories: Mac Tips Tags: , ,

How do I reload the setting of bash?

January 29, 2012 Leave a comment

Using the command:

source ~/.profile

You may also include it in your .profile:

alias reload='source ~/.profile'
Categories: Shell Tags: , ,

How do I migrate an SVN repository to a GIT repository?

January 29, 2012 Leave a comment

We will illustrate this procedure using a simple example.

The following steps have been validated on Mac OS X Snow Leopard, but I presume they are valid in general. Note also that this discussion follows closely some of the ideas described on this post on StackOverflow.

First of all make sure you have installed git svn. If you don’t, you can install it using MacPorts:

sudo port install git-core +svn

For more information refer to the great simple discussion by Stephen Bannasch which can be found here.

Now let’s cd to the directory where you checked out your local SVN repository that you want to move in a GIT repository. Note that this directory is often referred to as  the working copy root path. In my case, issuing the command

svn info

I obtain the following information:

Path: .
 Working Copy Root Path: /Users/zuliani/Documents/Research/ImageWarping
 URL: file://localhost/Volumes/Storage/SVNRepository/Research/ImageWarping
 Repository Root: file://localhost/Volumes/Storage/SVNRepository
 Repository UUID: 876389e7-766b-4580-87e5-4a53071d1477
 Revision: 44
 Node Kind: directory
 Schedule: normal
 Last Changed Author: zuliani
 Last Changed Rev: 44
 Last Changed Date: 2010-12-05 20:00:06 -0800 (Sun, 05 Dec 2010)

The URL points to the remote repository where the SVN database with all the revisions is hosted. In my case it resides in the volume Storage, specifically at /SVNRepository/Research/ImageWarping. This information will be used later. Let’s create the directory for the remote GIT repository. In my case it will be created by the command:

mkdir -p /Volumes/Storage/GITRepository/Research/ImageWarping

We will then cd into such directory and init the repository:

git init --bare

Let’s now create the directory where the new local GIT repository will be created:

mkdir -p ~/Documents/Temp/ImageWarping

Now let’s cd to the newly created directory that will host the local GIT repository and let’s initialize the GIT repository from the remote SVN repository (whose location was found in the URL shown before):

git svn init file://localhost/Volumes/Storage/SVNRepository/Research/ImageWarping

Let’s now fetch all the revisions from the remote SVN repository:

git svn fetch

And now let’s push the local GIT repository to the remote one (that we created before) on the master branch:

git remote add origin /Volumes/Storage/GITRepository/Research/ImageWarping
git push origin master

We are done! Now we will be able to checkout from the remote repository (origin) simply by issuing the command:

git clone file://localhost/Volumes/Storage/GITRepository/Research/ImageWarping/
Categories: GIT, Subversion, Version Control Tags: , ,

How can I move one word left or right in the mac OS terminal?

You need to set up a couple of key bindings. Go to Preferences->Settings->Keyboard pane in your terminal application. Add the following key bindings:

option + cursor left to ESC+b
option + cursor right to ESC+f

When you re-launch the terminal you will be able to move one word to the right pressing option + cursor left and, analogously, one word to the right by pressing option + cursor right.

For a more thorough discussion check the excellent thread on Stack Overflow

Categories: Mac Tips, Shell Tags: ,

How do I enable the column selection mode in Eclipse on Mac OS?

You can toggle rectangular text selection using option+command+A. This is great feature for a coder.

How do I make *macs automatically refresh the opened files when changed on disk?

June 21, 2011 2 comments

Add (global-auto-revert-mode t) to your configuration file.

Categories: Emacs and friends Tags: