Skip to content

Instantly share code, notes, and snippets.

@Geczy
Geczy / readme.md
Last active June 6, 2025 15:36
Migrate Coolify to a new server
@franciscomvargas
franciscomvargas / json_comquotes.md
Last active October 15, 2023 18:56
JSON Quote Remover

JSON Quote Remover

Description

This Python function, json_comquotes, is a handy tool for preprocessing JSON data that contains unescaped quotes within string values. It takes a JSON string as input and transforms it by replacing the double and single quotes within the string values with alternative characters, allowing you to parse the JSON data without errors.

CLI Capability

Take a look into json_esquotes

Key Features:

  • Replaces double quotes " within string values with escaped double quotes \".
@ffeldhaus
ffeldhaus / pre_request.js
Last active July 14, 2024 00:22 — forked from dinvlad/pre_request.js
Auto-generate Google Access and ID tokens from a Service Account key and save it in Postman
/* This script auto-generates a Google OAuth token from a Service Account key,
* and stores that token in accessToken variable in Postman.
*
* Prior to invoking it, please paste the contents of the key JSON
* into serviceAccountKey variable in a Postman environment.
*
* Then, paste the script into the "Pre-request Script" section
* of a Postman request or collection.
*
* The script will cache and reuse the token until it's within
@yorickdowne
yorickdowne / HallOfBlame.md
Last active May 30, 2025 05:57
Great and less great SSDs for Ethereum nodes

Overview

Syncing an Ethereum node is largely reliant on latency and IOPS, I/O Per Second, of the storage. Budget SSDs will struggle to an extent, and some won't be able to sync at all. IOPS can roughly be used as proxy of / predictor for latency. Measuring latency directly is arguably better.

This document aims to snapshot some known good and known bad models.

The drive lists are ordered by interface and then by capacity and alphabetically by vendor name, not by preference. The lists are not exhaustive at all. @mwpastore linked a filterable spreadsheet in comments that has a far greater variety of drives and their characteristics. Filter it by DRAM yes, NAND Type TLC, Form Factor M.2, and desired capacity.

For size, 4TB is a very conservative choice. The smaller 2TB drive should last an Ethereum full node until at least sometime 2026, with [pre-merge history expiry](https://hackmd.io/@hBXHLw_9Qq2va4pRtI4bI

@nosilver4u
nosilver4u / ewwwio-adjust-sharpening.php
Last active March 23, 2023 23:48
EWWW IO adjust Sharpening functions/params.
<?php
/*
Plugin Name: EWWW IO Adjust Sharpening
Version: 1.0.0
*/
/*
* Valid options:
* 'FILTER_POINT',
* 'FILTER_BOX',
@yorickdowne
yorickdowne / GethBEHAVE.md
Last active January 17, 2025 17:36
Pruning Geth 1.10.x, 1.11.x, 1.12.x

Note: PBSS in Geth >=1.13.0 removes the need to prune manually.


Old content for reference

Overview

Geth (Go-Ethereum) as of July 2022 takes about 650 GiB of space on a fast/snap sync, and then grows by ~ 14 GiB/week with default cache, ~ 8 GiB/week with more cache.

@tschubotz
tschubotz / test_data.py
Last active March 5, 2024 05:01
Script to submit a number of Multisend transactions to a Gnosis Safe via the REST API
import argparse
import json
from random import randrange
from typing import List, Optional, Sequence
from urllib.parse import urljoin
import requests
from eth_account import Account
from eth_account.signers.local import LocalAccount
from hexbytes import HexBytes
@lorey
lorey / selenium_xhr_requests_via_performance_logging.py
Last active May 29, 2025 02:00
Access Chrome's network tab (e.g. XHR requests) with Selenium
#
# This small example shows you how to access JS-based requests via Selenium
# Like this, one can access raw data for scraping,
# for example on many JS-intensive/React-based websites
#
from time import sleep
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
@foliovision
foliovision / wp_is_mobile-wp-rocket.php
Created February 20, 2020 14:07
Make wp_is_mobile() use WP Rocket mobile detection
<?php
/*
Core WordPress function wp_is_mobile() detects iPad as mobile, so we filter it and use WP Rocket mobile detection
*/
add_filter( 'wp_is_mobile', 'fv_bra_wp_is_mobile' );
function fv_bra_wp_is_mobile( $is_mobile ) {
if ( class_exists( 'Rocket_Mobile_Detect' ) ) {
$detect = new Rocket_Mobile_Detect();
@wpcarro
wpcarro / retry_loop.py
Created October 29, 2019 17:37
Simple retry loop in python with error simulation.
import random
def danger():
if random.choice([True, False]):
raise Exception
def main():
"""Attempt to loop `loop_count` times. Simulate random errors and create a