Falcon 3.0 Roadmap
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
# Credit: https://www.kik.com/blog/using-lua-to-extend-nginx-configuration/ | |
worker_processes auto; # process per cpu | |
worker_rlimit_nofile 8192; | |
events { | |
worker_connections 65536; | |
} | |
http { | |
# https://t37.net/nginx-optimization-understanding-sendfile-tcp_nodelay-and-tcp_nopush.html |
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
# See also: | |
# | |
# * https://asgi.readthedocs.io/en/latest/specs/www.html#websocket | |
# * https://developer.mozilla.org/en-US/docs/Web/API/Websockets_API | |
# | |
import falcon.asgi | |
import falcon.media | |
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
def get_unused_port(): | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.bind(('localhost', 0)) | |
_, port = sock.getsockname() | |
sock.close() | |
return port |
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
import datetime | |
from enum import Enum | |
import socket | |
import ssl | |
import certifi | |
class CertificateStatus(Enum): | |
UNKNOWN = -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
const scrollingElement = document.scrollingElement | |
const viewport_height = scrollingElement.clientHeight | |
for (let pos = 0; pos < scrollingElement.scrollHeight; pos += viewport_height) { | |
scrollBy(0, viewport_height) | |
} |
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 bash | |
# This script lists all ip ranges currently used by | |
# the google cloud platform, according to ns-lookup / dig | |
# TXT _cloud-netblocks.googleusercontent.com | |
# | |
# https://cloud.google.com/compute/docs/faq#find_ip_range | |
errcho() { | |
>&2 echo "$@" |
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
import cgi | |
# NOTE: This does not handle file uploads | |
def parse_form(req): | |
# NOTE: See also the docs for cgi.FieldStorage | |
form = cgi.FieldStorage(fp=req.stream, environ=req.env, | |
keep_blank_values=1) | |
if not form.list: | |
return {} |
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
- name: Add ELRepo | |
yum: | |
name: https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm | |
state: latest | |
- name: Install latest mainline kernel | |
yum: | |
name: kernel-ml | |
state: latest | |
enablerepo: elrepo-kernel | |
- name: Remake grub config to pick up new kernel |
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
- name: Restart server to ensure configuration changes take hold | |
shell: 'sleep 2 && shutdown -r now "Reboot triggered by Ansible" && sleep 5' | |
async: 1 | |
poll: 0 | |
become: true | |
- name: Wait for the server to restart | |
local_action: | |
module: wait_for | |
host={{ inventory_hostname }} | |
port=22 |