April 5, 2012

Show all log entries in svn

In order to show all log entries in svn, between the most recent commit (named HEAD), and the first revision use:
svn log -r HEAD:1

March 28, 2012

Use grep recursively but selectively

To use grep recursively in a directory structure (e.g, the current directory and all its sub-directories), but only on selected files (e.g., C source files) use the following syntax:
grep --include=*.c -r <TEXT_TO_SEARCH>

January 20, 2012

Change default print settings in Mac OS X

In order to change the default settings in Mac OS X (for example, duplex printing), it is recommended to use the CUPS web interface (since the changes seem to be impossible to save as a default via the normal print settings dialog).

You should access http://localhost:631, then the menus "Administration", "Manage Printers", then select your printer. From the pull-down list named "Administration", select "Set Default Options" and make the desired changes.

For instance, in the tab "General" set the Duplex option to"DuplexNoTumble", which is equivalent to Long-Side Binding setting in the normal print settings dialog.

UPDATE #1: On Mac OS X 10.9 the name for the duplex options has changed, and is now "Print Style" with the value "2-sided printing"

UPDATE #2: If you get as access error, you may need to enable the web interface by running the command:
> sudo cupsctl WebInterface=yes


January 12, 2012

Hide files not under revision control in svn

In order to display only the modifications of the files that are under revision control, and do not show that files that are not under revision control in svn, use the following command:
svn status -q

February 7, 2011

Permissions for .ssh

In order to make public key authentication work, the permissions for '.ssh' must _not_ give writing rights to group or others, i.e. be at least like this: drwxr-xr-x