分类 编程及辅助 下的文章

Bash CURL: 获取状态码以及信息处理


目标

后期为项目做准备,想处理一些信息的转换。在brootkit中重新处理远程地址,因为有些后门要固定信息,直接写ip或者域名不怎么好,想到利用github.io的形式来处理C&C服务器的信息,比如C&C的ip或者域名随时更改直接放到github的配置文件中,所有信息只需要读取一个公共的github项目就可以再次解析出远程服务器的相关信息。

curl 参数

-A/--user-agent <string>              设置用户代理发送给服务器
-b/--cookie <name=string/file>    cookie字符串或文件读取位置
-c/--cookie-jar <file>                    操作结束后把cookie写入到这个文件中
-C/--continue-at <offset>            断点续转
-D/--dump-header <file>              把header信息写入到该文件中
-e/--referer                                  来源网址
-f/--fail                                          连接失败时不显示http错误
-o/--output                                  把输出写到该文件中
-O/--remote-name                      把输出写到该文件中,保留远程文件的文件名
-r/--range <range>                      检索来自HTTP/1.1或FTP服务器字节范围
-s/--silent                                    静音模式。不输出任何东西
-T/--upload-file <file>                  上传文件
-u/--user <user[:password]>      设置服务器的用户和密码
-w/--write-out [format]                什么输出完成后
-x/--proxy <host[:port]>              在给定的端口上使用HTTP代理
-#/--progress-bar                        进度条显示当前的传送状态

-w 具体的参数可到 别人的博客园 里获得。

curl 获取状态码

curl -I -m 10 -o /dev/null -s -w %{http_code} https://elf-all.github.io/config/callback_port.conf

· -I 仅测试HTTP头
· -m 10 最多查询10s
· -o /dev/null 屏蔽原有输出信息
· -s silent 模式,不输出任何东西
· -w %{http_code} 控制额外输出

这样直接返回其文件的状态码,如果是404则是访问失败,可能项目配置文件的地址已更换,如果是200的话就可进行下一步了

curl 获取结果

curl https://elf-all.github.io/config/callback_port.conf

直接获取文件内容,就等待其他的处理。


CSS | 将彩色图片转换成黑白色


需求

净月投资热力图PC端涉及个列表图片,鼠标放上去之后图片变成有颜色的那种。
那就先要让它变成黑白的

代码如下

<img src="..." class="graypic" />
.graypic { 
    -webkit-filter: grayscale(100%);
    -moz-filter: grayscale(100%);
    -ms-filter: grayscale(100%);
    -o-filter: grayscale(100%);
    filter: grayscale(100%);
    filter: gray;
}

示例

background.jpg


element-ui table列合并--支持多个列(vue)


驻场的最后一天,小伙伴列的合并碰到了问题,帮忙解决一下。

效果如图:
微信截图_20201219105321.png

具体代码:

<el-table
        :data="tableData"
        :span-method="arraySpanMethod"
        border
        style="width: 100%; margin-top: 20px">
        <el-table-column
          prop="id"
          label="ID"
          width="180">
        </el-table-column>
        <el-table-column
          prop="name"
          label="姓名">
        </el-table-column>
        <el-table-column
          prop="amount1"
          label="数值 1(元)">
        </el-table-column>
        <el-table-column
          prop="amount2"
          label="数值 2(元)">
        </el-table-column>
        <el-table-column
          prop="amount3"
          label="数值 3(元)">
        </el-table-column>
      </el-table>

js部分

