See this issue.
Docker best practise to Control and configure Docker with systemd.
-
Create
daemon.jsonfile in/etc/docker:{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
| #!/bin/bash | |
| TODAY=$(date +%Y%m%d) | |
| TARGETS=( '/etc' '/home' '/root' '/var/www' ) | |
| BACKUP_ROOT='/backups' | |
| BACKUP_DIR="${BACKUP_ROOT}/${TODAY}" | |
| echo "$(date +%D" "%r): Beginning backup" | |
| mkdir -p $BACKUP_DIR | |
| for i in ${TARGETS[@]}; do |
| # extract all urls from a text file | |
| cat file.txt | egrep -o 'https?://[^ ]+' | sed -e 's/https/http/g' | sed -e 's/\W+$//g' | sort | uniq -c | sort -bnr | |
| # extraxt domains from URL's found in text files | |
| cat file.txt | egrep -o 'https?://[^ ]+' | sed -e 's/https/http/g' | sed -e 's/\W+$//g' | sed -e 's/http:\/\///g' | sed -e 's/\/.*$//g' | sort | uniq -c | sort -bnr | |
| # extract email addresses | |
| cat file.txt | grep -i -o '[A-Z0-9._%+-]\+@[A-Z0-9.-]\+\.[A-Z]\{2,4\}' | sort | uniq -c | sort -bnr | |
| # list all words in a text file |
| #include <array> | |
| #include <tuple> | |
| #include <type_traits> | |
| #include <utility> | |
| namespace cdict { | |
| template<char... cs> | |
| using string = std::integer_sequence<char, cs...>; |
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"]}
| $ curl --dump-header - localhost:12345 | |
| HTTP/1.0 404 Not Found | |
| Content-Type: text/html | |
| Content-Length: 43 | |
| Date: Fri, 05 Dec 2014 17:48:56 +0000 | |
| <html> | |
| <body> | |
| <h1>WUT</h1> | |
| </html> |
| # Inspired from https://stackoverflow.com/questions/32183975/how-to-print-all-the-properties-of-a-target-in-cmake | |
| # Get all propreties that cmake supports | |
| execute_process(COMMAND cmake --help-property-list OUTPUT_VARIABLE CMAKE_PROPERTY_LIST) | |
| # Convert command output into a CMake list | |
| STRING(REGEX REPLACE ";" "\\\\;" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}") | |
| STRING(REGEX REPLACE "\n" ";" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}") | |
| # Prints the given property of the given target. |
AmbientCapabilities support (usually kernel >= linux4.3) [Unit]
Description=FRP Server Daemon
| #!/usr/bin/env python | |
| import yaml | |
| import sys | |
| for manifest in yaml.load_all(sys.stdin): | |
| if manifest: | |
| if 'metadata' in manifest and 'namespace' not in manifest['metadata']: | |
| manifest['metadata']['namespace'] = sys.argv[1] | |
| print '---' |
##分布式系统(Distributed System)资料
介绍:这是一篇介绍在动态网络里面实现分布式系统重构的paper.论文的作者(导师)是MIT读博的时候是做分布式系统的研究的,现在在NUS带学生,不仅仅是分布式系统,还有无线网络.如果感兴趣可以去他的主页了解.
| #!/bin/sh | |
| if pwd | grep /mnt/c > /dev/null; then | |
| exec git.exe "$@" | |
| else | |
| exec /usr/bin/git "$@" | |
| fi |