Skip to content

Instantly share code, notes, and snippets.

Synchronized Output

Synchronized output is merely implementing the feature as inspired by iTerm2 synchronized output, except that it's not using the rare DCS but rather the well known SM ? and RM ?. iTerm2 has now also adopted to use the new syntax instead of using DCS.

Semantics

When rendering the screen of the terminal, the Emulator usually iterates through each visible grid cell and renders its current state. With applications updating the screen a at higher frequency this can cause tearing.

This mode attempts to mitigate that.

import tarfile
import hashlib
import os
import sys
import requests
import io
def compute_hash(tar_path, is_url=False):
if is_url:
response = requests.get(tar_path)
// Luuk's bf jit, but for macos
// Changes: syscalls and page alignment of mmap size input
// Original: https://github.com/Luukdegram/bfj
const std = @import("std");
const os = std.os;
const mem = std.mem;
const Allocator = mem.Allocator;
const page_size = std.mem.page_size;

Increasing max open file descriptors on a Droplet w/Ubuntu

Add session required pam_limits.so to these two files:

/etc/pam.d/common-session
/etc/pam.d/common-session-noninteractive

Next, edit

Below is a sample /etc/nginx/sites-available/default configuration for using nginx as a reverse proxy for the Nano Pow Server
When doing this on a VPS, it's almost always necessary to increase the maximum open file limit.
Replace port numbers, backend host/ip and domain names as necessary.
======================= /etc/nginx/sites-available/default =======================
server {
[node]
# Limits number of active elections before dropping will be considered (other conditions must also be satisfied)
# type:uint64,[250..]
active_elections_size = 50000
# Enable or disable local host peering
# type:bool
allow_local_peers = false
diff --git a/rai/node/node.cpp b/rai/node/node.cpp
index b9f5681e..caaae4e0 100644
--- a/rai/node/node.cpp
+++ b/rai/node/node.cpp
@@ -1966,13 +1966,13 @@ void rai::node::stop ()
{
block_processor_thread.join ();
}
+ vote_processor.stop ();
active.stop ();
{
"quorum_delta": "45422617064212959417758022394180207600",
"online_weight_quorum_percent": "50",
"online_weight_minimum": "60000000000000000000000000000000000000",
"online_stake_total": "90845234128425918835516044788360415294",
"peers_stake_total": "17351372919081579466355701326973505015",
"peers": {
"xrb_3dmtrrws3pocycmbqwawk6xs7446qxa36fcncush4s1pejk16ksbmakis78m": "9107808973691359711944923976215362496",
"xrb_1anrzcuwe64rwxzcco8dkhpyxpi8kd7zsjc1oeimpc3ppca4mrjtwnqposrs": "2317507666652655328321497869190058609",
"xrb_3rropjiqfxpmrrkooej4qtmm1pueu36f9ghinpho4esfdor8785a455d16nf": "1901034891075657677525740819617843472",
[2018-09-20 20:54:42.895820]: Resolving fork between our block: ED9A348EE0F8D2B74610FBE1B9E94A141EF17D5B3C219811B3C6747C9D826B2C and block 8D3037DF2EF47016DE84B67CDFCA146AB9ECF4917F8A0D71686C372EA22B8376 both with root F0F25D2F29BBE4EECD7D9F96F403BBC8D0A4CFD5B99F3B06939456CB91953B8C
[2018-09-20 20:54:42.896728]: Broadcasting confirm req for block ED9A348EE0F8D2B74610FBE1B9E94A141EF17D5B3C219811B3C6747C9D826B2C to 267 representatives
[2018-09-20 20:54:42.974217]: Block 8D3037DF2EF47016DE84B67CDFCA146AB9ECF4917F8A0D71686C372EA22B8376 was republished to peers
[2018-09-20 20:54:45.453918]: 77 blocks in processing queue
[2018-09-20 20:54:46.476194]: Found a representative at [::ffff:94.16.114.235]:7075
[2018-09-20 20:54:46.478143]: Found a representative at [::ffff:165.227.233.79]:7075
[2018-09-20 20:54:50.326676]: Block C4933C189C21B73C1A89DC16817D762B87863A0A5D74B94A8E5BC1074B12FF97 was republished to peers
[2018-09-20 20:54:50.327653]: Block 48242179C99309ADBA050978D5619F10EC5779B25BEA2DD2BC81C6298E20E84B was r