export default {
    data(){
        return {
          // 模拟后台返回数据
          tableData: [{
              id: '12987122',
              name: '王小虎',
              amount1: '234',
              amount2: '3.2',
              amount3: 10
            }, {
              id: '12987123',
              name: '王小虎',
              amount1: '165',
              amount2: '4.43',
              amount3: 12
            }, {
              id: '12987124',
              name: '王小虎',
              amount1: '324',
              amount2: '1.9',
              amount3: 9
            }, {
              id: '12987125',
              name: '王小虎',
              amount1: '621',
              amount2: '2.2',
              amount3: 17
            }, {
              id: '12987126',
              name: '王小虎',
              amount1: '539',
              amount2: '4.1',
              amount3: 15
            }, {
              id: '12987126',
              name: '王小虎3',
              amount1: '539',
              amount2: '4.1',
              amount3: 15
            }, {
              id: '12987126',
              name: '王小虎2',
              amount1: '539',
              amount2: '4.1',
              amount3: 15
            }, {
              id: '12987126',
              name: '王小虎2',
              amount1: '539',
              amount2: '4.1',
              amount3: 15
            }],
        needMergeArr: ['name', 'id'], // 有合并项的列
         rowMergeArrs: {}, // 包含需要一个或多个合并项信息的对象
        };
    },
    methods:{
            /**
             * @description 实现合并行或列
             * @param row:Object 需要合并的列name 如:'name' 'id'
             * @param column:Object 当前行的行数,由合并函数传入
             * @param rowIndex:Number 当前列的数据,由合并函数传入
             * @param columnIndex:Number 当前列的数据,由合并函数传入
             *
             * @return 函数可以返回一个包含两个元素的数组,第一个元素代表rowspan,第二个元素代表colspan。 也可以返回一个键名为rowspan和colspan的对象
             * 参考地址:https://element.eleme.cn/#/zh-CN/component/table#table-biao-ge
            */
            arraySpanMethod({ row, column, rowIndex, columnIndex }) {
                // 没办法循环判断具体是那一列 所以就只好写了多个if
                if (column.property === 'name') return this.mergeAction('name', rowIndex, column);
                if (column.property === 'id') return this.mergeAction('id', rowIndex, column);
            },
            /**
             * @description 根据数组来确定单元格是否需要合并
             * @param val:String 需要合并的列name 如:'name' 'id'
             * @param rowIndex:Number 当前行的行数,由合并函数传入
             * @param colData:Object 当前列的数据,由合并函数传入
             *
             * @return 返回值为一个数组表示该单元格是否需要合并; 说明: [0,0]表示改行被合并了 [n+,1]n为1时表示该单元格不动,n大于1时表示合并了N-1个单元格
            */
            mergeAction(val, rowIndex, colData) {
                let _row = this.rowMergeArrs[val].rowArr[rowIndex];
                let _col = _row > 0 ? 1 : 0;
                return [_row, _col];
            },
            /**
             * @description 根据数组将指定对象转化为相应的数组
             * @param arr:Array[String] 必填 必须是字符串形式的数组
             * @param data:Array 必填 需要转化的对象
             *
             * @return 返回一个对象
             * 例:rowMerge(['name','value'], [{value:'1', name:'小明'}, {value:'2', name:'小明'}, {value:'3', name:'小明'}, {value:'1', name:'小明'}, {value:'1', name:'小明'}])
             * 返回值: {
             *          name:{
             *            rowArr: [5, 0, 0, 0, 0]
             *            rowMergeNum: 0,
             *          },
             *          value: {
             *            rowArr: [1, 1, 1, 2, 0],
             *            rowMergeNum: 3
             *          }
             *        }
            */
            rowMergeHandle(arr, data) {
              if (!Array.isArray(arr) && !arr.length) return false;
              if (!Array.isArray(data) && !data.length) return false;
              let needMerge = {};
              arr.forEach(i => {
                needMerge[i] = {
                  rowArr: [],
                  rowMergeNum: 0
                };
                data.forEach((item, index) => {
                  if (index === 0) {
                    needMerge[i].rowArr.push(1);
                    needMerge[i].rowMergeNum = 0;
                  } else {
                    if (item[i] === data[index - 1][i]) {
                      needMerge[i].rowArr[needMerge[i].rowMergeNum] += 1;
                      needMerge[i].rowArr.push(0);
                    } else {
                      needMerge[i].rowArr.push(1);
                      needMerge[i].rowMergeNum = index;
                    }
                  }
                });
              });
              return needMerge;
            }
          }
    },
    mounted(){
        this.rowMergeArrs = this.rowMergeHandle(this.needMergeArr, this.tableData); // 处理数据
    }
}

CSS:鼠标悬停整体上升


驻场管委会需要个悬停的效果:

.mouse_onshow{background:white;margin:0 5px;}
.mouse_onshow:hover{
    transform:translate(0,-10px);  
   -webkit-transform:translate(0,-10px);    
  -moz-transform:translate(0,-10px);    
  -o-transform:translate(0,-10px);    
  -ms-transform:translate(0,-10px);
    box-shadow:0px 5px 20px #ccc;
}

1.鼠标悬停图片变大

:hover {

  -webkit-transform: scale(1.1);

  -moz-transform: scale(1.1);

  -o-transform: scale(1.1);

  -ms-transform: scale(1.1);

}

