Scripts to confgire a group of hosts on a LAN to use VXLAN over Wireguard.
from requests.adapters import HTTPAdapter, Retry | |
from requests import Session | |
retries = Retry( | |
total=5, backoff_factor=1, status_forcelist=[502, 503, 504] | |
) | |
session = Session() # reuse tcp connection | |
session.mount("http://", HTTPAdapter(max_retries=retries)) | |
session.mount("https://", HTTPAdapter(max_retries=retries)) |
#include <time.h> // Robert Nystrom | |
#include <stdio.h> // @munificentbob | |
#include <stdlib.h> // for Ginny | |
#define r return // 2008-2019 | |
#define l(a, b, c, d) for (i y=a;y\ | |
<b; y++) for (int x = c; x < d; x++) | |
typedef int i;const i H=40;const i W | |
=80;i m[40][80];i g(i x){r rand()%x; | |
}void cave(i s){i w=g(10)+5;i h=g(6) | |
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
#!/usr/bin/env python | |
import tkinter as tk | |
import math | |
import re | |
from collections import ChainMap | |
Nrows = 5 | |
Ncols = 5 |
| Title | Description
#listens to the above run to | |
#FLASK_APP=server.py FLASK_DEBUG=1 python3.5 -m flask run -h 192.168.1.124 -p 8999: | |
#run this on the local server to listen to socket communication | |
from flask import Flask, render_template, jsonify | |
from flask import request as query | |
app = Flask(__name__) | |
Looping over a tuple is faster than looping over a list in Python2
In Python2:
In [1]: def loop_list():
...: for i in [1, 2, 3]:
...: pass
...:
In [2]: def loop_tuple():
# 生成 dhparam.pem 文件, 在命令行执行任一方法: | |
# 方法1: 很慢 | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 | |
# 方法2: 较快 | |
# 与方法1无明显区别. 2048位也足够用, 4096更强 | |
openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096 |
There aren't many tutorials about this, the only tutorials I've found were about passing through entire PCIe cards to VMs, or refered to old ESXI versions (below 6.5) that used a more comprehensive desktop client instead of the web app. In v6.5, the web app was introduced and the desktop client was deprecated. You used to be able to setup RDMs in the desktop client, but with the introduction of the web console, this is no longer the case. This tutorial shows you how to pass SATA HDDs to the virtual machine on VMWare ESXI 6.5. This tutorial is partially based on VMWare's own KB and the now deprecated Forza IT blog post.
There is now an option while editing your VM's settings to add a New raw disk
when you click `Add ha
diff --git a/src/ngx_stream_lua_socket_tcp.c b/src/ngx_stream_lua_socket_tcp.c | |
index 4680811..4da1ac6 100644 | |
--- a/src/ngx_stream_lua_socket_tcp.c | |
+++ b/src/ngx_stream_lua_socket_tcp.c | |
@@ -88,6 +88,7 @@ static int ngx_stream_lua_socket_write_error_retval_handler( | |
ngx_stream_session_t *s, ngx_stream_lua_socket_tcp_upstream_t *u, | |
lua_State *L); | |
static ngx_int_t ngx_stream_lua_socket_read_all(void *data, ssize_t bytes); | |
+static ngx_int_t ngx_stream_lua_socket_read_partial(void *data, ssize_t bytes); | |
static ngx_int_t ngx_stream_lua_socket_read_until(void *data, ssize_t bytes); |