背景:对于一些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
内容:
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>
   刚升级了下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/
问题现象:在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)
实践如下:

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
得到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
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: */*

sudo update-manager。
此时,系统就会开始检查是否有软件或者内核更新。
如果有更新,就会弹出上面的软件更新器。
Ubuntu软件或系统更新
好了,我们点击立即安装。
Ubuntu软件或系统更新
此处,需要提示大家的是,我们在此处也可以点击 软件更新器的设置,打开 软件和更新弹窗,进行一些设置。
Ubuntu软件或系统更新
我们此处不做设置,点击关闭后,再点击立即安装,开始升级系统。
点击,详情,可以查看进度及更新的软件包情况。
Ubuntu软件或系统更新
Ubuntu软件或系统更新
等待一段时间后,更新结束。
提示:计算机需要重启以完成安装更新。


来自:http://jingyan.baidu.com/article/a17d5285113afc8098c8f2e3.html?qq-pf-to=pcqq.group
ubuntu 16.04在升级17.04时候,出现Failed to start Load Kernel Modules 解决方法:
升级的时候不小心重启了,就看到出现这个错误,鼠标挂了,wifi没了,当时感觉是重装系统的节奏了,搜了下,有治。方法如下:
进入到命令行模式:ctl + alt + F1
在root模式下输入一下指令:
apt-get update

dpkg --configure -a

apt-get dist-upgrade

apt-get -f install

reboot

到此就可以了,这是在ubuntuforums.org上看到的。特此记录!!!

来自:http://m.blog.csdn.net/article/details?id=54091293
https://askubuntu.com/questions/809199/failed-to-start-load-kernel-modules-ubuntu-16-04
Ubuntu 16.04安装和配置Sublime Text 3:
http://www.th7.cn/system/lin/201604/162651.shtml


Macbook下Tab打开不是新窗口打开命令之open_files_in_new_window:false


这下sublime就是Mac下面的command+n打开新的Tab了。
来自:https://jingyan.baidu.com/article/e75057f2c40ee8ebc91a8995.html
背景:buntu17.04连接CentOS7.3出现类似问题,用的也是Linux下的SecureCRT7的版本查看文件时候用Tab键出现Wuff —- Wuff!! ,用的也是Linux下的SecureCRT7的版本,做如下修改后就好了。
If you use OS X, and manage multiple machines over SSH, you’ve probably come across and used screen.

You may have noticed that if you SSH to a Linux host from Mac OS X, and try to use the backspace or tab key within a screen session, that you get the “Wuff —- Wuff!!” prompt at the bottom.

Thankfully, the resolution to this problem is easy.

On the remote machine, if you open your ~/.bash_profile file in a text editor (.bash_profile in your home directory), you need to add the following line:

alias screen='TERM=screen screen'
Add that, save the file and you’re done!  You’ll need to re-run bash or just log out and log back in, but when you do, the next screen session you open, you’ll find that the backspace/tab key works again as expected!


From:http://droptips.com/wuff-wuff-from-mac-os-x-to-a-screen-session-on-linux
参考原文:
yum install -y yum-downloadonly

yum install PHP-MySQL -y --downloadonly --downloaddir=/opt

rpm -ivh --force --nodeps php-mysql-5.3.3-22.el6.x86_64.rpm

From:http://blog.csdn.net/anghlq/article/details/9165329
=====================================
实践如下:
yum install gcc autoconf cmake unzip vim libcurl-devel zlib-devel curl-devel expat-devel gettext-devel openssl-devel perl-devel nodejs libicu-devel wget curl mysql-devel
下载量:6.2 M
安装大小:31 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): gettext-devel-0.18.2.1-4.el7.x86_64.rpm                                                  | 315 kB  00:00:00    
(2/5): perl-Git-1.8.3.1-6.el7_2.1.noarch.rpm                                                    |  53 kB  00:00:00    
(3/5): mariadb-devel-5.5.52-1.el7.x86_64.rpm                                                    | 750 kB  00:00:00    
(4/5): mariadb-libs-5.5.52-1.el7.x86_64.rpm                                                     | 761 kB  00:00:00    
(5/5): git-1.8.3.1-6.el7_2.1.x86_64.rpm                                                         | 4.4 MB  00:00:04    
-----------------------------------------------------------------------------------------------------------------------
Transaction check error:
  file /etc/my.cnf from install of mariadb-libs-1:5.5.52-1.el7.x86_64 conflicts with file from package mysql-8.0.1-170622164613.el7.centos.x86_64

错误概要
-------------
yum install mariadb-libs-1:5.5.52-1.el7.x86_64 -y --downloadonly --downloaddir=/tmp
rpm -ihv  mariadb-libs-5.5.52-1.el7.x86_64.rpm  --nodeps --force


已安装:
  gettext-devel.x86_64 0:0.18.2.1-4.el7                       mariadb-devel.x86_64 1:5.5.52-1.el7                      
作为依赖被安装:
  git.x86_64 0:1.8.3.1-6.el7_2.1                          perl-Git.noarch 0:1.8.3.1-6.el7_2.1
背景:如Gitlab的那个备份日志就是以Unix的时间戳表示的,怎么能看到底是啥时候呢?当然用 stat 也能看,这儿主要是学习一下互相转化。

几小时几分:


echo `date "+%F %T" `
2018-04-03 11:56:12


A.将日期转换为Unix时间戳


将当前时间以Unix时间戳表示:
date +%s
输出如下:
1361542433


转换指定日期为Unix时间戳:
date -d '2013-2-22 22:14' +%s
输出如下:
1361542440


B.将Unix时间戳转换为日期时间


不指定日期时间的格式:
date -d @1361542596
输出如下:
Fri Feb 22 22:16:36 CST 2013


指定日期格式的转换:
date -d @1361542596 +"%Y-%m-%d %H:%M:%S"
输出如下:
2013-02-22 22:16:36

来自:http://blog.csdn.net/clevercode/article/details/49993237
基本上有两个方法,一个是comm命令,一个是grep命令。分别介绍如下:
comm命令 , Compare sorted files FILE1 and FILE2 line by line. With  no options, produce three-column output.  Column one contains lines unique to FILE1, column two contains lines unique to FILE2, and column three contains lines common to both files. 要注意两个文件必须是排序和唯一(sorted and unique)的,默认输出为三列,第一列为是A-B,第二列B-A,第三列为A交B。这个哥们写得好,尽管我不懂linux文件流的用法,但是大致看出来了,我用了三个步骤,而用一行就搞定了,简单可用:http://m.blog.csdn.net/article/details?id=6579320


文件行数少最直观快捷的diff办法:
vimdiff <(sort a.txt|uniq) <(sort b.txt|uniq)

/proc/15750/fd/63 [只读]      /proc/15750/fd/62 [只读]
——————————————————————————————
一般求差集的多一些:
求差
comm a.txt b.txt  -3 | sed 's/^\t//'
差集
comm a.txt b.txt  -2 -3

实践如下:

sort getosok.txt >> getosoksort.txt
sort r11.txt >> r11sort.txt
comm r11sort.txt getosoksort.txt   -2 -3



再次实践,注意这两个文件都要去重,否则不太好比较,-2 -3显示左边文件有的右边没有的:
sort mysqlsort.txt|uniq   //sort结合uniq命令去重复行找出重复次数大于1的行参考:http://justwinit.cn/post/3671/

sort 主机层面能ssh连接的.txt |uniq >> 主机层面能ssh连接的排序过的去过重的.txt
sort 数据库应用开发现在的.txt |uniq >> 数据库 应用开发现在的排序过的去过重的.txt



comm  数据库应用开发现在的排序过的去过重的.txt 主机层能ssh连接的排序过的去过重的.txt   -2 -3
10.71.11.4*  //这个是列出左边有,右边文件没有的内容,也就是 “数据库应用开发现在的排序过的且去重的.txt”里有,而右边这个“主机层面能ssh连接的排序过的.txt” 没有。

comm 主机层面能ssh连接的排序过的去过重的.txt 数据库应用开发现在的排序过的 去过重的.txt -2 -3
10.70.*.42
10.70.*.53
10.70.*.1
10.70.*.2
10.71.*.29

注意:
1. comm命令要求输入文件的内容必须是排序且唯一的
2. comm -12 表示取消第一列和第二列的输出,即只输出第三列。[/warning]

主机层面能ssh连接的排序过的有,而右边没有。
http://www.ttlsa.com/linux/linux-file-comparison-operations-text-file-of-the-intersection-difference-sets-and-difference/
经过实践发现Input输入框控件也可以实现对某些提示给一样的方法删除掉:

法一:删除需要删除的URL:
,地址栏中高亮你要删除的网址,按shift+delete就可以了
注意在Mac下的组合键有点复杂是:“Shift + fn + Delete”。
来自:https://www.xiazaizhijia.com/rjjc/118882.html

法二:全删除
1、chrome地址栏输入“chrome://settings/”后回车;
2、点击页面底端“显示高级设置...”;
3、点击“隐私设置”下面的“清除浏览数据...”按钮。


From:https://zhidao.baidu.com/question/502291145.html
背景:常常我们用git pull 命令较多,而用git fetch较少,这两者有可区别,而我们在开发时可先用git fetch再git merge可能更安全一些,因为咱完全不用像git pull一样立即就自动merge可以用git diff进行比对。
Git中从远程的分支获取最新的版本到本地有这样2个命令:
1. git fetch:相当于是从远程获取最新版本到本地,不会自动merge
git fetch origin master
git log -p master..origin/master
git merge origin/master
    以上命令的含义:
   首先从远程的origin的master主分支下载最新的版本到origin/master分支上
   然后比较本地的master分支和origin/master分支的差别
   最后进行合并
   上述过程其实可以用以下更清晰的方式来进行:
git fetch origin master:tmp
git diff tmp
git merge tmp
    从远程获取最新的版本到本地的test分支上
   之后再进行比较合并
2. git pull:相当于是从远程获取最新版本并merge到本地
git pull origin master
上述命令其实相当于git fetch 和 git merge
在实际使用中,git fetch更安全一些
因为在merge前,我们可以查看更新情况,然后再决定是否合并
结束


来自:https://zhidao.baidu.com/question/200204875340723965.html
=====================================================
模拟实践如下:

$git fetch origin master
From gitlab.boosh.com.cn:lvdev/jackxiang.com
* branch            master     -> FETCH_HEAD

如果有变化,可:
$git diff

$git merge origin/master
Merge made by recursive.
.../static/js/manifest.334733dc1613e9cc4ac4.js     |    2 ++
.../static/js/manifest.334733dc1613e9cc4ac4.js.map |    1 +
2 files changed, 3 insertions(+), 0 deletions(-)
create mode 100644 jackxiang.com/static/js/manifest.334733dc1613e9cc4ac4.js
create mode 100644 jackxiang.com/static/js/manifest.334733dc1613e9cc4ac4.js.map

重来一次,这次fetch时结果没有变化的情况:
From gitlab.boosh.com.cn:lvdev/jackxiang.com
* branch            master     -> FETCH_HEAD

$git merge origin/master
Already up-to-date.

分页: 29/272 第一页 上页 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 下页 最后页 [ 显示模式: 摘要 | 列表 ]