# 为虚拟网络接口 utun0 配置 IP 地址 10.0.0.33 和子网掩码 255.255.255.0 网关地址 10.0.0.1
sudo ifconfig utun0 10.0.0.33 10.0.0.1 netmask 255.255.255.0
# 配置目标地址是网段 192.168.1.0/24 的流量走 10.0.0.1 网关
sudo route add 192.168.1.0/24 10.0.0.1
# 将 6.11.20.10 这个单一地址(因为掩码是 32)路由到 192.168.4.1 这个网关
sudo route add 6.11.20.10/32 192.168.4.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## pip install flask cpca | |
## http://172.24.1.55:8000/?keyword=福建省漳州市龙海市角美镇菜鸟电商园一期二号库夏奶录 | |
import cpca | |
from flask import Flask,request | |
app = Flask(__name__) | |
@app.route('/',methods=["GET"]) | |
def hello_world(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Quark Download | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description 点击鼠标中键直接下载夸克网盘内容,无需下载客户端 | |
// @author Xav1erW | |
// @match http*://pan.quark.cn/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// @license MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
db: | |
image: postgres:11-alpine | |
environment: | |
POSTGRES_DB: wiki | |
POSTGRES_PASSWORD: wikijsrocks | |
POSTGRES_USER: wikijs | |
logging: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env pwsh | |
# https://stackoverflow.com/questions/8761888/capturing-standard-out-and-error-with-start-process | |
function Start-Command ([String]$Path, [String]$Arguments) { | |
$pinfo = New-Object System.Diagnostics.ProcessStartInfo | |
$pinfo.FileName = $Path | |
$pinfo.RedirectStandardError = $true | |
$pinfo.RedirectStandardOutput = $true | |
$pinfo.UseShellExecute = $false | |
$pinfo.Arguments = $Arguments |
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SignJWT, | |
generateKeyPair, exportJWK,importJWK,exportPKCS8, | |
decodeProtectedHeader,decodeJwt, | |
jwtVerify, | |
} from "jose"; | |
// use jsrsasign only in web browser | |
// import { KEYUTIL, jws } from "jsrsasign"; | |
// https://nodejs.org/docs/latest-v16.x/api/crypto.html#static-method-keyobjectfromkey | |
// https://github.com/panva/jose/blob/c185e24def279e921258ccbafaf65d4bb571d60d/docs/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Install and enable the rabbitmq_delayed_message_exchange plugin as described by Alvaro Videla in this blogpost: | |
* https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/ | |
*/ | |
const amqp = require('amqplib'); | |
const exchange = 'yourExchangeName'; | |
const queue = 'yourQueueName'; | |
const queueBinding = 'yourQueueBindingName'; | |
// Message consumer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const sodium = require('libsodium-wrappers'); | |
sodium.ready.then(function() | |
{ | |
console.log('sodium ready'); | |
//xchacha20ploy1305 ietf | |
//A key and a nonce are generated by the encrypting party. The decrypting | |
//party should use them for decryption |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const useFetch = (service) => { | |
const [loading, setLoading] = useState(true); | |
const [error, setError] = useState(); | |
const [data, setData] = useState(); | |
const fetchAPI = useCallback(async () => { | |
try { | |
const res = await fetch(service); | |
const json = await res.json(); | |
setData(json); |
NewerOlder