Skip to content

Instantly share code, notes, and snippets.

Avatar

Sander sanderfoobar

  • Sofia, Bulgaria
View GitHub Profile
View debounce.h
// from: https://raw.githubusercontent.com/juangburgos/QFunctionUtils/master/src/qfunctionutils.h
// usage:
//
// std::function<void()> new_func = Debounce([=]{
// qDebug() << "fired";
// }, 500);
//
// new_func();
// new_func();
@sanderfoobar
sanderfoobar / monero_rpc_i2p.md
Last active Oct 28, 2020
Host an I2P monerod node
View monero_rpc_i2p.md

Hosting a Monero p2p node on I2P

This document serves as a small tutorial for new and/or existing Monero node operators who wish to support I2P users by allowing their nodes to communicate p2p through I2P.

You should be able to get through this document and host an I2P node in ~20 minutes.

Requirements:

  • Linux system, can be behind a firewall (i.e: home network)
  • Latest monero (CLI) release: link
@sanderfoobar
sanderfoobar / flask_oidc.py
Last active Jul 9, 2020
Keycloak + flask simple login example
View flask_oidc.py
"""
$ pip install requests flask flask-session
Please note you will need a `CLIENT_ID` and `CLIENT_SECRET`.
Keycloak's access type set to 'confidential'
dsc@xmr.pm
"""
@sanderfoobar
sanderfoobar / rpc_bandwidth.md
Last active Jun 30, 2019
Monero RPC node bandwidth monitoring
View rpc_bandwidth.md

In this document, $YOUR_IP refers to your public ip address.

Keeping track of bandwidth for Monero RPC nodes

First, we must make a clear distinction between RPC traffic and P2P traffic. As a node operator you might think "wow my node is doing so much traffic WTF where are all these bytes coming from and going to". Well, this is actually due to your P2P port being exposed, which is port 18080. This document does not cover the monitoring of P2P traffic. This document is specifically for the RPC port which runs on 18081 (or 18089).

As Monero RPC traffic is HTTP, we can use nginx to reverse proxy and record bandwidth passing through. This implies that monerod's RPC port stays on localhost

Where normally we would use:

@sanderfoobar
sanderfoobar / CMakeLists.txt
Created Jun 5, 2019
CMake recipe monero GUI
View CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(monero-gui C CXX)
message(STATUS "Initiating compile using CMake ${CMAKE_VERSION}")
set(STATIC OFF)
set(DEBUG ON)
set(CMAKE_BUILD_TYPE Debug)
# GUI
View nana.diff
diff --git a/src/http/ngx_http_header_filter_module.c b/src/http/ngx_http_header_filter_module.c
index 9b894059..dd1a7ffd 100644
--- a/src/http/ngx_http_header_filter_module.c
+++ b/src/http/ngx_http_header_filter_module.c
@@ -53,7 +53,21 @@ static u_char ngx_http_server_build_string[] = "Server: " NGINX_VER_BUILD CRLF;
static ngx_str_t ngx_http_status_lines[] = {
- ngx_string("200 OK"),
+ ngx_string(u8"200 NANANANAANANANA OK "
View recompile_static_deb.sh
sudo apt-get build-dep
apt-get source [...]
cd [...]
DEB_CFLAGS_APPEND="-fPIC" DEP_CXXFLAGS_APPEND="-fPIC" DEB_CPPFLAGS_APPEND="-fPIC" dpkg-buildpackage -B -us -uc -j3 -rfakeroot
View keybase.md

Keybase proof

I hereby claim:

  • I am xmrdsc on github.
  • I am xmrdsc (https://keybase.io/xmrdsc) on keybase.
  • I have a public key whose fingerprint is 2862 2D20 C1CA 773F EED0 C8EC E29D FFCD D83E 51A6

To claim this, I am signing this object:

View tcpdump_to_wireshark.sh
ssh -p 22 root@192.xxx.xx.x sudo tcpdump -i xxxx -U -w - not port 5900 | wireshark -i - -k
View monero-gui_authors.py
#!/usr/bin/python3
import sys
import os
from random import shuffle
from collections import OrderedDict
if not sys.version_info >= (3, 0):
print("python3 only")
sys.exit()