mysql 获取建表sql ,修改表名称(rename)

  mysql 获取建表sql :   show create table tableName; 修改表名称(rename):   rename table OldTableName to NewTableName;  
继续阅读 »
  mysql 获取建表sql :   show create table tableName; 修改表名称(rename):   rename table OldTableName to NewTableName;   收起阅读 »

php 中英文数字 正则表达式

  支持 中英文数字的正则表达式:   $username = '我是中午呀51ask'; if (!preg_match('/^([\x{4e00}-\x{9fa5}]|[a-zA-Z0-9]){3,16}$/u', $username)) { echo 'username只能包含中英文、阿拉伯数字(3-16位)'; } else { echo "验证通过"; } 相关文章: php 验证姓名(用户名)正则 中文和英文 php 常用正则表达式
继续阅读 »
  支持 中英文数字的正则表达式:   $username = '我是中午呀51ask'; if (!preg_match('/^([\x{4e00}-\x{9fa5}]|[a-zA-Z0-9]){3,16}$/u', $username)) { echo 'username只能包含中英文、阿拉伯数字(3-16位)'; } else { echo "验证通过"; } 相关文章: php 验证姓名(用户名)正则 中文和英文 php 常用正则表达式 收起阅读 »

php 调用 微博(statuses/share接口) demo

  代码:   $token = '2.00l58LXFS4eHfhdsyGDd3e7c9f54fIFhC'; //经过oauth授权得到的access_token $timeout = 5000; $http_header = array( 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' ); $share_url = 'http://www.fllo.cn/society/201810/35071.html'; //分享地址:该地址必须和 微博开放平台 -> 我的应用 -> 应用信息 -> 应用基本信息 -> 安全域名 中的地址对应。 $params = array( 'access_token' => $token, 'status' => "男友分手跪榴莲:90后女孩因男友未履行协议向法院起诉".$share_url, ); $ch = curl_init (); $url = "https://api.weibo.com/2/statuses/share.json"; curl_setopt ( $ch, CURLOPT_URL, $url ); curl_setopt ( $ch, CURLOPT_POST, 1 ); curl_setopt ( $ch, CURLOPT_HEADER, 0 ); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt ( $ch, CURLOPT_POSTFIELDS, http_build_query($params)); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $ret = curl_exec ( $ch ); curl_close ( $ch ); print_r($ret); 最重要的部分(要使用 x-www-form-urlencoded 方式传输数据):   curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
继续阅读 »
  代码:   $token = '2.00l58LXFS4eHfhdsyGDd3e7c9f54fIFhC'; //经过oauth授权得到的access_token $timeout = 5000; $http_header = array( 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' ); $share_url = 'http://www.fllo.cn/society/201810/35071.html'; //分享地址:该地址必须和 微博开放平台 -> 我的应用 -> 应用信息 -> 应用基本信息 -> 安全域名 中的地址对应。 $params = array( 'access_token' => $token, 'status' => "男友分手跪榴莲:90后女孩因男友未履行协议向法院起诉".$share_url, ); $ch = curl_init (); $url = "https://api.weibo.com/2/statuses/share.json"; curl_setopt ( $ch, CURLOPT_URL, $url ); curl_setopt ( $ch, CURLOPT_POST, 1 ); curl_setopt ( $ch, CURLOPT_HEADER, 0 ); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt ( $ch, CURLOPT_POSTFIELDS, http_build_query($params)); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $ret = curl_exec ( $ch ); curl_close ( $ch ); print_r($ret); 最重要的部分(要使用 x-www-form-urlencoded 方式传输数据):   curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); 收起阅读 »

iOS 设备型号(包括iPhone XS、XR)

