Vagrant启动时出现大量default: Warning: Remote connection disconnect. Retrying...的解决办法

vi /etc/init/failsafe.conf 里面有 sleep 20、 sleep 40、 sleep 59 这些暂停命令,当然会导致启动很慢了,把它们改成sleep 2、 sleep 4、 sleep 5,就会快很多了
2018-10-14 23:13 | 阅读 3498 次 | 评论 0 条

Bash history同时忽略前面带空格的命令和重复命令

cd到用户根目录 vi .bashrc 然后加入一行: HISTCONTROL=ignoreboth
2018-09-26 12:40 | 阅读 2065 次 | 评论 0 条

使用openssl生成证书(包含csr、key文件)

openssl req -new -nodes -sha256 -newkey rsa:2048 -keyout my.key -out my.csr
2018-04-05 20:23 | 阅读 3366 次 | 评论 0 条

修改ubuntu命令ls下文件夹的背景颜色

默认的导致文件夹看不清楚 vi ~/.bashrc 加入下面一行: LS_COLORS='ex=0;35:ow=1;32' 解决
2018-03-31 17:31 | 阅读 3566 次 | 评论 0 条

ubuntu16.04不支持id_dsa.pub免密登陆的解决办法

ubuntu 14还可以,到ubuntu16.04无效了,怎么设置还是得需要密码才能登陆。原来ubuntu16版本默认不支持dsa密钥了,如果需要支持: vi /etc/ssh/sshd_config 末尾加上一行: PubkeyAcceptedKeyTypes ssh-dss 然后重启ssh服务 service ssh restart
2017-08-23 08:17 | 阅读 2476 次 | 评论 0 条

阿里云挂载旧磁盘攻略

查看磁盘信息: fdisk -l 得到如下信息: 执行挂载: mount /dev/vdb1 /mnt 这样就挂上了,不过重启后就没了,执行下面的操作,永久挂载: vi /etc/fstab 新加一行: /dev/vdb1 /mnt ext3 defaults 1 2 网上有搜到含有格式化步骤的是新磁盘 http://jingyan.baidu.com/...
2016-12-03 18:30 | 阅读 2516 次 | 评论 0 条

ubuntu14.04终端中文乱码(其实是vim显示乱码)的解决办法

搜了好多解决方案,装了各种中文包都不管用,最后 vi /etc/vim/vimrc 加入 set fileencodings=ucs-bom,utf-8,gbk,chinese,cp936 竟然药到病除,妈了个巴子的,让我焦头烂额一个多小时 -------------------------------- 以下内容补充于 2016-12-01 19:39:54 -------------------------------- 切记,每次装完服务器环境先配置vi /etc/vim/vimrc,免得走弯路 set ts=4...
2016-12-01 18:13 | 阅读 6629 次 | 评论 0 条

iptables设置某个端口的ip段白名单

iptables -A INPUT -p tcp --dport 21 -s 113.128.0.0/16 -j ACCEPT; iptables -A INPUT -p tcp --dport 21 -s 120.0.0.0/8 -j ACCEPT; iptables -A INPUT -p tcp --dport 21 -j DROP
2016-11-03 12:44 | 阅读 10029 次 | 评论 4 条

vim清除当前搜索关键词的高亮

:noh
2016-08-29 20:58 | 阅读 4076 次 | 评论 0 条

使用命令行工具sed批量替换文件夹下所有文件的内容

find ./ -type f -exec sed -i 's/src="原字符串/新字符串/g' {} \;
2016-08-21 11:52 | 阅读 6441 次 | 评论 0 条

解决ubuntu12.04 server命令行无法显示中文的问题

在命令行输入中文直接显示 ---------,用vim打开含有中文的文件只能显示部分中文,非常之不方便,下面几行命令解决: apt-get install language-pack-gnome-zh-hans-base apt-get install language-pack-zh-hans apt-get install language-pack-zh-hans-base
2016-08-20 22:37 | 阅读 3575 次 | 评论 0 条

UBUNTU 14.04 安装 nsenter

cd /tmp; curl https://www.kernel.org/pub/linux/utils/util-linux/v2.25/util-linux-2.25.tar.gz | tar -zxf-; cd util-linux-2.25; sudo apt-get install autopoint autoconf libtool automake ./configure --without-python --disable-all-programs --enable-nsenter --without...
2016-08-07 20:16 | 阅读 6710 次 | 评论 0 条

thinkphp的nginx配置

server { listen 80; server_name www.abc.com; #charset utf-8; access_log /var/www/www.abc.com/log/host.access.log; error_log /var/www/www.abc.com/log/error.log; # gzip off; root /var/www/www.abc.com/web; index index.php index.h...
2016-07-20 15:57 | 阅读 8323 次 | 评论 0 条

ubuntu安装mono相关

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list sudo apt-get update sudo apt-g...
2016-07-19 22:57 | 阅读 8300 次 | 评论 0 条

两款模拟键盘输入和鼠标点击的命令行工具

linux平台的:xdotool,安装方式:apt-get install xdotool osx平台的:cliclick,安装方式:brew install cliclick xdotool模拟1000次鼠标点击: for((i=0;i<1000;i++));do xdotool click 1;done cliclick模拟1000次鼠标点击: for((i=0;i<1000;i++));do cliclick c:.;done
2016-07-16 20:08 | 阅读 11781 次 | 评论 0 条

VIM编辑远程服务器上的文件

vim scp://root@server//etc/nginx/nginx.conf 点评:并不是特别的方便,从打开远程文件到编辑保存,要确认几次步骤,在远程服务器没有安装vim的情况下很有用。
2016-02-05 21:35 | 阅读 15398 次 | 评论 0 条

ubuntu出现perl: warning: Falling back to the standard locale ("C")的解决办法

症状: root@gs:~# dpkg-reconfigure locales perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US:", LC_ALL = (unset), LANG = "zh_CN.UTF-8" are supported and installed on your system. perl: warning: Falling back to the stand...
2015-09-24 00:47 | 阅读 6869 次 | 评论 0 条

vsftpd无法登陆的原因竟然是根目录权限不对

太tm坑了,登陆一直提示331 Please specify the password,明明我就设置密码了,输入的密码确认了N次没有问题,就是登陆不了。后来参考别的账号和目录发现FTP用户根目录权限是555(dr-xr-xr-x),原来是权限设置成777就登陆不了,尼玛你倒是告诉我权限设置的不对啊,一直让我输密码密码。 结论: vsftpd设置用户目录权限的时候,必须设置根目录权限为555,至于根目录里面的权限随便设置
2015-09-18 22:40 | 阅读 10437 次 | 评论 3 条

linux下比ack速度更快的代码搜索工具the_silver_searcher

使用方式跟ack差不多 http://blog.bccn.net/%E9%9D%99%E5%A4%9C%E6%80%9D/13430 安装及使用详情:https://github.com/ggreer/the_silver_searcher
2015-07-31 14:04 | 阅读 4376 次 | 评论 0 条

使用rsync命令同步服务器文件夹

rsync -azh /local/path user@host.com:/remote/path
2015-07-24 20:32 | 阅读 2714 次 | 评论 0 条
浏览2795844次
文章归档