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
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
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
if __name__ == "__main__": | |
reactor_args = {} | |
def run_twisted_wsgi(): | |
from twisted.internet import reactor | |
from twisted.web.server import Site | |
from twisted.web.wsgi import WSGIResource | |
resource = WSGIResource(reactor, reactor.getThreadPool(), app) | |
site = Site(resource) |
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 cv2 | |
import time | |
import math | |
import numpy as np | |
import tensorflow as tf | |
class SsdAnchorsCalculatorOptions: | |
def __init__(self, input_size_width, input_size_height, min_scale, max_scale | |
, num_layers, feature_map_width, feature_map_height | |
, strides, aspect_ratios, anchor_offset_x=0.5, anchor_offset_y=0.5 |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<!-- Bootstrap CSS --> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet"> | |
<link href="https://unpkg.com/vuetify/dist/vuetify.min.css" rel="stylesheet"> | |
</head> | |
<style> | |
#app { |
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
// ref: https://www.baeldung.com/java-aes-encryption-decryption | |
import java.util.* | |
import javax.crypto.Cipher | |
import javax.crypto.spec.IvParameterSpec | |
import javax.crypto.spec.SecretKeySpec | |
fun decrypt(algorithm: String, cipherText: String, key: SecretKeySpec, iv: IvParameterSpec): String { | |
val cipher = Cipher.getInstance(algorithm) |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDCCrz+f1uhAfo2HN6NPf7TuscgolKMZM3UK1G7zQvMjSASC6vRrgLdIWU/h3Wmg1OFJ3Xo/YW0l19Dw39T4caINRG+2JLY0u6QqyhBKrVjP5SNGUb6/+YgBQmuCg/bvaxvcjaFWWr26Bt2I7FnDnBn8yAgNtcbmCyIdGpysyIVhpMF4J6bBeVm5iQbe525buaHsvHrni5EIzCKUIeFAV30bAecHSQOu2VnFUuHiPDWk7PfPwkuZdlWgC13Nt8hl6a92nizm9UWhylJUGNwFcK8Mj9ul7fdM0QPjCPCFVimsrDVGo1l5DPE3g4l9HMK/PxQXHyPKpAI/3v2j2Hzar4ILen7z9DZ8zpQlvTLtsPEPwxAf7EP7UM8SkzbQKSyBd6+B8VgQM2XMn/DQ/YsbMfartZcYn+1y1hYSk6Ri1PJ3gNNvQ5876fp2MeyRq2dDojVRXn17giFH7JiTLrtFh9ABAg6UpZww/3HYkVUK+hmGU9Ll4E+cKcmleTxIeUIl4k= ruichaoma@ruichaoma-GE66-Raider-10SF |
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
1.为什么要进行跨域测试? | |
因为一些(跨域)的请求会被同源策略禁止,比如Ajax请求 | |
跨域资源共享(英语:Cross-origin resource sharing,缩写:CORS),用于让网页的受限资源能够被其他域名的页面访问的一种机制。 | |
主要原因是我想测试Lumen的Cors中间件(https://github.com/palanik/lumen-cors)。 | |
2.如何在本地环境进行测试? | |
谷歌浏览器(为什么是谷歌,因为我只用google浏览器)的开发者工具,打开console,输入以下JS代码 |
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
### NOT A SCRIPT, JUST A REFERENCE! | |
# install dante-server | |
sudo apt update | |
sudo apt install dante-server | |
# or download latest dante-server deb for Ubuntu, works for 16.04 / 18.04 / 20.04: | |
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/dante/dante-server_1.4.2+dfsg-7build3_amd64.deb | |
# or older version: | |
wget http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb |
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
// Website you intended to retrieve for users. | |
const upstream = 'api.openai.com' | |
// Custom pathname for the upstream website. | |
const upstream_path = '/' | |
// Website you intended to retrieve for users using mobile devices. | |
const upstream_mobile = upstream | |
// Countries and regions where you wish to suspend your service. |
OlderNewer