sysctl -w net.ipv4.ip_forward=1
or
echo 1 > /proc/sys/net/ipv4/ip_forward
/etc/sysctl.conf:
net.ipv4.ip_forward = 1
/* Checks the state of a Promise without need to wait for a non-pending result | |
* | |
* This is an issue, because the state of a Promise object is inaccessible from | |
* JavaScript, so we are unable to take actions based on the current state of | |
* a Promise being pending or not | |
*/ | |
const PROMISE_STATE_PENDING = Symbol() | |
async function promiseState(prom) { | |
try { | |
const result = await Promise.race([prom, Promise.resolve(PROMISE_STATE_PENDING)]) |
// ==UserScript== | |
// @name RedditHider | |
// @namespace https://www.reddit.com | |
// @version 0.2 | |
// @description Hide Reddit main page when a thread is opened | |
// @author Ricky Cook | |
// @include https://www.reddit.com/* | |
// @grant none | |
// @updateURL https://gist.githubusercontent.com/RickyCook/72fc3a971a638b10864d98ffe3fc2ffd/raw/main.js | |
// ==/UserScript== |
defmodule Notifier.Webhook.App do | |
use Application | |
require Logger | |
def start(_type, _args) do | |
Logger.debug("App.start") | |
import Supervisor.Spec | |
children = [ | |
supervisor(Notifier.Webhook.Worker, []), |
#!/usr/bin/env python3 | |
import unittest | |
CONTINUATION_HIGH_BITS = 0b10 | |
CONTINUATION_SHIFT_RIGHT = 8 - CONTINUATION_HIGH_BITS.bit_length() | |
def is_continuation(byte): | |
return byte >> CONTINUATION_SHIFT_RIGHT == CONTINUATION_HIGH_BITS |
#!/usr/bin/env python3 | |
import sys | |
from copy import deepcopy | |
from pprint import pprint | |
class Decoder(object): | |
def __init__( |
# CodePipeline doesn't support symlinks. They are reflected on | |
# disk as their target path in the file contents. | |
check_content_path = True | |
while check_content_path: | |
content = sql_path.read_text() | |
try: | |
new_sql_path = sql_path.parent.joinpath(content) | |
if new_sql_path.exists(): | |
sql_path = new_sql_path | |
else: |
const TIMEOUT_MS = 2000; | |
const FSM_DEF = { | |
id: 'tokenRequest', | |
initial: 'timing', | |
context: { | |
payload: { statusCode: 500, body: '{"error":"Unknown error [init]"}'}, | |
}, | |
states: { | |
timing: { |
// sortedHashes = ['a', 'b', 'c', 'd', 'e', ...] | |
// doneRaces = [['a', 'c'], ['c', 'e'], ['a', 'b'], ...] | |
function getNewVoteRace(sortedHashes, doneRaces) { | |
let firstHash; | |
let secondIdxMax; | |
let secondTotalOpts; | |
let secondBlacklist; | |
while(_.isNil(secondIdxMax) || secondBlacklist.length >= secondTotalOpts) { |