Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!
openssl genrsa -des3 -out rootCA.key 4096| curl --include \ | |
| --no-buffer \ | |
| --header "Connection: Upgrade" \ | |
| --header "Upgrade: websocket" \ | |
| --header "Host: example.com:80" \ | |
| --header "Origin: http://example.com:80" \ | |
| --header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \ | |
| --header "Sec-WebSocket-Version: 13" \ | |
| http://example.com:80/ |
| import logging | |
| import traceback | |
| import psycopg2 | |
| class PostgreSQLHandler(logging.Handler): | |
| """ | |
| A :class:`logging.Handler` that logs to the `log` PostgreSQL table | |
| Does not use :class:`PostgreSQL`, keeping its own connection, in autocommit | |
| mode. |
| function digito_verificador(random_cnpj, pesos) | |
| local table_check = {} | |
| for i, p in ipairs(pesos) do | |
| table_check[i] = random_cnpj[i] * p | |
| end | |
| local sum_check = 0 | |
| for i, p in ipairs(table_check) do | |
| sum_check = sum_check + p | |
| end |
A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.
Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).
| ; Postgres listen/notify in Clojure using http://impossibl.github.io/pgjdbc-ng/ | |
| ; in project.clj dependencies | |
| ; [com.impossibl.pgjdbc-ng/pgjdbc-ng "0.5"] | |
| (ns pglisten.core | |
| (:import [com.impossibl.postgres.jdbc PGDataSource] | |
| [com.impossibl.postgres.api.jdbc PGNotificationListener])) |
Delimited continuations manipulate the control flow of programs. Similar to control structures like conditionals or loops they allow to deviate from a sequential flow of control.
We use exception handling as another example for control flow manipulation and later show how to implement it using delimited continuations. Finally, we show that nondeterminism can also be expressed using delimited continuations.
| [[source]] | |
| name = "pypi" | |
| url = "https://pypi.org/simple" | |
| verify_ssl = true | |
| [dev-packages] | |
| pylint = "*" | |
| [packages] | |
| sqlalchemy = "*" |
| import asyncio | |
| import psycopg2 | |
| # dbname should be the same for the notifying process | |
| conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example") | |
| conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) | |
| cursor = conn.cursor() | |
| cursor.execute(f"LISTEN match_updates;") |