ios
  iPhone、iPad、iPod等设备型号列表,移除了被淘汰的设备、或性能跟不上的设备。   附上一个设备表链接 地址:https://www.theiphonewiki.com/wiki/Models   直接上代码:   需要导入头文件   #import <sys/utsname.h> 代码主体:   /** 获取设备名称 */ - (NSString *)iphoneName { struct utsname systemInfo; uname(&systemInfo); // 获取系统设备信息 NSString *platform = [NSString stringWithCString:systemInfo.machine encoding:NSASCIIStringEncoding]; NSDictionary *dict = @{ // iPhone @"iPhone5,3" : @"iPhone 5c", @"iPhone5,4" : @"iPhone 5c", @"iPhone6,1" : @"iPhone 5s", @"iPhone6,2" : @"iPhone 5s", @"iPhone7,1" : @"iPhone 6 Plus", @"iPhone7,2" : @"iPhone 6", @"iPhone8,1" : @"iPhone 6s", @"iPhone8,2" : @"iPhone 6s Plus", @"iPhone8,4" : @"iPhone SE", @"iPhone9,1" : @"iPhone 7", @"iPhone9,2" : @"iPhone 7 Plus", @"iPhone10,1" : @"iPhone 8", @"iPhone10,4" : @"iPhone 8", @"iPhone10,2" : @"iPhone 8 Plus", @"iPhone10,5" : @"iPhone 8 Plus", @"iPhone10,3" : @"iPhone X", @"iPhone10,6" : @"iPhone X", @"iPhone11,2" : @"iPhone XS", @"iPhone11,4" : @"iPhone XS Max", @"iPhone11,6" : @"iPhone XS Max", @"iPhone11,8" : @"iPhone XR", @"i386" : @"iPhone Simulator", @"x86_64" : @"iPhone Simulator", // iPad @"iPad4,1" : @"iPad Air", @"iPad4,2" : @"iPad Air", @"iPad4,3" : @"iPad Air", @"iPad5,3" : @"iPad Air 2", @"iPad5,4" : @"iPad Air 2", @"iPad6,7" : @"iPad Pro 12.9", @"iPad6,8" : @"iPad Pro 12.9", @"iPad6,3" : @"iPad Pro 9.7", @"iPad6,4" : @"iPad Pro 9.7", @"iPad6,11" : @"iPad 5", @"iPad6,12" : @"iPad 5", @"iPad7,1" : @"iPad Pro 12.9 inch 2nd gen", @"iPad7,2" : @"iPad Pro 12.9 inch 2nd gen", @"iPad7,3" : @"iPad Pro 10.5", @"iPad7,4" : @"iPad Pro 10.5", @"iPad7,5" : @"iPad 6", @"iPad7,6" : @"iPad 6", // iPad mini @"iPad2,5" : @"iPad mini", @"iPad2,6" : @"iPad mini", @"iPad2,7" : @"iPad mini", @"iPad4,4" : @"iPad mini 2", @"iPad4,5" : @"iPad mini 2", @"iPad4,6" : @"iPad mini 2", @"iPad4,7" : @"iPad mini 3", @"iPad4,8" : @"iPad mini 3", @"iPad4,9" : @"iPad mini 3", @"iPad5,1" : @"iPad mini 4", @"iPad5,2" : @"iPad mini 4", // Apple Watch @"Watch1,1" : @"Apple Watch", @"Watch1,2" : @"Apple Watch", @"Watch2,6" : @"Apple Watch Series 1", @"Watch2,7" : @"Apple Watch Series 1", @"Watch2,3" : @"Apple Watch Series 2", @"Watch2,4" : @"Apple Watch Series 2", @"Watch3,1" : @"Apple Watch Series 3", @"Watch3,2" : @"Apple Watch Series 3", @"Watch3,3" : @"Apple Watch Series 3", @"Watch3,4" : @"Apple Watch Series 3", @"Watch4,1" : @"Apple Watch Series 4", @"Watch4,2" : @"Apple Watch Series 4", @"Watch4,3" : @"Apple Watch Series 4", @"Watch4,4" : @"Apple Watch Series 4" }; NSString *name = dict[platform]; return name ? name : platform; }  
继续阅读 »
  iPhone、iPad、iPod等设备型号列表,移除了被淘汰的设备、或性能跟不上的设备。   附上一个设备表链接 地址:https://www.theiphonewiki.com/wiki/Models   直接上代码:   需要导入头文件   #import <sys/utsname.h> 代码主体:   /** 获取设备名称 */ - (NSString *)iphoneName { struct utsname systemInfo; uname(&systemInfo); // 获取系统设备信息 NSString *platform = [NSString stringWithCString:systemInfo.machine encoding:NSASCIIStringEncoding]; NSDictionary *dict = @{ // iPhone @"iPhone5,3" : @"iPhone 5c", @"iPhone5,4" : @"iPhone 5c", @"iPhone6,1" : @"iPhone 5s", @"iPhone6,2" : @"iPhone 5s", @"iPhone7,1" : @"iPhone 6 Plus", @"iPhone7,2" : @"iPhone 6", @"iPhone8,1" : @"iPhone 6s", @"iPhone8,2" : @"iPhone 6s Plus", @"iPhone8,4" : @"iPhone SE", @"iPhone9,1" : @"iPhone 7", @"iPhone9,2" : @"iPhone 7 Plus", @"iPhone10,1" : @"iPhone 8", @"iPhone10,4" : @"iPhone 8", @"iPhone10,2" : @"iPhone 8 Plus", @"iPhone10,5" : @"iPhone 8 Plus", @"iPhone10,3" : @"iPhone X", @"iPhone10,6" : @"iPhone X", @"iPhone11,2" : @"iPhone XS", @"iPhone11,4" : @"iPhone XS Max", @"iPhone11,6" : @"iPhone XS Max", @"iPhone11,8" : @"iPhone XR", @"i386" : @"iPhone Simulator", @"x86_64" : @"iPhone Simulator", // iPad @"iPad4,1" : @"iPad Air", @"iPad4,2" : @"iPad Air", @"iPad4,3" : @"iPad Air", @"iPad5,3" : @"iPad Air 2", @"iPad5,4" : @"iPad Air 2", @"iPad6,7" : @"iPad Pro 12.9", @"iPad6,8" : @"iPad Pro 12.9", @"iPad6,3" : @"iPad Pro 9.7", @"iPad6,4" : @"iPad Pro 9.7", @"iPad6,11" : @"iPad 5", @"iPad6,12" : @"iPad 5", @"iPad7,1" : @"iPad Pro 12.9 inch 2nd gen", @"iPad7,2" : @"iPad Pro 12.9 inch 2nd gen", @"iPad7,3" : @"iPad Pro 10.5", @"iPad7,4" : @"iPad Pro 10.5", @"iPad7,5" : @"iPad 6", @"iPad7,6" : @"iPad 6", // iPad mini @"iPad2,5" : @"iPad mini", @"iPad2,6" : @"iPad mini", @"iPad2,7" : @"iPad mini", @"iPad4,4" : @"iPad mini 2", @"iPad4,5" : @"iPad mini 2", @"iPad4,6" : @"iPad mini 2", @"iPad4,7" : @"iPad mini 3", @"iPad4,8" : @"iPad mini 3", @"iPad4,9" : @"iPad mini 3", @"iPad5,1" : @"iPad mini 4", @"iPad5,2" : @"iPad mini 4", // Apple Watch @"Watch1,1" : @"Apple Watch", @"Watch1,2" : @"Apple Watch", @"Watch2,6" : @"Apple Watch Series 1", @"Watch2,7" : @"Apple Watch Series 1", @"Watch2,3" : @"Apple Watch Series 2", @"Watch2,4" : @"Apple Watch Series 2", @"Watch3,1" : @"Apple Watch Series 3", @"Watch3,2" : @"Apple Watch Series 3", @"Watch3,3" : @"Apple Watch Series 3", @"Watch3,4" : @"Apple Watch Series 3", @"Watch4,1" : @"Apple Watch Series 4", @"Watch4,2" : @"Apple Watch Series 4", @"Watch4,3" : @"Apple Watch Series 4", @"Watch4,4" : @"Apple Watch Series 4" }; NSString *name = dict[platform]; return name ? name : platform; }   收起阅读 »

