These are the commands i always use in vi. Continue reading vi commands cheat sheet
Category Archives: Linux
Mapping vi/vim commands to hotkeys
NERDTree is a great vi plugin which definitely speed up the development time for programmers using vi for file editing. For more information about NERDTree, please refer to NERDTree – The File Explorer in vi/vim.
To further speed up the file editing efficiency, we could map the vi commands to hotkeys in the /etc/vim/vimrc. Continue reading Mapping vi/vim commands to hotkeys
NERDTree – The File Explorer in vi/vim
I have been working on Rails for more than half year and i do file editing with vi at server side most of the time. vi is a great tool but it is not convenient for editing multiple files which is very common in programmer. In the past, I had to close the file, cd to another directory and opened another file for editing. Continue reading NERDTree – The File Explorer in vi/vim
Mac/Linux – SSH Host Key Verification Failed
If you get the following message when you connecting to a server through SSH, most likely the server side has changed authorization key.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Continue reading Mac/Linux – SSH Host Key Verification Failed
Postfix – Relay via Gmail
Setting up Sendmail to relay public SMTP server such as Gmail is quite difficult. In the past, i just kept looking for the blog posts in Google and found that people have different ways to setup Sendmail, but not all of them could be repeated successfully in my setup. After so many trials and errors, i made the relay works but i couldn’t fully understand what’s going on in the setup.
So this time, no more Sendmail, i would like to use Postfix instead. Continue reading Postfix – Relay via Gmail
Linux – Configure the vi/vim Default Setting
The vi/vim configuration file is located @ $HOME/.exrc. of it does not exist, just create it.
$HOME/.exrc
:set number :set ts=2
Your vi now will have tab size = 2 and line number is shown.
More useful settings Continue reading Linux – Configure the vi/vim Default Setting
Samba – Share Linux Folder to Windows
I want to share a folder in my Ubuntu virtual machine to my Windows host. That folder contains the Rails applications such that i can edit them on the Windows host.
1. Install the Samba server
- sudo apt-get install samba
Linux – vi/vim Show and Hide Line Number
You can show the line number in the vi editor by entering the following input command.
- :set number
Linux – Get The Latest LAMP Package
Recently, i was working on setting up a Ubuntu 8.04 LTS (Handy Heron) server. i found that the PHP installed by apt-get is 5.2.4-2ubuntu5.12 and the PHP GD Library is not up-to-date and caused a warning in the Drupal report. I have to download the latest and stable packages in order to solve the problem.
Luckily, i found a very useful and up-to-date Debian repositories for my Ubuntu server. You could find the latest stable LAMP packages there. It is called Dotdeb. Just complete the following steps then you can connect to the Dotdeb repositories. Continue reading Linux – Get The Latest LAMP Package
Linux – Manipulate the stdout and stderr
Redirection is very common and useful in Linux.
- stdout – Normal messages output displayed on terminal after running a command
- stderr – Error messages displayed on terminal after running a command
