国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
DELIMITER $$ | |
DROP function if exists json_extract_c$$ | |
CREATE FUNCTION json_extract_c( | |
details TEXT, | |
required_field VARCHAR (255) | |
) RETURNS TEXT CHARSET utf8mb4 | |
DETERMINISTIC | |
NO SQL | |
BEGIN | |
DECLARE search_term, val TEXT; |
(cors) { | |
@cors_preflight{args.0} method OPTIONS | |
@cors{args.0} header Origin {args.0} | |
handle @cors_preflight{args.0} { | |
header { | |
Access-Control-Allow-Origin "{args.0}" | |
Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS" | |
Access-Control-Allow-Headers * | |
Access-Control-Max-Age "3600" |
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
# This is a demonstration of how to do fingerprint-based certificate | |
# validation in Python, in the style of OpenConnect: | |
# https://gitlab.com/openconnect/openconnect/-/blob/HEAD/library.c#L1084-1143 | |
# | |
# For Python <3.7, we monkey-patch ssl.SSLSocket directly, because ssl.SSLContext.sslsocket_class | |
# isn't available until Python 3.7. For Python 3.7+, we set ssl.SSLContext.sslsocket_class | |
# to our modified version (which is sort of monkey-patching too). |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
package demo; | |
import java.io.Serializable; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.LinkedHashMap; | |
import java.util.List; |
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
# newer versions of the distribution. | |
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted | |
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted | |
## Major bug fix updates produced after the final release of the | |
## distribution. | |
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted | |
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted |
# First install prometheus-operator: | |
# | |
# helm install coreos/prometheus-operator --name prometheus-operator | |
# | |
apiVersion: monitoring.coreos.com/v1 | |
kind: ServiceMonitor | |
metadata: | |
name: node-exporter | |
# Namespace of prometheus operator |
version: "3" | |
networks: | |
kong-net: | |
driver: bridge | |
services: | |
####################################### | |
# Postgres: The database used by Kong |
Cloud-Init is the defacto multi-distribution package that handles early initialization of a virtual machine instance. Using Cloud-Init, one can configure network
Non-fungible tokens (NFTs) are all the rage these days, but their current manifestation (ERC721) is inefficient. It is not possible to move multiple tokens at the same time or package multiple tokens for e.g. deposit into a plasma child chain.
The following is a new design for an NFT token that allows aggregation of assets. The rest of the functionality can be inherited from ERC721.
contract NFT {
tokens mapping(address => mapping(bytes32 => uint));