zoukankan      html  css  js  c++  java
  • 积累-T

    emmm,各种知识点都有吧,主要方便自己记

    linux查看开放端口

    firewall-cmd --zone=public --list-ports

     放行端口

    firewall-cmd --permanent --zone=public --add-port=81/tcp

    重载

    firewall-cmd --reload

    随机修改网页图标

    <script>
    var image=new Array(3);
    image.length=3;
    image[1]="__STATIC__/img/ico/Fate.ico";
    image[2]="__STATIC__/img/ico/Rebirths.ico";
    image[3]="__STATIC__/img/ico/Zoroastrianism.ico";
    // console.log(image[Math.round(Math.random()*2)+1]);
    icourl=image[Math.round(Math.random()*2)+1];
    console.log(icourl);
    document.write("<link rel='shortcut icon'"+" "+"href="+icourl);
    </script>

    php.ini命令执行函数
    disable_functions =

    解决post提交时variable type error: array问题
    修改config文件default_return_type默认输出格式为json

    关闭google自动翻译.hosts中添加
    203.208.46.200 translate.googleapis.com
    以防止某些页面动态效果或排版混乱

    NationalSecurityAgency软件逆向工程(SRE)框架
    https://github.com/NationalSecurityAgency/ghidra

    xshell6免费授权
    https://www.netsarang.com/zh/free-for-home-school/








    WEB端 wss socket测试(直接在任意浏览器console中输入)

    ws测试将wss改为ws,域名改为IP地址,端口改为start.php中配置的端口
    (wss端口在wssserver.php中配置端口)
    ws = new WebSocket("wss://test.wxschool.net:444");

    ws.onopen = function() {

    alert("连接成功");

    ws.send('tom');

    alert("给服务端发送一个字符串:tom");

    };

    ws.onmessage = function(e) {

    alert("收到服务端的消息:" + e.data);

    };







     1     include IA_ROOT . "/framework/library/phpexcel/PHPExcel.php";
     2     $objPHPExcel = new PHPExcel();
     3     $objPHPExcel->getProperties()->setCreator("ctos")
     4         ->setLastModifiedBy("ctos")
     5         ->setTitle("Office 2007 XLSX Test Document")
     6         ->setSubject("Office 2007 XLSX Test Document")
     7         ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
     8         ->setKeywords("office 2007 openxml php")
     9         ->setCategory("Test result file");
    10 
    11 //set width
    12     $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(30);
    13     $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(20);
    14     $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(20);
    15     $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(20);
    16     $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(20);
    17     $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(30);
    18 
    19     $objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(22);
    20 
    21     $objPHPExcel->getActiveSheet()->getRowDimension('2')->setRowHeight(20);
    22 
    23 //set font size bold
    24     $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setSize(10);
    25     $objPHPExcel->getActiveSheet()->getStyle('A2:J2')->getFont()->setBold(true);
    26 
    27     $objPHPExcel->getActiveSheet()->getStyle('A2:J2')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
    28     $objPHPExcel->getActiveSheet()->getStyle('A2:J2')->getBorders()->getAllBorders()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
    29 
    30 //
    31     $objPHPExcel->getActiveSheet()->mergeCells('A1:J1');
    32 
    33 
    34     $shopinfo = pdo_fetchall("SELECT `goods_name`, `goods_money`, `goods_num`, `appid`, `order_id`, `seller_name` FROM " . tablename('zh_jdgjb_nav'));
    35 
    36     for ($i = 0; $i < count($shopinfo) - 1; $i++) {
    37         $objPHPExcel->getActiveSheet(0)->setCellValue('A' . ($i + 2), $shopinfo[$i]['goods_name']);
    38         $objPHPExcel->getActiveSheet(0)->setCellValue('B' . ($i + 2), $shopinfo[$i]['goods_money']);
    39         $objPHPExcel->getActiveSheet(0)->setCellValue('C' . ($i + 2), $shopinfo[$i]['goods_num']);
    40         $objPHPExcel->getActiveSheet(0)->setCellValue('D' . ($i + 2), $shopinfo[$i]['appid']);
    41         $objPHPExcel->getActiveSheet(0)->setCellValue('E' . ($i + 2), $shopinfo[$i]['order_id']);
    42         $objPHPExcel->getActiveSheet(0)->setCellValue('F' . ($i + 2), $shopinfo[$i]['seller_name']);
    43     }
    44 
    45     // Rename sheet
    46     $objPHPExcel->getActiveSheet()->setTitle(date('YmdHis') . '商品数据');
    47 
    48 
    49 // Set active sheet index to the first sheet, so Excel opens this as the first sheet
    50     $objPHPExcel->setActiveSheetIndex(0);
    51 
    52 
    53 // Redirect output to a client’s web browser (Excel5)
    54     ob_end_clean();//清除缓冲区,避免乱码
    55     header('Content-Type: application/vnd.ms-excel');
    56     header('Content-Disposition: attachment;filename="订单汇总表(' . date('Ymd-His') . ').xls"');
    57     header('Cache-Control: max-age=0');
    58 
    59     $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
    60     $objWriter->save('php://output');

    修改PhpStorm右上角浏览器配置

     

    PhpStudy配置Nginx

    打开目录 nginx-conf

    server {
    
            listen       80;
    
            server_name  www.restfulapi.com/;    //自己配置的虚拟域名
    
            root   "E:/phpstudy/WWW/restfulapi/restful";    //写到你指向的最终rewrite地址
    
            location / {
    
                index  index.html index.htm index.php;
    
                #autoindex  on;
    
                if ($request_filename !~ (static|robots/.txt|index/.php.*)) {
    
                    rewrite ^/(.*)$ /index.php?$1 last;
    
                    break;
    
                    }
    } location
    ~ .php(.*)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; } }

     Nginx伪静态配置

    在vhosts.conf相应的项目中添加

    if (!-e $request_filename) {
                        rewrite ^/(.*)$ /index.php/$1 last;
                    }

    完整文件如下

    server {
            listen        80;
            server_name  li.com;
            root   "E:/CodeLib/PHPCode/li/public";
            location / {
                if (!-e $request_filename) {
                        rewrite ^/(.*)$ /index.php/$1 last;
                    }
                index index.php index.html;
                error_page 400 /error/400.html;
                error_page 403 /error/403.html;
                error_page 404 /error/404.html;
                error_page 500 /error/500.html;
                error_page 501 /error/501.html;
                error_page 502 /error/502.html;
                error_page 503 /error/503.html;
                error_page 504 /error/504.html;
                error_page 505 /error/505.html;
                error_page 506 /error/506.html;
                error_page 507 /error/507.html;
                error_page 509 /error/509.html;
                error_page 510 /error/510.html;
                include E:/CodeLib/PHPCode/li/public/nginx.htaccess;
                autoindex  off;
            }
            location ~ .php(.*)$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_split_path_info  ^((?U).+.php)(/?.+)$;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                fastcgi_param  PATH_INFO  $fastcgi_path_info;
                fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
                include        fastcgi_params;
            }
    }

    阿里巴巴矢量图标库全选

    var iconList = document.querySelectorAll('.icon-gouwuche1');
    for (var i = 0; i < iconList.length; i++) {
    iconList[i].click();
    }

    20191030

    将积累的分类了下,后缀为T的属于积累项,有新东西及时记录

  • 相关阅读:
    如何设计web系统的监控
    RedisCluster的rename机制失败报错,解决又是数据倾斜问题
    学习大数据基础资源收集与分享
    用过滤器实现日志记录
    HttpClient 教程
    【公告】
    【2020赛季训练实录】
    【BZOJ5415&UOJ393】归程(Kruskal重构树,最短路)
    【BZOJ3545&BZOJ3551】Peaks(kruskal重构树,主席树,dfs序)
    【CF1263E】Editor(线段树,栈)
  • 原文地址:https://www.cnblogs.com/xuanjiange/p/11139226.html
Copyright © 2011-2022 走看看