Showing posts with label console. Show all posts
Showing posts with label console. Show all posts

Tuesday, December 7, 2010

Some command line utils for git conflict resolution

Git has some nice utilities that can make dealing with conflicts much easier.

If after merging you just want to keep either the remote (theirs) or your own file (ours), you can checkout the file with either --ours or --theirs options as in:
git checkout --ours index.html
git checkout --theirs template.html

In order to look at the original files, git show :1:filename shows the common ancestor, git show :2:filename shows the HEAD version, and git show :3:filename shows the MERGE_HEAD version.



Sources:
Keep either file in a merge conflict

Tuesday, August 24, 2010

Adding backgrounds to directories in LS_COLORS

To add backgrounds to the directories in the output of ls, in .bashrc add:

export LS_COLORS='di=01;34;47'

Tuesday, May 12, 2009

Curl examples

No traffic info today, left too late.

Nice curl examples

Monday, April 27, 2009

Unix groups, users

On ubuntu (if you don't have access to the gui):

To create a user:
useradd -m -s /bin/bash *username*
passwd *username*
To create a group:
groupadd *groupname*
To add users to that new group:
usermod -a -G *groupname* *username*

Thursday, April 16, 2009

Swapping ctrl and capslock on debian flavored linux-distros (ie ubuntu)

From the emacs-wiki http://www.emacswiki.org/emacs/MovingTheCtrlKey

1. chmod 644 /etc/default/console-setup then edit that file. Add an X11 style caps lock modification via:

 $ diff -U0 /etc/default/{console-setup.orig,console-setup}
--- /etc/default/console-setup.orig 2009-02-09 03:05:27.000000000 -0500
+++ /etc/default/console-setup 2009-02-09 04:11:20.000000000 -0500
@@ -40 +40 @@
-XKBOPTIONS=""
+XKBOPTIONS="ctrl:swapcaps"

you can do “ctrl:nocaps” instead if you want to two control keys.

2. Trick dpkg into integrating your changes:

 $ sudo dpkg-reconfigure console-setup

and choose all the defaults.

Note that this will only change capslock and ctrl in virtual terminals or when gnome or some other (lesser) window manager is not running.

To swap capslock and ctrl in gnome do:

System->Preferences-> Keyboard Preferences-> Layout tab-> Other Options (aka Layout Options) -> Ctrl key position-> Swap Ctrl and CapsLock radio button.