从 apache访问log中,找出请求次数最多的N个IP

  命令:   awk '{print $1}' fllo_access.log |sort |uniq -c|sort -nr|head -5  输出结果:   12653 61.135.18.106 2463 106.38.241.171 1182 47.93.43.49 723 106.120.188.69 439 43.241.11.114
继续阅读 »
  命令:   awk '{print $1}' fllo_access.log |sort |uniq -c|sort -nr|head -5  输出结果:   12653 61.135.18.106 2463 106.38.241.171 1182 47.93.43.49 723 106.120.188.69 439 43.241.11.114 收起阅读 »

解决新版 Chrome 自动隐藏了 url 前缀,包括二级域名。

  最新版本的 Chrome 自动隐藏了 url 前缀,包括二级域名,如何才能完全显示?   步骤:   1:打开一个新标签输入:   chrome://flags/#omnibox-ui-hide-steady-state-url-scheme-and-subdomains 2:如图所示   将该选项改为 Disabled  
继续阅读 »
  最新版本的 Chrome 自动隐藏了 url 前缀,包括二级域名,如何才能完全显示?   步骤:   1:打开一个新标签输入:   chrome://flags/#omnibox-ui-hide-steady-state-url-scheme-and-subdomains 2:如图所示   将该选项改为 Disabled   收起阅读 »

mysql 复制表结构及表数据

  1:复制表结构   CREATE TABLE 新表名 LIKE 旧表名; 2:复制表数据(仅适用新旧表结构一样)   INSERT INTO 新表名 SELECT * FROM 旧表名;
  1:复制表结构   CREATE TABLE 新表名 LIKE 旧表名; 2:复制表数据(仅适用新旧表结构一样)   INSERT INTO 新表名 SELECT * FROM 旧表名;

