-
安裝redis
sudo apt update -y sudo apt-get install libclang-dev -y # reload daemon first sudo systemctl daemon-reload
This file contains hidden or 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
# This file is auto-generated by openmediavault (https://www.openmediavault.org) | |
# WARNING: Do not edit this file, your changes will get lost. | |
server { | |
server_name nas.daedalus.cc; # managed by Certbot | |
root /var/www/openmediavault; #綁對應路徑 | |
index index.html; | |
autoindex off; | |
server_tokens off; | |
sendfile on; | |
large_client_header_buffers 4 32k; |
This file contains hidden or 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
server { | |
server_name dock.daedalus.cc; | |
proxy_connect_timeout 300; | |
proxy_send_timeout 300; | |
proxy_read_timeout 300; | |
send_timeout 300; | |
listen 443 ssl; # managed by Certbot |
This file contains hidden or 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
#include <Keyboard.h> | |
const int BTN2_PIN = 2; // input pin for pushbutto | |
const int BTN3_PIN = 3; // input pin for pushbutton | |
int btn2_prevState; //紀錄按紐2上次一次狀態 | |
int btn3_prevState; //紀錄按紐3上次一次狀態 | |
This file contains hidden or 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
#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE //一定要在 spdlog.h 之前定義 | |
#include <spdlog/spdlog.h> | |
#include <spdlog/async.h> | |
#include <spdlog/sinks/stdout_color_sinks.h> | |
#include <spdlog/sinks/daily_file_sink.h> | |
int main(){ | |
// 清掉已註冊logger | |
spdlog::drop_all(); |
This file contains hidden or 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
/* | |
* File: sockets.h | |
* Author: Will Eccles | |
* Date: 2020-03-12 | |
* | |
* 1. Description | |
* | |
* This header attempts to make it easy to use sockets across platforms, | |
* for both Windows and POSIX systems. While Winsock is often somewhat | |
* compatible with Berkeley sockets, it is not strictly compatible, |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import logging | |
import logging.config | |
import os | |
import config | |
LOGGING_CONFIG = { | |
"version": 1, |
This file contains hidden or 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
COMPOSE_PROJECT_NAME=myproject | |
# Redis | |
REDIS_HOSTNAME=redisdb.local | |
REDIS_PORT=6379 | |
REDIS_PASSWORD= | |
# Rabbitmq | |
RABBITMQ_HOSTNAME=rabbitmq.local | |
RABBITMQ_USERNAME=root |
This file contains hidden or 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
""" | |
client.py - AsyncIO Server using StreamReader and StreamWriter | |
This will create 200 client connections to a server running server.py | |
It will handshake and run similar to this: | |
Server: HELLO | |
Client: WORLD |
OlderNewer