缓慢变化需要在包住图片的外层加上:-webkit-transition: all 0.5s; -moz-transition: all 0.5s; -o-transition: all 0.5s; -ms-transition: all 0.5s;

变大不超出的话就加上overflow:hidden;

2.鼠标悬停整体旋转

:hover {

  transform:rotate(360deg);

  -webkit-transform:rotate(360deg);

  -moz-transform:rotate(360deg);

  -o-transform:rotate(360deg);

  -ms-transform:rotate(360deg);

}

缓慢变化需要在包住图片的外层加上:transition:All 0.4s ease-in-out;-webkit-transition:All 0.4s ease-in-out;-moz-transition:All 0.4s ease-in-out;-o-transition:All 0.4s ease-in-out;

3.鼠标悬停整体旋转放大

:hover {

  transform:rotate(360deg) scale(1.2);

  -webkit-transform:rotate(360deg) scale(1.2);

  -moz-transform:rotate(360deg) scale(1.2);

  -o-transform:rotate(360deg) scale(1.2);

  -ms-transform:rotate(360deg) scale(1.2);

}

缓慢变化需要在包住图片的外层加上:transition:All 0.4s ease-in-out;-webkit-transition:All 0.4s ease-in-out;-moz-transition:All 0.4s ease-in-out;-o-transition:All 0.4s ease-in-out;

4.鼠标悬停整体上升

:hover {

  transform:translate(0,-10px);

  -webkit-transform:translate(0,-10px);

  -moz-transform:translate(0,-10px);

  -o-transform:translate(0,-10px);

  -ms-transform:translate(0,-10px);

}

缓慢变化需要在包住图片的外层加上:transition:All 0.4s ease-in-out;-webkit-transition:All 0.4s ease-in-out;-moz-transition:All 0.4s ease-in-out;-o-transition:All 0.4s ease-in-out;

需要上升载加一点阴影(加在hover里面):box-shadow:0px 5px 20px #ccc;


CSS:画圆点连线


这回再高新管委会驻场,需要到一个效果,没办法,只能手写 ,来吧!
微信图片编辑_20201216083415.jpg

先来个网上的示例,这个是个动画效果

