Сервер на aiohttp, который стримит текущее серверное время.
Как запустить:
python server.py
Откройти в браузере страницу http://127.0.0.1:8080/, на ней отобразится время. Каждую секунду будет добавляться новая запись о времени:
version: "3.6" | |
services: | |
promtail: | |
image: grafana/promtail:1.4.0 | |
container_name: promtail | |
command: [ "-config.file=/etc/promtail/local-config.yaml" ] | |
volumes: | |
- './promtail.yml:/etc/promtail/local-config.yaml:ro' | |
- '__path_to_logs_directory__:/app/log:ro' |
Сервер на aiohttp, который стримит текущее серверное время.
Как запустить:
python server.py
Откройти в браузере страницу http://127.0.0.1:8080/, на ней отобразится время. Каждую секунду будет добавляться новая запись о времени:
#!/usr/bin/env python3 | |
# | |
# Limits the maximal virtual memory for a subprocess in Python. | |
# | |
# Linux only. | |
# | |
import subprocess | |
import resource |
upload(files) { | |
const config = { | |
onUploadProgress: function(progressEvent) { | |
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total) | |
console.log(percentCompleted) | |
} | |
} | |
let data = new FormData() | |
data.append('file', files[0]) |
See this issue.
Docker best practise to Control and configure Docker with systemd.
Create daemon.json
file in /etc/docker
:
{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
from selenium import webdriver | |
import sys, getopt, time, subprocess, shlex | |
from xvfbwrapper import Xvfb | |
def run(): | |
print('Sreencast website animation') | |
xvfb = Xvfb(width=1280, height=720, colordepth=24) | |
xvfb.start() |
import platform | |
import unittest | |
from http import HTTPStatus | |
from urllib.parse import urlencode, unquote | |
import aiohttp | |
import asynctest | |
from aiohttp import web | |
from aiohttp.test_utils import TestClient | |
from multidict import MultiDict |
/******************************************************************************* | |
* Copyright (c) 2017 Nicola Del Gobbo | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
* use this file except in compliance with the License. You may obtain a copy of | |
* the license at http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS | |
* OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY | |
* IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | |
* MERCHANTABLITY OR NON-INFRINGEMENT. |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>DatePicker Example</title> | |
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> | |
<script src="//code.jquery.com/jquery-1.10.2.js"></script> | |
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> | |
<script> |
<html> | |
<head> | |
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" /> | |
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script> | |
<script src="//cdn.rawgit.com/chjj/term.js/0b10f6c55d5113d50d0ff94b6c38a46375a5f9a5/src/term.js"></script> | |
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> |