mysql 清理二进制日志 (binlog日志)

  1:登录数据库   mysql -u root -p 2:查看binlog日志   mysql> show binary logs; +--------------------+-----------+ | Log_name | File_size | +--------------------+-----------+ | mastera-bin.000333 | 536893526 | | mastera-bin.000334 | 536896177 | | mastera-bin.000335 | 536924066 | | mastera-bin.000336 | 536900592 | | mastera-bin.000337 | 536909231 | | mastera-bin.000338 | 536879575 | | mastera-bin.000339 | 536886303 | | mastera-bin.000340 | 536872989 | | mastera-bin.000341 | 536880182 | | mastera-bin.000342 | 536904402 | | mastera-bin.000343 | 536883547 | | mastera-bin.000344 | 536875696 | | mastera-bin.000345 | 536883123 | | mastera-bin.000346 | 536879848 | | mastera-bin.000347 | 536879386 | | mastera-bin.000348 | 536910231 | | mastera-bin.000349 | 536890985 | | mastera-bin.000350 | 536974817 | | mastera-bin.000351 | 536871614 | | mastera-bin.000352 | 536885359 | | mastera-bin.000353 | 536890754 | | mastera-bin.000354 | 536887216 | | mastera-bin.000355 | 536877251 | | mastera-bin.000356 | 536917994 | | mastera-bin.000357 | 536874089 | | mastera-bin.000358 | 536986283 | | mastera-bin.000359 | 536875648 | | mastera-bin.000360 | 536912004 | | mastera-bin.000361 | 536871392 | | mastera-bin.000362 | 536890812 | | mastera-bin.000363 | 536915108 | | mastera-bin.000364 | 536900213 | | mastera-bin.000365 | 536905615 | | mastera-bin.000366 | 536882660 | | mastera-bin.000367 | 536871473 | | mastera-bin.000368 | 536880560 | | mastera-bin.000369 | 536881409 | | mastera-bin.000370 | 536940190 | | mastera-bin.000371 | 536880720 | | mastera-bin.000372 | 536904622 | | mastera-bin.000373 | 536914892 | | mastera-bin.000374 | 536887070 | | mastera-bin.000375 | 536886963 | | mastera-bin.000376 | 536870975 | | mastera-bin.000377 | 536915913 | | mastera-bin.000378 | 536872260 | | mastera-bin.000379 | 536905617 | | mastera-bin.000380 | 536903305 | | mastera-bin.000381 | 536902205 | | mastera-bin.000382 | 536882027 | | mastera-bin.000383 | 536894498 | | mastera-bin.000384 | 536942442 | | mastera-bin.000385 | 536894713 | | mastera-bin.000386 | 536875598 | | mastera-bin.000387 | 536876980 | | mastera-bin.000388 | 536946713 | | mastera-bin.000389 | 536878512 | | mastera-bin.000390 | 536954192 | | mastera-bin.000391 | 536871419 | | mastera-bin.000392 | 536905782 | | mastera-bin.000393 | 536899555 | | mastera-bin.000394 | 536887905 | | mastera-bin.000395 | 536891320 | | mastera-bin.000396 | 536941034 | | mastera-bin.000397 | 536904725 | | mastera-bin.000398 | 536922729 | | mastera-bin.000399 | 536887783 | | mastera-bin.000400 | 536873172 | | mastera-bin.000401 | 536890007 | | mastera-bin.000402 | 536909439 | | mastera-bin.000403 | 536873499 | | mastera-bin.000404 | 536937488 | | mastera-bin.000405 | 536893321 | | mastera-bin.000406 | 536884022 | | mastera-bin.000407 | 536923776 | | mastera-bin.000408 | 536923124 | | mastera-bin.000409 | 536886722 | | mastera-bin.000410 | 536883708 | | mastera-bin.000411 | 536891586 | | mastera-bin.000412 | 536906806 | | mastera-bin.000413 | 536891526 | | mastera-bin.000414 | 536879610 | | mastera-bin.000415 | 536880254 | | mastera-bin.000416 | 536883004 | | mastera-bin.000417 | 536880933 | | mastera-bin.000418 | 536929111 | | mastera-bin.000419 | 536911818 | | mastera-bin.000420 | 536974374 | | mastera-bin.000421 | 536930619 | | mastera-bin.000422 | 536915602 | | mastera-bin.000423 | 536877242 | | mastera-bin.000424 | 536873643 | | mastera-bin.000425 | 536881880 | | mastera-bin.000426 | 536881000 | | mastera-bin.000427 | 536889641 | | mastera-bin.000428 | 536871864 | | mastera-bin.000429 | 536883375 | | mastera-bin.000430 | 536904132 | | mastera-bin.000431 | 536915182 | | mastera-bin.000432 | 536902355 | | mastera-bin.000433 | 536879981 | | mastera-bin.000434 | 536875782 | | mastera-bin.000435 | 536937275 | | mastera-bin.000436 | 536891825 | | mastera-bin.000437 | 536926911 | | mastera-bin.000438 | 536910356 | | mastera-bin.000439 | 536884221 | | mastera-bin.000440 | 536905816 | | mastera-bin.000441 | 536926132 | | mastera-bin.000442 | 536903897 | | mastera-bin.000443 | 536938136 | | mastera-bin.000444 | 536899880 | | mastera-bin.000445 | 536908287 | | mastera-bin.000446 | 536909603 | | mastera-bin.000447 | 536927494 | | mastera-bin.000448 | 536906495 | | mastera-bin.000449 | 536871621 | | mastera-bin.000450 | 536900780 | | mastera-bin.000451 | 536893793 | | mastera-bin.000452 | 536887202 | | mastera-bin.000453 | 536897909 | | mastera-bin.000454 | 536873364 | | mastera-bin.000455 | 536954827 | | mastera-bin.000456 | 536932124 | | mastera-bin.000457 | 536894441 | | mastera-bin.000458 | 536882247 | | mastera-bin.000459 | 536880370 | | mastera-bin.000460 | 536901774 | | mastera-bin.000461 | 536897300 | | mastera-bin.000462 | 536880099 | | mastera-bin.000463 | 536918212 | | mastera-bin.000464 | 536892014 | | mastera-bin.000465 | 536957167 | | mastera-bin.000466 | 536880412 | | mastera-bin.000467 | 536896956 | | mastera-bin.000468 | 536893670 | | mastera-bin.000469 | 536942326 | | mastera-bin.000470 | 536938097 | | mastera-bin.000471 | 536882190 | | mastera-bin.000472 | 536964726 | | mastera-bin.000473 | 536885156 | | mastera-bin.000474 | 536872463 | | mastera-bin.000475 | 536897430 | | mastera-bin.000476 | 536911733 | | mastera-bin.000477 | 536892910 | | mastera-bin.000478 | 536901551 | | mastera-bin.000479 | 536888581 | | mastera-bin.000480 | 536876252 | | mastera-bin.000481 | 536873995 | | mastera-bin.000482 | 536919089 | | mastera-bin.000483 | 536896464 | | mastera-bin.000484 | 536901702 | | mastera-bin.000485 | 536957023 | | mastera-bin.000486 | 536943175 | | mastera-bin.000487 | 197614406 | | mastera-bin.000488 | 536923831 | | mastera-bin.000489 | 536898394 | | mastera-bin.000490 | 536873000 | | mastera-bin.000491 | 536875722 | | mastera-bin.000492 | 536895420 | | mastera-bin.000493 | 536913395 | | mastera-bin.000494 | 536887931 | | mastera-bin.000495 | 536961984 | | mastera-bin.000496 | 536919605 | | mastera-bin.000497 | 536888291 | | mastera-bin.000498 | 536893008 | | mastera-bin.000499 | 536873043 | | mastera-bin.000500 | 536876447 | | mastera-bin.000501 | 536951189 | | mastera-bin.000502 | 536870997 | | mastera-bin.000503 | 536950763 | | mastera-bin.000504 | 536891213 | | mastera-bin.000505 | 536888438 | | mastera-bin.000506 | 536941250 | | mastera-bin.000507 | 536928376 | | mastera-bin.000508 | 475318220 | +--------------------+-----------+ 176 rows in set (0.00 sec) 3:删除某个日志文件之前的所有日志文件或者清理所有日志   mysql> purge binary logs to 'mastera-bin.000508'; #清理mastera-bin.000508之前所有的日志 mysql> show binary logs; +------------------+-----------+ | Log_name | File_size | +------------------+-----------+ | mysql-bin.000508 | 475318220 | +------------------+-----------+ mysql> reset master; #清理所有的日志 4:关闭mysql的binlog日志   #log_bin=mastera-bin 在my.cnf里面注释掉binlog日志 重启mysql service mysqld restart
