WishMeLz

生活其实很有趣

压力测试

1.Webbench wget http://home.tiscali.cz/cz210552/distfiles/webbench-1.5.tar.gz 或者:http://itsse.oss-cn-shanghai.aliyuncs.com/files/1591677875011.gz tar xvzf webbench-1.5.tar.gz make 如果error: mkdir -p /usr/local/man    chmod 644 /usr/local/man make install webbench // we...

Vue项目打包

1.打包优化 --report npm run build --report 两个-// 根目录创建vue.config.js module.exports = { configureWebpack: { externals: { vue: "Vue", "vue-router": "VueRouter", vant: "vant" } } }; 2.页面刷新404// experss 操作 var history = require('connect-history-api-fal...

Vue移动端隐藏滚动条

html, body { width: 100%; height: 100%; overflow: scroll; } html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0px; height: 0px; } body { margin: 0; }

Nodejs express搭建https服务

阿里云申请ssl证书。下载证书 就出现两个文件 .key与.pem文件var fs = require('fs'); var http = require('http'); var https = require('https'); var privateKey = fs.readFileSync('./path/**.key', 'utf8'); var certificate = fs.readFileSync('./path/**.pem', 'utf8'); var credentials = {key: privateKey, cert...

Yum

yum history list 查看操作历史yum history undo id   卸载

BBR

bbr Plus wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh https://cdn.jsdelivr.net/gh/WishMelz/file/sh/bbr1.shUbuntu内核升级以及如何开启BBR加速1.) Ubuntu开启BBR的前提是内核必须等于高于4.9 查看命令...

charles for mac

// 适用于Charles任意版本的注册码 // help---> register Registered Name: https://zhile.io License Key: 48891cf209c6d32bf4 文章原链: https://zhile.io/2017/07/07/charles-proxy-usage-and-license.html

Vue项目错误笔记

一,路由错误import VueRouter from 'vue-router' const VueRouterPush = VueRouter.prototype.push VueRouter.prototype.push = function push(to) { return VueRouterPush.call(this, to).catch(err => err) }二,不停发送请求1. 找到/node_modules/sockjs-client/dist/sockjs.js 2.找到代码的 1605行 try { ...

pm2

pm2 start xxx --watch ##自动重启自动重启会出现一个问题,在上传文件的时间会出现跨域问题。其他接口都没有问题。

Node接口笔记

JTW 生成TOKEN let token = jsonwebtoken.sign({ id: data[0].id // 数据 }, secret, { expiresIn: 60 * 60 * 24 * 30 * 6 }) // 半年,过期时间 ,单位秒 secret为秘钥 解析 try { // 解析令牌,返回对象:{ exp: 过期时间, crt:创建时间 ...} userInfo = jwt.ve...

Centos安装Nginx

# 依赖 yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel # 下载安装包 wget http://nginx.org/download/nginx-1.13.7.tar.gz # 解压 tar -xvf # 进入运行文件 ./configure # 运行编译 make # 安装 make install nginx reload 重启 service nginx restart nginx -t 验证配置文件# 一份模板,不完整 worker_proc...

Nodejs,Mysql连接出错

const connection = mysql.createConnection(db)长时间不操作mysql,会自动关闭连接,导致服务中断。修改为:使用连接池const connection = mysql.createPool(db)const mysql = require('mysql'); const config = require('./config') const conn = mysql.createPool(config.db); var queryDB = func...

speedtest-cli测试带宽

# wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py # chmod +rx speedtest.py # sudo mv speedtest.py /usr/local/bin/speedtest-cli # sudo chown root:root /usr/local/bin/speedtest-cli speedtest-cli --bytes以字节计算的方式来测试上下行速度 speedtest-cli --share将速度测试的结...

使用request后台发送请求

处理有跨域的接口。后台调用const request = require('request'); router.get("/wnl", (req, res) => { request('https://www.sojson.com/open/api/lunar/json.shtml', function(error, response, body) { if (!error && response.statusCode == 200) { console.log(body) // S...

阿里大鱼发送短信

// 配置 const Core = require('@alicloud/pop-core'); var client = new Core({ accessKeyId: '****', // id accessKeySecret: '***', // 密钥 endpoint: 'https://dysmsapi.aliyuncs.com', apiVersion: '2017-05-25' }); // 用户模板信息 var params = { "RegionId": "cn-han...

阿里OSS存储

nodejs发送文件到public内,调用oss接口上传文件。 <input type="file" name="" id="photo"> $("#photo").on("change", function () { let file = $(this)[0].files[0]; let formdata = new FormData(); formdata.append("photo", file); $.ajax({ typ...

一段神奇的代码

alert((++[[]][+[]]/[]+[])[+[]]+([{}]+[])[++[[]][+[]]+[+[]]-+!+[]-+!+[]-+!+[]]+(![]+[])[!+[]+!+[]]+([{}]+[])[+!+[]]+'v'+(-{}+[]+[]+[][+[]])[+!+[]+[+[]]]+([{}]+[])[++[[]][+[]]+[+[]]-+!+[]-+!+[]-+!+[]]+(++[[]][+[]]/[]+[])[+!+[]+[+[]]-!+[]-!+[]-!+[]]+([{}]+[])[+!+[]]+([][[]]+[])[+...

Nodejs流

const fs = require("fs")// 创建写入流,就是先创建个文件。这个文件是空的。let ws = fs.createWriteStream('./public/upload/' + fileName); 写入数据 这里是二进制数据ws.write(req.file.buffer);  监听打开ws.on("open",function(fd){     console.log("文件正在打开",fd)...

项目树状图展示

npm install -g tree-cli treee -l 2 -o out.md --ignore [node_modules,config.js,package-lock.json,package.json]

nodejs发送邮件

开启QQ邮箱的SMTP服务// 安装npm install nodemailer --save var nodemailer = require('nodemailer'); var transporter = nodemailer.createTransport({ service: 'qq', port: 465, // SMTP 端口 secureConnection: true, // 使用 SSL auth: { // 你的smtp账号 user: '**********',...