国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Ubuntu 16.04+、Debian 8+、CentOS 7+
#!/bin/sh | |
trap cleanup EXIT | |
# green="\e[1;32m" | |
# red="\e[1;31m" | |
# reset="\e[0m" | |
green=$(tput setaf 64); | |
red=$(tput setaf 124); | |
reset=$(tput sgr0); |
FROM adminer:4.8.0 | |
# WATCH OUT WHEN UPGRADING, THE SED BELOW MIGHT STOP WORKING | |
USER root | |
RUN apk add autoconf gcc g++ make libffi-dev openssl-dev | |
RUN pecl install mongodb | |
RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/docker-php-ext-mongodb.ini | |
# MongoDB allows connections without password. | |
# But that doesn't fly with Adminer which prints 'Database does not support password.' for such case. |
#!/bin/bash | |
# ~/.local/etc/colors | |
# Wed Jan 21 19:04:30 PST 2015 yesmar@gmail.com | |
# Colorized output using tput(1). This script falls back to using ANSI escape | |
# codes if tput(1) is unavailable. All color names have been sourced from | |
# http://www.december.com/html/spec/colorhex.html | |
# shellcheck disable=SC2034 |
version: '3' | |
services: | |
db: | |
image: postgres:13 | |
environment: | |
POSTGRES_PASSWORD: sentry | |
POSTGRES_USER: sentry | |
POSTGRES_DB: sentry | |
networks: | |
- sentry-network |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Ubuntu 16.04+、Debian 8+、CentOS 7+
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice | |
stun: | |
stun.l.google.com:19302, | |
stun1.l.google.com:19302, | |
stun2.l.google.com:19302, | |
stun3.l.google.com:19302, | |
stun4.l.google.com:19302, | |
stun.ekiga.net, | |
stun.ideasip.com, |
// https://blog.logrocket.com/build-video-streaming-server-node/ | |
router.get('/video/:id', (req, res) => { | |
const videoPath = `assets/${req.params.id}.mp4`; | |
const videoStat = fs.statSync(videoPath); | |
const fileSize = videoStat.size; | |
const videoRange = req.headers.range; | |
if (videoRange) { | |
const parts = videoRange.replace(/bytes=/, "").split("-"); | |
const start = parseInt(parts[0], 10); | |
const end = parts[1] |
const link = window.prompt("Enter URL"); | |
fetch("http://127.0.0.1:6800/jsonrpc", { | |
method: "POST", | |
headers: { | |
"content-type": "application/x-www-form-urlencoded" | |
}, | |
body: JSON.stringify({ | |
jsonrpc: "2.0", | |
id: "someID", | |
method: "aria2.addUri", |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>Peer-to-Peer Cue System --- Reciever</title> | |
<style> | |
body { | |
font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif; |
const zlib = require('zlib'); | |
async function deflate(data) { | |
const encoder = new TextEncoder(); | |
const input = encoder.encode(data); | |
const deflatedChunks = []; | |
const compressionStream = new CompressionStream('deflate'); | |
const writableStream = new WritableStream({ | |
write(chunk) { |