继续阅读 »
  1:登录数据库   mysql -u root -p 2:查看binlog日志   mysql> show binary logs; +--------------------+-----------+ | Log_name | File_size | +--------------------+-----------+ | mastera-bin.000333 | 536893526 | | mastera-bin.000334 | 536896177 | | mastera-bin.000335 | 536924066 | | mastera-bin.000336 | 536900592 | | mastera-bin.000337 | 536909231 | | mastera-bin.000338 | 536879575 | | mastera-bin.000339 | 536886303 | | mastera-bin.000340 | 536872989 | | mastera-bin.000341 | 536880182 | | mastera-bin.000342 | 536904402 | | mastera-bin.000343 | 536883547 | | mastera-bin.000344 | 536875696 | | mastera-bin.000345 | 536883123 | | mastera-bin.000346 | 536879848 | | mastera-bin.000347 | 536879386 | | mastera-bin.000348 | 536910231 | | mastera-bin.000349 | 536890985 | | mastera-bin.000350 | 536974817 | | mastera-bin.000351 | 536871614 | | mastera-bin.000352 | 536885359 | | mastera-bin.000353 | 536890754 | | mastera-bin.000354 | 536887216 | | mastera-bin.000355 | 536877251 | | mastera-bin.000356 | 536917994 | | mastera-bin.000357 | 536874089 | | mastera-bin.000358 | 536986283 | | mastera-bin.000359 | 536875648 | | mastera-bin.000360 | 536912004 | | mastera-bin.000361 | 536871392 | | mastera-bin.000362 | 536890812 | | mastera-bin.000363 | 536915108 | | mastera-bin.000364 | 536900213 | | mastera-bin.000365 | 536905615 | | mastera-bin.000366 | 536882660 | | mastera-bin.000367 | 536871473 | | mastera-bin.000368 | 536880560 | | mastera-bin.000369 | 536881409 | | mastera-bin.000370 | 536940190 | | mastera-bin.000371 | 536880720 | | mastera-bin.000372 | 536904622 | | mastera-bin.000373 | 536914892 | | mastera-bin.000374 | 536887070 | | mastera-bin.000375 | 536886963 | | mastera-bin.000376 | 536870975 | | mastera-bin.000377 | 536915913 | | mastera-bin.000378 | 536872260 | | mastera-bin.000379 | 536905617 | | mastera-bin.000380 | 536903305 | | mastera-bin.000381 | 536902205 | | mastera-bin.000382 | 536882027 | | mastera-bin.000383 | 536894498 | | mastera-bin.000384 | 536942442 | | mastera-bin.000385 | 536894713 | | mastera-bin.000386 | 536875598 | | mastera-bin.000387 | 536876980 | | mastera-bin.000388 | 536946713 | | mastera-bin.000389 | 536878512 | | mastera-bin.000390 | 536954192 | | mastera-bin.000391 | 536871419 | | mastera-bin.000392 | 536905782 | | mastera-bin.000393 | 536899555 | | mastera-bin.000394 | 536887905 | | mastera-bin.000395 | 536891320 | | mastera-bin.000396 | 536941034 | | mastera-bin.000397 | 536904725 | | mastera-bin.000398 | 536922729 | | mastera-bin.000399 | 536887783 | | mastera-bin.000400 | 536873172 | | mastera-bin.000401 | 536890007 | | mastera-bin.000402 | 536909439 | | mastera-bin.000403 | 536873499 | | mastera-bin.000404 | 536937488 | | mastera-bin.000405 | 536893321 | | mastera-bin.000406 | 536884022 | | mastera-bin.000407 | 536923776 | | mastera-bin.000408 | 536923124 | | mastera-bin.000409 | 536886722 | | mastera-bin.000410 | 536883708 | | mastera-bin.000411 | 536891586 | | mastera-bin.000412 | 536906806 | | mastera-bin.000413 | 536891526 | | mastera-bin.000414 | 536879610 | | mastera-bin.000415 | 536880254 | | mastera-bin.000416 | 536883004 | | mastera-bin.000417 | 536880933 | | mastera-bin.000418 | 536929111 | | mastera-bin.000419 | 536911818 | | mastera-bin.000420 | 536974374 | | mastera-bin.000421 | 536930619 | | mastera-bin.000422 | 536915602 | | mastera-bin.000423 | 536877242 | | mastera-bin.000424 | 536873643 | | mastera-bin.000425 | 536881880 | | mastera-bin.000426 | 536881000 | | mastera-bin.000427 | 536889641 | | mastera-bin.000428 | 536871864 | | mastera-bin.000429 | 536883375 | | mastera-bin.000430 | 536904132 | | mastera-bin.000431 | 536915182 | | mastera-bin.000432 | 536902355 | | mastera-bin.000433 | 536879981 | | mastera-bin.000434 | 536875782 | | mastera-bin.000435 | 536937275 | | mastera-bin.000436 | 536891825 | | mastera-bin.000437 | 536926911 | | mastera-bin.000438 | 536910356 | | mastera-bin.000439 | 536884221 | | mastera-bin.000440 | 536905816 | | mastera-bin.000441 | 536926132 | | mastera-bin.000442 | 536903897 | | mastera-bin.000443 | 536938136 | | mastera-bin.000444 | 536899880 | | mastera-bin.000445 | 536908287 | | mastera-bin.000446 | 536909603 | | mastera-bin.000447 | 536927494 | | mastera-bin.000448 | 536906495 | | mastera-bin.000449 | 536871621 | | mastera-bin.000450 | 536900780 | | mastera-bin.000451 | 536893793 | | mastera-bin.000452 | 536887202 | | mastera-bin.000453 | 536897909 | | mastera-bin.000454 | 536873364 | | mastera-bin.000455 | 536954827 | | mastera-bin.000456 | 536932124 | | mastera-bin.000457 | 536894441 | | mastera-bin.000458 | 536882247 | | mastera-bin.000459 | 536880370 | | mastera-bin.000460 | 536901774 | | mastera-bin.000461 | 536897300 | | mastera-bin.000462 | 536880099 | | mastera-bin.000463 | 536918212 | | mastera-bin.000464 | 536892014 | | mastera-bin.000465 | 536957167 | | mastera-bin.000466 | 536880412 | | mastera-bin.000467 | 536896956 | | mastera-bin.000468 | 536893670 | | mastera-bin.000469 | 536942326 | | mastera-bin.000470 | 536938097 | | mastera-bin.000471 | 536882190 | | mastera-bin.000472 | 536964726 | | mastera-bin.000473 | 536885156 | | mastera-bin.000474 | 536872463 | | mastera-bin.000475 | 536897430 | | mastera-bin.000476 | 536911733 | | mastera-bin.000477 | 536892910 | | mastera-bin.000478 | 536901551 | | mastera-bin.000479 | 536888581 | | mastera-bin.000480 | 536876252 | | mastera-bin.000481 | 536873995 | | mastera-bin.000482 | 536919089 | | mastera-bin.000483 | 536896464 | | mastera-bin.000484 | 536901702 | | mastera-bin.000485 | 536957023 | | mastera-bin.000486 | 536943175 | | mastera-bin.000487 | 197614406 | | mastera-bin.000488 | 536923831 | | mastera-bin.000489 | 536898394 | | mastera-bin.000490 | 536873000 | | mastera-bin.000491 | 536875722 | | mastera-bin.000492 | 536895420 | | mastera-bin.000493 | 536913395 | | mastera-bin.000494 | 536887931 | | mastera-bin.000495 | 536961984 | | mastera-bin.000496 | 536919605 | | mastera-bin.000497 | 536888291 | | mastera-bin.000498 | 536893008 | | mastera-bin.000499 | 536873043 | | mastera-bin.000500 | 536876447 | | mastera-bin.000501 | 536951189 | | mastera-bin.000502 | 536870997 | | mastera-bin.000503 | 536950763 | | mastera-bin.000504 | 536891213 | | mastera-bin.000505 | 536888438 | | mastera-bin.000506 | 536941250 | | mastera-bin.000507 | 536928376 | | mastera-bin.000508 | 475318220 | +--------------------+-----------+ 176 rows in set (0.00 sec) 3:删除某个日志文件之前的所有日志文件或者清理所有日志   mysql> purge binary logs to 'mastera-bin.000508'; #清理mastera-bin.000508之前所有的日志 mysql> show binary logs; +------------------+-----------+ | Log_name | File_size | +------------------+-----------+ | mysql-bin.000508 | 475318220 | +------------------+-----------+ mysql> reset master; #清理所有的日志 4:关闭mysql的binlog日志   #log_bin=mastera-bin 在my.cnf里面注释掉binlog日志 重启mysql service mysqld restart 收起阅读 »

