Sunday, March 21, 2010

Hostname in Ubuntu

"ping myhostname" was not working on my Ubuntu machine. I found on the net, for example here that I need to perform the following to get it working:

sudo aptitude install winbind

Then edit /etc/nsswitch.conf by type in "sudo gedit /etc/nsswitch.conf" without the "quote" in the terminal and add wins to the hosts line in the position shown
here:
Code:

hosts: files mdns4_minimal [NOTFOUND=return] wins dns mdns4
I did it but the problem did not go away. Later I found elsewhere on the net that /etc/hosts needs an entry 127.0.1.1 myhostname for the name resolution to work.

Sunday, March 14, 2010

Mediawiki Templates

The equivalent of latex newcommand is templates in mediawiki. To use a new template:

Create a new page named "Template:Concept" for example. On the page, write:

'''{{{1}}}'''

Then on any other page, wherever {{concept|foo}} occurs, it will be replaced by foo in bold.

Tabs in Vim

Vim tabs:

  • :tabe (new tab opens)
  • gt (next tab)
  • gf (open the file under cursor in a new tab)

Vim Regex Simplification

\v can be used to simplify the regex. For example to search for {foo} one can use \v\{(\w+)\}.


Source: http://briancarper.net/blog/vim-regexes-are-awesome