Skip to content

Instantly share code, notes, and snippets.

View sanderfoobar's full-sized avatar

Sander sanderfoobar

  • City 17
View GitHub Profile
@sanderfoobar
sanderfoobar / hax.gs
Created June 13, 2023 14:02
discord chat to python server CTF
// ==UserScript==
// @name Discord Greasemonkey XHR to server
// @version 1
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @grant GM_xmlhttpRequest
// @grant GM_log
// @match https://discord.com/*
// ==/UserScript==
(function () {
#!/usr/bin/python3
# IRC channel Bulgarian->English translation
# pip install bottom kotki -v
import re, time, logging, asyncio, os
import bottom, kotki
IRC_NICK = "bgen"
IRC_HOST = "localhost"
IRC_PORT = 6667
IRC_TLS = False
@sanderfoobar
sanderfoobar / debounce.h
Last active July 25, 2022 02:43
Qt5 debounce
// 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 January 29, 2023 20:00
Host an I2P monerod node

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 / CMakeLists.txt
Created June 5, 2019 00:46
CMake recipe monero GUI
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
@sanderfoobar
sanderfoobar / nana.diff
Created April 18, 2019 19:22
nananana nginx
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 "
@sanderfoobar
sanderfoobar / recompile_static_deb.sh
Created February 23, 2019 06:03
recompile .deb static
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
@sanderfoobar
sanderfoobar / rpc_bandwidth.md
Last active June 30, 2019 14:58
Monero RPC node bandwidth monitoring

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:

ssh -p 22 root@192.xxx.xx.x sudo tcpdump -i xxxx -U -w - not port 5900 | wireshark -i - -k
#!/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()