mysql强制使用某个索引或者禁止使用某个索引

    mysql强制使用某个索引或者禁止使用某个索引 1、mysql强制使用索引:force index(索引名或者主键PRI) 例如:  select * from table force index(PRIMARY) limit 2;(强制使用主键) select * from table force index(field1_index) limit 2;(强制使用索引"field1_index") select * from table force index(PRIMARY,field1_index) limit 2;(强制使用索引"PRIMARY和field1_index") 2、mysql禁止某个索引:ignore index(索引名或者主键PRIMARY) 例如:  select * from table ignore index(PRIMARY) limit 2;(禁止使用主键) select * from table ignore index(field1_index) limit 2;(禁止使用索引"field1_index") select * from table ignore index(PRIMARY,field1_index) limit 2;(禁止使用索引"PRIMARY,field1_index")
继续阅读 »
    mysql强制使用某个索引或者禁止使用某个索引 1、mysql强制使用索引:force index(索引名或者主键PRI) 例如:  select * from table force index(PRIMARY) limit 2;(强制使用主键) select * from table force index(field1_index) limit 2;(强制使用索引"field1_index") select * from table force index(PRIMARY,field1_index) limit 2;(强制使用索引"PRIMARY和field1_index") 2、mysql禁止某个索引:ignore index(索引名或者主键PRIMARY) 例如:  select * from table ignore index(PRIMARY) limit 2;(禁止使用主键) select * from table ignore index(field1_index) limit 2;(禁止使用索引"field1_index") select * from table ignore index(PRIMARY,field1_index) limit 2;(禁止使用索引"PRIMARY,field1_index") 收起阅读 »

