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/
Advertisement
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:

How do I search through the bash history?

June 12, 2011 2 comments

Using bash type

CTRL+r first-letters-of-the-command

Note that if you type the command history all the commands that you typed will be displayed, preceded by an index. To recall a command that is indexed by the number X just type !X (no space after the exclamation mark). If you type !! the last command will be re-executed.

Sometimes you want to know when a certain command was executed. Just set the following environment variable:

export HISTTIMEFORMAT="%F %T "

Now the history contains also the time stamps associated to each command.

To learn more check the cheat sheet here, by Peteris Krumins. Check also his great blog.

Categories: Shell Tags: , , ,

I have an Asus EEE PC and I can’t boot from a bootable USB key. What should I do?

This has been tested while successfully trying to install Windows 7 from a bootable USB key on a Asus 1008HA netbook. The same instructions may apply to other netbook models and/or operating systems. Follow these steps:

  1. Turn off your netbook.
  2. Turn it on, and keep pressing F2 repeatedly unless the BIOS screen appears.
  3. In the Boot section, disable Boot Booster.
  4. Plug your bootable USB key in a USB port.
  5. Press F10, then Enter to confirm. The netbook will reboot.
  6. Keep pressing ESC repeatedly unless a boot menu appears.
  7. The menu displays a list of bootable devices. Choose your USB key and press Enter.

You’re done! You may want to re-enable Boot Booster following steps 1 to 3 again, and then pressing F10 and Enter to confirm the changes you made to the BIOS configuration.

Categories: Hardware, Netbooks Tags: , , , , , , ,

Where can I find the list of audio/video codecs for ffmpeg?

February 19, 2011 Leave a comment

Here. Scroll down to audio codecs (Section 2.4) and video codecs (Section 2.3)