Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Friday, March 8, 2013

Random vi shortcuts

Toggling syntax highlighting

:syntax [on/off]

Changing the colorscheme

:colorscheme [colorscheme]

Short form (actually can be anything from colo to colorscheme):
:colo [colorscheme]

Some default colorschemes:torte, morning, evening, desert, pablo etc. To cycle through the available colorchemes press tab after the command
To set a colorscheme by default for a profile edit ~/.vimrc and add the following lines:

syntax on
colorscheme [colorscheme]

Friday, March 1, 2013

Linux admin shortcuts

List of sometimes useful commands

System information

Getting hardware information

Hardware information can be obtained using the dmidecode tool that tries to decode the dmi table. It can also filter the information provided using the -t flag.
Getting information the physical memory:

dmidecode -t memory

 

Getting information about a domain

Domain information cat be obtained using the DNS lookup utility dig. The simplest usage would be:

dig domainname

and it returns information on the A record of the host.
The utility can be used to get other types of information by using the -t switch and specifying the record type. For nameservers the query is:
dig domainname -t NS

For mail records:
dig domainname -t MX

Reverse lookups can be prformed using the -x flag:
dig -x ip_address