MySQL重置自增id的两种方法

  方法一(效率高,谨慎使用):   清空表数据并重置id:  truncate table table_name; 注意:truncate 一次性地从表中删除所有的数据并不把单独的删除操作记录记入日志保存,删除行是不能恢复的。并且在删除的过程中不会激活与表有关的删除触发器。执行速度快。 是DLL语言,无法回滚;当表被TRUNCATE 后,这个表和索引所占用的空间会恢复到初始大小。   方法二(数据量大则效率低):   delete from table_name; alter table table_name auto_increment= 1;    
继续阅读 »
  方法一(效率高,谨慎使用):   清空表数据并重置id:  truncate table table_name; 注意:truncate 一次性地从表中删除所有的数据并不把单独的删除操作记录记入日志保存,删除行是不能恢复的。并且在删除的过程中不会激活与表有关的删除触发器。执行速度快。 是DLL语言,无法回滚;当表被TRUNCATE 后,这个表和索引所占用的空间会恢复到初始大小。   方法二(数据量大则效率低):   delete from table_name; alter table table_name auto_increment= 1;     收起阅读 »

git 取消上次 merge 操作

Git
 命令:   git reset --hard
 命令:   git reset --hard

阿里云视频缩略图 倾斜 90度 解决方案

  产品:阿里云oss,阿里云视频缩略图   场景:   使用阿里云oss Android sdk 将录制的视频上传至oss,再生成缩略图,发现生成后的缩略图和原视频相比较倾斜90度。   原因:   通过 mediainfo 工具查看视频信息,发现视频信息中包含 "Rotation": "90.000" 参数,导致使用 阿里云视频缩略图功能 时会 截取旋转之后的缩略图。   解决办法:录制时或者上传时,不要指定 Rotation 参数,或者将 Rotation 参数值设置成:0.000   mediainfo 下载链接:https://mediaarea.net/en/MediaInfo/Download/Windows
继续阅读 »
  产品:阿里云oss,阿里云视频缩略图   场景:   使用阿里云oss Android sdk 将录制的视频上传至oss,再生成缩略图,发现生成后的缩略图和原视频相比较倾斜90度。   原因:   通过 mediainfo 工具查看视频信息,发现视频信息中包含 "Rotation": "90.000" 参数,导致使用 阿里云视频缩略图功能 时会 截取旋转之后的缩略图。   解决办法:录制时或者上传时,不要指定 Rotation 参数,或者将 Rotation 参数值设置成:0.000   mediainfo 下载链接:https://mediaarea.net/en/MediaInfo/Download/Windows 收起阅读 »

git 修改远程仓库地址 remote origin

Git
    方法一:   git remote set-url origin git@XXX 方法二:   git remote rm origin git remote add origin git@XXX
继续阅读 »
    方法一:   git remote set-url origin git@XXX 方法二:   git remote rm origin git remote add origin git@XXX 收起阅读 »

git 放弃本地修改 强制更新 命令

Git
  git fetch --all git reset --hard origin/master git fetch 只是下载远程的库的内容,不做任何的合并 git reset 把HEAD指向刚刚下载的最新的版本  
  git fetch --all git reset --hard origin/master git fetch 只是下载远程的库的内容,不做任何的合并 git reset 把HEAD指向刚刚下载的最新的版本  

