126 gists results Add gist
netnr/ wsa.js 2019-12-08 15:21
Web Speech API ,朗读页面选中的内容
var ssu = {
    init: function () {
        var txt = window.getSelection().toString();
        ssu.speech(txt);
    },
    speech: function (txt) {
        if (!txt || txt.trim() == "") {
            txt = "未选择文字";
        }
        var ws = new window.SpeechSynthesisUtterance(txt);
查看详情
netnr/ upload.php 2019-11-14 07:20
PHP分片上传
<?php

// 设置跨域头
header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Methods:PUT,POST,GET,DELETE,OPTIONS');
header('Access-Control-Allow-Headers:*');
header('Content-Type:application/json; charset=utf-8');

$file = isset($_FILES['file']) ? $_FILES['file']:null; //分段文件
$name = isset($_POST['name']) ? $_POST['name']:null; //文件名
查看详情
netnr/ yum.conf 2019-11-07 06:50
yum 代理设置
vi /etc/yum.conf    # 编辑

proxy=http://192.168.3.122:1081 # 末尾追加
查看详情
netnr/ frp.md 2019-09-29 09:05
frp配置文件
文档 <https://gofrp.org>

下载 <https://github.com/fatedier/frp/releases>

### frps.ini
服务端配置

```
[common]
# frp server 绑定的端口
查看详情
netnr/ sqlserver-backup-database 2019-09-27 11:36
sqlserver备份数据并打包为zip
# 生成备份文件 && 打包为zip && 删除备份文件
sqlcmd -S . -U sa -P 123 -Q "BACKUP DATABASE netnr TO  DISK = '/package/data/netnr.bak' with format" && cd /package/data && zip -r netnr.zip netnr.bak && rm -rf netnr.bak
# 注意权限 chown mssql /package/data && chgrp mssql /package/data

# 备份
sqlcmd -S . -U sa -P 密码 -Q "BACKUP DATABASE 数据库 TO  DISK = '备份路径' with format"
查看详情
netnr/ cat-name 2019-09-26 15:51
查看linux系统的版本名称
hostnamectl # 信息一览

uname -a # Linux内核版本
uname -r
cat /proc/version
cat /etc/issue

cat /etc/redhat-release # RedHat(centos)
查看详情
netnr/ default 2019-09-26 14:21
centos7更改为启动桌面或命令行模式
systemctl get-default   # 获取当前系统启动模式

systemctl set-default graphical.target  # 命令行 => 图形界面
systemctl set-default multi-user.target # 图形界面 => 命令行

cat /etc/inittab    # 配置文件

# help
https://blog.csdn.net/qq_23014435/article/details/74347925
查看详情
netnr/ openssl 2019-09-25 15:30
openssl证书格式转换(pfx)
# cer 转 pfx
openssl pkcs12 -export -out fullchain.pfx -inkey private.key -in fullchain.cer

# p7b 转 crt
openssl pkcs7 -print_certs -in fullchain.p7b -out fullchain.crt

# 分解命令:
pkcs12 # OpenSSL中PKCS#12文件的文件实用程序
-export -out fullchain.pfx  # 导出并保存
-inkey private.key # 使用私钥文件作为与证书结合的私钥
查看详情
netnr/ du 2019-09-23 06:49
Linux查看文件、文件夹大小
# 磁盘整体情况
df -h

# 指定目录下所有文件夹大小
du -sh /netnr/*
du -sh # 当前目录

du -sh .[!.]* # 隐藏文件

# 指定目录文件列表
查看详情
netnr/ proxy_store.conf 2019-09-18 09:00
nginx反向代理永久缓存文件,整站下载利器
# 访问 http://localhost:66/index.html
server {    
    listen 66;
    charset utf-8;

    location / {
        # 不存在则直接从后台web内容服务器调取
        if (!-e $request_filename) {
            proxy_pass https://squoosh.app;
        }
查看详情

链接