首先查看/etc/shells中有没有/sbin/nologin(debian和Ubuntu下为/usr/sbin/nologin)
cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
没有的话加上/usr/sbin/nologin
echo "/usr/sbin/nologin" >> /etc/shells
然后添加新用户,其中M为不为该用户创建主目录,-s为指定该用户登录的shell
useradd -M -s /usr/sbin/nologin vincent
其它系统是
useradd -M -s /sbin/nologin vincent
修改密码
passwd ******
直接用官方提供的https://get.docker.com/安装
curl -sSL https://get.docker.com/ | sh
如果提示没有curl的话,先安装curl
apt-get install curl
安装出错提示
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
docker-engine : Depends: init-system-helpers (>= 1.18~) but it is not installable
Recommends: aufs-tools but it is not going to be installed
Recommends: cgroupfs-mount but it is not installable or
cgroup-lite but it is not installable
Recommends: git but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
解决方法
wget http://launchpadlibrarian.net/173841617/init-system-helpers_1.18_all.deb
dpkg -i init-system-helpers_1.18_all.deb
再次执行上面官方的安装docker命令。成功。
docker version
Client:
Version: 17.05.0-ce
API version: 1.29
Go version: go1.7.5
Git commit: 89658be
Built: Thu May 4 22:13:40 2017
OS/Arch: linux/amd64
项目中要用到JS跨域,所以就动态加载JS内容方法直接传JSON数据显示页面
使用方法: $json = json_encode_self($arr);
function json_encode_self($a=false)
{
if (is_null($a)) return 'null'; Read More php数组转成js json格式数据
centos5.4安装好后通过yum来安装php的版本是5.1.6,现在很多站点都是在5.2.x上开发的
今天安装wordpress一个插件也同样遇到提示php版本要5.2x以上
找了很久找到一个官方的一个test repo里面有php5.2.x,安装centos官方的我表示很放心,有木有….
首先, vi /etc/yum.repos.d/CentOS-Testing.repo
再将下面内容粘贴进去,保存退出
Read More Centos yum升级PHP5.2 官方源
1、一次性安装:
yum -y install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel libdbi-dbd-mysql
2、优化mysql
vi /etc/my.cnf
在 [mysqld] 下面加入
skip-bdb
skip-innodb
skip-locking
使用 RPM 安装mod_encoding,centos下让apache支持中文地址
如:http://www.xiit.cn/attachments/lyh/传统论.mp3
下载需要二个RPM包,下载地址:
iconv_hook-1.0.0-1.i386.rpm
mod_encoding-2.2.0-1.i386.rpm
1、安装:
rpm -ivh iconv_hook-1.0.0-1.i386.rpm
rpm -ivh mod_encoding-2.2.0-1.i386.rpm
在Ajax发送url参数传递时,一定会传递含有中文的参数或URL地址,
在有些传递页面使用GB2312,而javascript中encodeURI和encodeURIComponent函数编码的都是UTF8
var url = "我";
codeUrl = gb2312Encode(url);
alert(codeUrl);
Read More AJAX JS 包含中文URL提交gb2312编码的实现
代码很简洁易懂,回调函数为可选项
var loadimg=function(imgs,callback){
if(!imgs){return false};//参数判断
var img=[],len=imgs.length;
for(var i=0;iRead More JS 预加载图片
linux下建立Tunnel:
ssh -D 7070 -qfnN test@www.xiit.cn
再到火狐下附加组件 autoproxy 在autoproxy中选择代理服务器为ssh -D
换了电脑装了个Ubuntu 10.10系统,默认的拼音也不错,但一直打五笔的我打拼音很吃力,所以就找了在windows中一直用的极点五笔
ibus下用法如下:
1.下载附件文件vissible-ibus.tar.gz
2. 解压
tar xvzf vissible-ibus.tar.gz
3. 执行如下命令:
cd vissible-ibus
sudo cp vissible.db /usr/share/ibus-table/tables
sudo cp vissible.gif /usr/share/ibus-table/icons
4.重启ibus或注销再登录,ibus里添加极点五笔即可
注:如原来已经用过,请把~/.ibus/tables/vissible-user.db删除,或者也可以把 vissible.db改成别的*.db。