php 通过 curl 下载网络图片到本地

  代码如下:   function save_img($url, $saveName, $path) { // 设置运行时间为无限制 set_time_limit ( 0 ); $url = trim ( $url ); $curl = curl_init (); // 设置你需要抓取的URL curl_setopt ( $curl, CURLOPT_URL, $url ); // 设置https if (stripos ( $url, "https://" ) !== FALSE) { curl_setopt ( $curl, CURLOPT_SSL_VERIFYPEER, FALSE ); curl_setopt ( $curl, CURLOPT_SSL_VERIFYHOST, false ); } // 设置header curl_setopt ( $curl, CURLOPT_HEADER, 0 ); // 设置cURL 参数,要求结果保存到字符串中还是输出到屏幕上。 curl_setopt ( $curl, CURLOPT_RETURNTRANSFER, 1 ); // 运行cURL,请求网页 $file = curl_exec ( $curl ); // 关闭URL请求 curl_close ( $curl ); // 将文件写入获得的数据 $filename = $path . $saveName; $write = @fopen ( $filename, "w" ); if ($write == false) { return false; } if (fwrite ( $write, $file ) == false) { return false; } if (fclose ( $write ) == false) { return false; } return $filename; }
继续阅读 »
  代码如下:   function save_img($url, $saveName, $path) { // 设置运行时间为无限制 set_time_limit ( 0 ); $url = trim ( $url ); $curl = curl_init (); // 设置你需要抓取的URL curl_setopt ( $curl, CURLOPT_URL, $url ); // 设置https if (stripos ( $url, "https://" ) !== FALSE) { curl_setopt ( $curl, CURLOPT_SSL_VERIFYPEER, FALSE ); curl_setopt ( $curl, CURLOPT_SSL_VERIFYHOST, false ); } // 设置header curl_setopt ( $curl, CURLOPT_HEADER, 0 ); // 设置cURL 参数,要求结果保存到字符串中还是输出到屏幕上。 curl_setopt ( $curl, CURLOPT_RETURNTRANSFER, 1 ); // 运行cURL,请求网页 $file = curl_exec ( $curl ); // 关闭URL请求 curl_close ( $curl ); // 将文件写入获得的数据 $filename = $path . $saveName; $write = @fopen ( $filename, "w" ); if ($write == false) { return false; } if (fwrite ( $write, $file ) == false) { return false; } if (fclose ( $write ) == false) { return false; } return $filename; } 收起阅读 »

单目运算符、双目运算符、三目运算符 区别

  1、单目运算符: 只对一个变量进行操作。  a++; 2、双目运算符: 对两个变量进行操作;  a=1; b=3; c=a+b;就是双目运算符; 3、三目运算符: 对三个变量进行操作;  int a = boolean ? b : c;
继续阅读 »
  1、单目运算符: 只对一个变量进行操作。  a++; 2、双目运算符: 对两个变量进行操作;  a=1; b=3; c=a+b;就是双目运算符; 3、三目运算符: 对三个变量进行操作;  int a = boolean ? b : c; 收起阅读 »

linux crontab 实现每秒执行

  linux crontab 命令,最小的执行时间是一分钟。如需要在小于一分钟内重复执行,下面使用原生 crontab 实现每10秒执行php脚本一次:   * * * * * sleep 10; php /data/webdata/cli/index.php cli log run * * * * * sleep 20; php /data/webdata/cli/index.php cli log run * * * * * sleep 30; php /data/webdata/cli/index.php cli log run * * * * * sleep 40; php /data/webdata/cli/index.php cli log run * * * * * sleep 50; php /data/webdata/cli/index.php cli log run 如果需要每秒执行,则多添加几条命令即可(sleep 1).
继续阅读 »
  linux crontab 命令,最小的执行时间是一分钟。如需要在小于一分钟内重复执行,下面使用原生 crontab 实现每10秒执行php脚本一次:   * * * * * sleep 10; php /data/webdata/cli/index.php cli log run * * * * * sleep 20; php /data/webdata/cli/index.php cli log run * * * * * sleep 30; php /data/webdata/cli/index.php cli log run * * * * * sleep 40; php /data/webdata/cli/index.php cli log run * * * * * sleep 50; php /data/webdata/cli/index.php cli log run 如果需要每秒执行,则多添加几条命令即可(sleep 1). 收起阅读 »

php 实现批量查询url百度是否收录

  功能:   从指定文件(sitemap.txt)中,提取url,查询百度是否收录,实时输出到界面上。   sitemap.txt 格式如下(一个url占一行):     执行结果:     代码:      
继续阅读 »
  功能:   从指定文件(sitemap.txt)中,提取url,查询百度是否收录,实时输出到界面上。   sitemap.txt 格式如下(一个url占一行):     执行结果:     代码:       收起阅读 »

php 实现 for循环 实时输出显示

    代码如下:  <?php ob_start(); //打开输出缓冲区 ob_end_flush(); ob_implicit_flush(1); //立即输出 for($i=0;$i<10;$i++){ echo str_repeat(" ",4096); //确保足够的字符,立即输出,Linux服务器中不需要这句 echo $i."<br/>"; sleep(1); }
继续阅读 »
    代码如下:  <?php ob_start(); //打开输出缓冲区 ob_end_flush(); ob_implicit_flush(1); //立即输出 for($i=0;$i<10;$i++){ echo str_repeat(" ",4096); //确保足够的字符,立即输出,Linux服务器中不需要这句 echo $i."<br/>"; sleep(1); } 收起阅读 »

js 调起APP(安卓和IOS)

  分享一段 js 调起APP(android和IOS)的代码:   <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JS调起APP</title> <meta name='apple-itunes-app' content='app-id=1309411684'><!--作用:苹果safari头部,如果已安装显示打开,没安装显示去下载--> </head> <body> <a href="javascript:;" id="openApp">调起APP</a> </body> </html> <script type="text/javascript"> document.getElementById('openApp').onclick = function(e){ if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) { window.location.href = "cnchat://";//ios app协议(ios开发人员提供) window.setTimeout(function() { window.location.href = "https://itunes.apple.com/cn/app/%E5%90%B9%E7%89%9B-%E6%A3%8B%E7%89%8C%E4%BA%A4%E5%8F%8B%E8%81%8A%E5%A4%A9%E5%B9%B3%E5%8F%B0/id1309411684?mt=8"; //app store 下载地址 }, 2000) } if(navigator.userAgent.match(/android/i)) { window.location.href = "cn://brotheraides";//android app协议(android开发人员提供) window.setTimeout(function() { window.location.href = "http://www.treeic.com/clients/chuiniu-29-1.3.3-20180124.apk";//android app下载地址 }, 2000) } }; </script>
继续阅读 »
  分享一段 js 调起APP(android和IOS)的代码:   <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JS调起APP</title> <meta name='apple-itunes-app' content='app-id=1309411684'><!--作用:苹果safari头部,如果已安装显示打开,没安装显示去下载--> </head> <body> <a href="javascript:;" id="openApp">调起APP</a> </body> </html> <script type="text/javascript"> document.getElementById('openApp').onclick = function(e){ if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) { window.location.href = "cnchat://";//ios app协议(ios开发人员提供) window.setTimeout(function() { window.location.href = "https://itunes.apple.com/cn/app/%E5%90%B9%E7%89%9B-%E6%A3%8B%E7%89%8C%E4%BA%A4%E5%8F%8B%E8%81%8A%E5%A4%A9%E5%B9%B3%E5%8F%B0/id1309411684?mt=8"; //app store 下载地址 }, 2000) } if(navigator.userAgent.match(/android/i)) { window.location.href = "cn://brotheraides";//android app协议(android开发人员提供) window.setTimeout(function() { window.location.href = "http://www.treeic.com/clients/chuiniu-29-1.3.3-20180124.apk";//android app下载地址 }, 2000) } }; </script> 收起阅读 »