Skip to content

Instantly share code, notes, and snippets.

@anomit
anomit / bds-dsv-devnet-onboarding.md
Created October 30, 2025 10:39
BDS DSV Devnet Onboarding Guide

🚀 BDS DSV Devnet Onboarding Guide

Attribute Details
Last Updated October 30, 2025
Target Audience Existing mainnet snapshotter operators
Prerequisites Familiarity with snapshotter operations

import websockets
import asyncio
import json
import async_timeout
import sys
async def consumer_contract(retries_before_quitting=10):
counter = 0
async with websockets.connect(sys.argv[1]) as ws:
@anomit
anomit / app mailers queue_deliver_mailer.rb
Last active August 29, 2015 13:59
Hacking Rails mail delivery for an async solution with Sidekiq, Redis, Local Postfix SMTP server
class QueueDeliveryMailer < ActionMailer::Base
self.delivery_method = Rails.application.config.mail_queue_outbound_delivery_method #remember this from development.rb
layout nil
def rebuild_mail(id)
mail({:from => $redis.get("mail:#{id}:sender_address"),
:to => $redis.get("mail:#{id}:recipient_address"),
:reply_to => $redis.get("mail:#{id}:reply_to_address"),
:mime_version => $redis.get("mail:#{id}:mime_version"),
:content_type => $redis.get("mail:#{id}:content_type"),
"""
This script writes the VDSO to the file linux-gate.dso.1 .
Use `objdump -d linux-gate.dso.1` to examine it.
You might also want to play around more with the other objdump options and
the readelf tool :)
LICENSE: MIT License ( http://www.opensource.org/licenses/mit-license.php )
"""
from __future__ import with_statement
import os
"""
Sorting nodes of a graph according to their degrees
Idea from: http://mail.python.org/pipermail/python-list/2002-July/152876.html
"""
#example adjacency list
adjlist = {'a':['b','c','d'],'b':['a','d'],'c':['a'],'d':['b','a']}
histogram = [ (len(value), key) for key, value in adjlist.iteritems() ]
histogram.sort()