Vim Paste Turning Off Autoindent

To turn off autoindent when you paste code, there’s a special “paste” mode.


:set paste

Then paste your code. Note that the text in the tooltip now says -- INSERT (paste) --.

After you pasted your code, turn off the paste-mode, so that auto-indenting when you type works correctly again.

:set nopaste

However, I always found that cumbersome. That’s why I map <F3> such that it can switch between paste and nopaste modes while editing the text! I add this to .vimrc

set pastetoggle=<F3> [Read More]

(Solved)Windows Ubuntu Subsystem mv folder disappeared but works with file


I am using Windows Ubuntu Subsystem 18.04. The command I run is

mv venv ../d/

and the folder can neither be found in current directory nor in d. This command is double checked from .bash_history. And, venv is a folder, d is a link to /mnt/d/ubuntu1804/ of my drive D in windows.

Also, I run command

mv a.txt ../d/ [Read More]

ubuntu ftp server

Reference link:

FTP is used to transfer files from one host to another over TCP network. This article explains how to setup FTP server on ubuntu 14.04 .There are 3 popular FTP server packages available PureFTPD, VsFTPD and ProFTPD. Here i’ve used VsFTPD which is lightweight and less Vulnerability.

Setup FTP server on Ubuntu 14.04

Step 1 » Update repositories .
krizna@leela:~$ sudo apt-get update
Step 2 » Install VsFTPD package using the below command.
krizna@leela:~$ sudo apt-get install vsftpd
Step 3 » After installation open /etc/vsftpd.conf file and make changes as follows.
Uncomment the below lines (line no:29 and 33).
» Uncomment the below line (line no: 120 ) to prevent access to the other folders outside the Home directory.
chroot_local_user=YESand add the following line at the end.
allow_writeable_chroot=YES» Add the following lines to enable passive mode.

Step 4 » Restart vsftpd service using the below command.
krizna@leela:~$ sudo service vsftpd restart
Step 5 » Now ftp server will listen on port 21. Create user with the below command.Use /usr/sbin/nologin shell to prevent access to the bash shell for the ftp users .
krizna@leela:~$ sudo useradd -m john -s /usr/sbin/nologin
krizna@leela:~$ sudo passwd john

Step 6 » Allow login access for nologin shell . Open /etc/shells and add the following line at the end.
Now try to connect this ftp server with the username on port 21 using winscp orfilezilla client and make sure that user cannot access the other folders outside the home directory.
setup FTP server ubuntu 14.04
Please note using ftp on port 21 is a big security risk . it’s highly recommended to use SFTP. Please continue for SFTP configuration [Read More]





就会获得一个路由器的IP地址。接下来,将这个IP地址通过Email发到指定的邮箱就。用 vim 写一个角本,执行后,就会将外网IP发送到指定的电子邮箱中,脚本如下

# Program:
# Send Router IP of Internet to certain email# History:
# 2014-03-08 cmzsteven First releasePATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin/:~/binexport PATHcurl | mail -s "Router IP of Internet" [Read More]