mount: wrong fs type, bad option, bad superblock

mount: wrong fs type, bad option, bad superblock on sh2.cifang.org:/nfs/vhosts/img/,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

继续阅读 »

Vim中Tab键设置为4个空格

ts:  (ts是tabstop的缩写)一个tab显示多少个空格的长度,vim默认8。

autoindent:  前行有缩进时,后续的新行将会自动缩进到相同的位置。

softtabstop:  编辑模式的时候按退格键的时候退回缩进的长度。

shiftwidth:  每一级缩进的长度,一般设置成跟 softtabstop 一样。

expandtab:  缩进用空格来表示。

noexpandtab:  缩进用制表符表示。

继续阅读 »

Find非递归遍历文件夹

find 命令是递归遍历文件夹

基本语法

$ find [path] [option] [expression]

参数

-maxdepth n :指明遍历的深度

find ./ -maxdepth 1 -type d

注:如上n为1时,即遍历当前层级的目录文件。

继续阅读 »

Apache虚拟机配置

1. 目录/etc/httpd/conf.d下新建vhosts.conf文件,内容如下

Listen 80

<VirtualHost *:80>
        DocumentRoot "/www"
        DirectoryIndex index.html index.php
         <Directory "/www">
                Options -Indexes +FollowSymlinks
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

继续阅读 »

Linux下对乱码文件的操作

找到乱码文件的inode号码

[root@localhost ~]# ll -ih 
655786 -rw-r--r-- 1 root root 691002 Jan  1 00:00 ???k?E??.tgz

mv重命名

find . -inum 655786 |xargs -i mv {} newname.tgz

rm删除

find . -inum 655786 -exec rm {} -rf \;

继续阅读 »

Mysql主从版本不一致导致问题

主 5.1.73 从 5.5.58 配置主从同步后,出现某些新建表SQL无法同步。

原因 5.1.73版默认引擎MYISAM 5.5.58默认INNODB。因为主服务器创建表sql定义了引擎,所以在从执行失败。

解决方法,修改从服务器mysql引擎为MYISAM,在my.cnf中加

default-storage-engine=MyISAM

继续阅读 »

vsftpd 530 Login incorrect

服务器配置vsftpd一直出现530 Login incorrect。

  1. 确认vsftpd服务启动

  2. 确认用户名、密码是正确的

  3. 确保登录的ftp用户名未包含在禁止登录列表/etc/vsftpd/ftpusers中

  4. 查看配置文件包含pam_service_name=vsftpd

  5. 确认用户对应目录权限

  6. 防火墙和selinux关闭

继续阅读 »