<!DOCTYPE html>
<html>
    <head>
        <style>
            html,
            body {
                width: 100%;
                height: 100%;
            }
            body {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
            }
            .day-05 {
                background: #01161e;
                height: 100%;
                width: 100%;
                display: flex;
                align-items: center;
            }
            .day-05 .container {
                width: 500px;
                height: 500px;
                margin: auto;
                position: relative;
            }
            .day-05 .container .geom {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                opacity: 0;
            }
            .day-05 .container .geom:nth-child(1) {
                transform: rotate(25deg);
                animation: rotateScale2 6s 1s ease-in-out infinite alternate, appear 6s 1s ease-in-out forwards;
            }
            @keyframes rotateScale1 {
                0% {
                    transform: rotate(20deg);
                }
                50% {
                    transform: rotate(-160deg) scale(0.1);
                }
                100% {
                    transform: rotate(-340deg) scale(1);
                }
            }
            .day-05 .container .geom:nth-child(2) {
                transform: rotate(50deg);
                animation: rotateScale2 3s 0.6s ease-in-out infinite alternate, appear 3s 0.6s ease-in-out forwards;
            }
            @keyframes rotateScale2 {
                0% {
                    transform: rotate(40deg);
                }
                50% {
                    transform: rotate(220deg) scale(0.1);
                }
                100% {
                    transform: rotate(400deg) scale(1);
                }
            }
            .day-05 .container .geom:nth-child(3) {
                transform: rotate(75deg);
                animation: rotateScale2 6s 3s ease-in-out infinite alternate, appear 6s 3s ease-in-out forwards;
            }
            @keyframes rotateScale3 {
                0% {
                    transform: rotate(60deg);
                }
                50% {
                    transform: rotate(-120deg) scale(0.1);
                }
                100% {
                    transform: rotate(-300deg) scale(1);
                }
            }
            .day-05 .container .geom:nth-child(4) {
                transform: rotate(100deg);
                animation: rotateScale4 3s 1.2s ease-in-out infinite alternate, appear 3s 1.2s ease-in-out forwards;
            }
            @keyframes rotateScale4 {
                0% {
                    transform: rotate(80deg);
                }
                50% {
                    transform: rotate(260deg) scale(0.1);
                }
                100% {
                    transform: rotate(440deg) scale(1);
                }
            }
            .day-05 .container .geom:nth-child(5) {
                transform: rotate(125deg);
                animation: rotateScale2 6s 5s ease-in-out infinite alternate, appear 6s 5s ease-in-out forwards;
            }
            @keyframes rotateScale5 {
                0% {
                    transform: rotate(100deg);
                }
                50% {
                    transform: rotate(-80deg) scale(0.1);
                }
                100% {
                    transform: rotate(-260deg) scale(1);
                }
            }
            .day-05 .container .geom:nth-child(6) {
                transform: rotate(150deg);
                animation: rotateScale6 3s 1.8s ease-in-out infinite alternate, appear 3s 1.8s ease-in-out forwards;
            }
            @keyframes rotateScale6 {
                0% {
                    transform: rotate(120deg);
                }
                50% {
                    transform: rotate(300deg) scale(0.1);
                }
                100% {
                    transform: rotate(480deg) scale(1);
                }
            }
            .day-05 .container .geom:nth-child(7) {
                transform: rotate(175deg);
                animation: rotateScale2 6s 7s ease-in-out infinite alternate, appear 6s 7s ease-in-out forwards;
            }
            @keyframes rotateScale7 {
                0% {
                    transform: rotate(140deg);
                }
                50% {
                    transform: rotate(-40deg) scale(0.1);
                }
                100% {
                    transform: rotate(-220deg) scale(1);
                }
            }
            .day-05 .container .geom:nth-child(8) {
                transform: rotate(200deg);
                animation: rotateScale8 3s 2.4s ease-in-out infinite alternate, appear 3s 2.4s ease-in-out forwards;
            }
            @keyframes rotateScale8 {
                0% {
                    transform: rotate(160deg);
                }
                50% {
                    transform: rotate(340deg) scale(0.1);
                }
                100% {
                    transform: rotate(520deg) scale(1);
                }
            }
            .day-05 .container .geom:nth-child(odd) .vertice {
                background: #0fe5b0;
            }
            .day-05 .container .geom:nth-child(odd) .vertice::before,
            .day-05 .container .geom:nth-child(odd) .vertice::after {
                background: #0fe5b0;
            }
            .day-05 .container .geom:nth-child(even) .vertice {
                background: #fff;
            }
            .day-05 .container .geom:nth-child(even) .vertice::before,
            .day-05 .container .geom:nth-child(even) .vertice::after {
                background: #fff;
            }
            .day-05 .container .geom .vertice {
                position: absolute;
            }
            .day-05 .container .geom .vertice::before,
            .day-05 .container .geom .vertice::after {
                content: "";
                position: absolute;
            }
            .day-05 .container .geom .vertice-1,
            .day-05 .container .geom .vertice-5 {
                height: 2px;
                left: 166px;
                width: 166px;
            }
            .day-05 .container .geom .vertice-1::before,
            .day-05 .container .geom .vertice-5::before {
                left: -9px;
                top: -9px;
                width: 20px;
                height: 20px;
                border-radius: 100%;
            }
            .day-05 .container .geom .vertice-1::after,
            .day-05 .container .geom .vertice-5::after {
                right: -9px;
                top: -9px;
                width: 20px;
                height: 20px;
                border-radius: 100%;
            }
            .day-05 .container .geom .vertice-5 {
                bottom: 0;
            }
            .day-05 .container .geom .vertice-6,
            .day-05 .container .geom .vertice-7,
            .day-05 .container .geom .vertice-8 {
                width: 2px;
                left: 0;
                height: 234px;
            }
            .day-05 .container .geom .vertice-6 {
                transform: rotate(-45deg);
                top: 334px;
            }
            .day-05 .container .geom .vertice-8 {
                transform: rotate(-135deg);
                top: 166px;
            }
            .day-05 .container .geom .vertice-2 {
                transform: rotate(135deg);
                top: 166px;
            }
            .day-05 .container .geom .vertice-4 {
                transform: rotate(45deg);
                top: 334px;
            }
            .day-05 .container .geom .vertice-2,
            .day-05 .container .geom .vertice-3,
            .day-05 .container .geom .vertice-4 {
                width: 2px;
                right: 0;
                height: 234px;
            }
            .day-05 .container .geom .vertice-3,
            .day-05 .container .geom .vertice-7 {
                height: 166px;
                top: 166px;
            }
            .day-05 .container .geom .vertice-3::before,
            .day-05 .container .geom .vertice-7::before {
                left: -9px;
                top: -9px;
                width: 20px;
                height: 20px;
                border-radius: 100%;
            }
            .day-05 .container .geom .vertice-3::after,
            .day-05 .container .geom .vertice-7::after {
                left: -9px;
                bottom: -9px;
                width: 20px;
                height: 20px;
                border-radius: 100%;
            }
            .day-05 .container .geom .vertice-6,
            .day-05 .container .geom .vertice-8,
            .day-05 .container .geom .vertice-2,
            .day-05 .container .geom .vertice-4 {
                transform-origin: 0 0;
            }
            @keyframes appear {
                0% {
                    opacity: 0;
                }
                100% {
                    opacity: 1;
                }
            }
            @keyframes heightSpan {
                0% {
                    opacity: 0;
                }
                100% {
                    opacity: 1;
                }
            }
        </style>
    </head>
    <body>
        <div class="day-05">
            <div class="container">
                <div class="geom">
                    <span class="vertice vertice-1"></span>
                    <span class="vertice vertice-2"></span>
                    <span class="vertice vertice-3"></span>
                    <span class="vertice vertice-4"></span>
                    <span class="vertice vertice-5"></span>
                    <span class="vertice vertice-6"></span>
                    <span class="vertice vertice-7"></span>
                    <span class="vertice vertice-8"></span>
                </div>
                <div class="geom">
                    <span class="vertice vertice-1"></span>
                    <span class="vertice vertice-2"></span>
                    <span class="vertice vertice-3"></span>
                    <span class="vertice vertice-4"></span>
                    <span class="vertice vertice-5"></span>
                    <span class="vertice vertice-6"></span>
                    <span class="vertice vertice-7"></span>
                    <span class="vertice vertice-8"></span>
                </div>
                <div class="geom">
                    <span class="vertice vertice-1"></span>
                    <span class="vertice vertice-2"></span>
                    <span class="vertice vertice-3"></span>
                    <span class="vertice vertice-4"></span>
                    <span class="vertice vertice-5"></span>
                    <span class="vertice vertice-6"></span>
                    <span class="vertice vertice-7"></span>
                    <span class="vertice vertice-8"></span>
                </div>
                <div class="geom">
                    <span class="vertice vertice-1"></span>
                    <span class="vertice vertice-2"></span>
                    <span class="vertice vertice-3"></span>
                    <span class="vertice vertice-4"></span>
                    <span class="vertice vertice-5"></span>
                    <span class="vertice vertice-6"></span>
                    <span class="vertice vertice-7"></span>
                    <span class="vertice vertice-8"></span>
                </div>
                <div class="geom">
                    <span class="vertice vertice-1"></span>
                    <span class="vertice vertice-2"></span>
                    <span class="vertice vertice-3"></span>
                    <span class="vertice vertice-4"></span>
                    <span class="vertice vertice-5"></span>
                    <span class="vertice vertice-6"></span>
                    <span class="vertice vertice-7"></span>
                    <span class="vertice vertice-8"></span>
                </div>
                <div class="geom">
                    <span class="vertice vertice-1"></span>
                    <span class="vertice vertice-2"></span>
                    <span class="vertice vertice-3"></span>
                    <span class="vertice vertice-4"></span>
                    <span class="vertice vertice-5"></span>
                    <span class="vertice vertice-6"></span>
                    <span class="vertice vertice-7"></span>
                    <span class="vertice vertice-8"></span>
                </div>
                <div class="geom">
                    <span class="vertice vertice-1"></span>
                    <span class="vertice vertice-2"></span>
                    <span class="vertice vertice-3"></span>
                    <span class="vertice vertice-4"></span>
                    <span class="vertice vertice-5"></span>
                    <span class="vertice vertice-6"></span>
                    <span class="vertice vertice-7"></span>
                    <span class="vertice vertice-8"></span>
                </div>
                <div class="geom">
                    <span class="vertice vertice-1"></span>
                    <span class="vertice vertice-2"></span>
                    <span class="vertice vertice-3"></span>
                    <span class="vertice vertice-4"></span>
                    <span class="vertice vertice-5"></span>
                    <span class="vertice vertice-6"></span>
                    <span class="vertice vertice-7"></span>
                    <span class="vertice vertice-8"></span>
                </div>
            </div>
        </div>
    </body>
</html>