Skip to content

Instantly share code, notes, and snippets.

@movitto
movitto / txs_by_result.rb.diff
Created May 8, 2020
xrp1ntel - TXs By Result: Critical Results Patch
View txs_by_result.rb.diff
diff --git a/lib/wipple/metrics/txs_by_result.rb b/lib/wipple/metrics/txs_by_result.rb
index 10c5f7c..5badc0d 100644
--- a/lib/wipple/metrics/txs_by_result.rb
+++ b/lib/wipple/metrics/txs_by_result.rb
@@ -3,6 +3,8 @@ module Wipple
class TxsByResult
include BaseMetric
+ CRITICAL_RESULTS = ['tecINVARIANT_FAILED']
+
@movitto
movitto / bench.rb
Created Oct 21, 2019
Simple Ruby Benchmark Class
View bench.rb
require 'xrbp'
class Benchmark
def initialize(max=1000)
@max = max
@snapshots = []
end
def capture!(n=1)
@snapshots << [n, Time.now]
@movitto
movitto / xrpl-dash1.html
Created Oct 9, 2019
Prototype XRPL Node Dashboard Concept - Utilitzing consensus subscription patch
View xrpl-dash1.html
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
<script type="application/javascript" src="ripple-1.3.3-min.js"></script>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="https://d3js.org/d3.v4.js"></script>
<!-- -->
@movitto
movitto / lvd.sh
Created Aug 28, 2019
Remove all LVM Snapshots with a certain prefix
View lvd.sh
#!/bin/bash
# Remove all LVM Snapshots
# Set executable: chmod +x lvmbak.sh
VG="dnp00" # LVM volume group we are snapshoting
BACKUP_PREFIX="dnv1-snap-" # Prefix of snapshot volume name.
/sbin/lvs -o lv_name --noheadings | sed -n "s@$BACKUP_PREFIX@@p" | while read DATE; do
if [ "$DATE" ]; then
@movitto
movitto / lvmbak.sh
Last active Aug 23, 2019
Take LVM snapshot / cycle old ones out at specified interval
View lvmbak.sh
#!/bin/bash
# Take LVM snapshot / cycle old ones out at specified interval
# Set executable: chmod +x lvmbak.sh
# Make sure to setup sudo correctly:
# # visudo
# <USER> ALL= NOPASSWD: /sbin/lvcreate
# <USER> ALL= NOPASSWD: /sbin/lvremove
# <USER> ALL= NOPASSWD: /sbin/lvs
@movitto
movitto / xrptipbot.vue
Last active Jul 25, 2019
Embedding xrptipbot in a vuejs application
View xrptipbot.vue
// VueJS does not permit <script> tags to be embedded in component templates
// Inorder to embed the xrptipbot widget (as described here: https://www.xrptipbot.com/account/embed):
// Add the following to your vuejs component template (make sure to change the tip receipient!):
<div id="xrptipbot">
<a amount="5.00" size="175" to="DevNullProd" network="twitter" href="https://www.xrptipbot.com" target="_blank"></a>
</div>
// Then add / extend the component 'mounted' hook to add the script:
mounted : function(){
@movitto
movitto / rippled.rpm.sh
Last active May 19, 2019
Commands needed to build the rippled RPM on a fresh CentOS 7 install
View rippled.rpm.sh
# Setup rippled RPM build environemnt on CentOS
# From a fresh CentOS install
# Update system, reboot
sudo yum update
sudo reboot
# Install deps
sudo yum install protobuf-static openssl-static zlib-static
@movitto
movitto / xag.rb
Created Apr 30, 2019
XRP Account Generator
View xag.rb
#!/usr/bin/ruby
#
# Written by Dev Null Productions <devnullproductions@gmail.com>
#
# Small script to generate new XRPL account as described in the following document:
# https://developers.ripple.com/accounts.html
#
# Simply run it with:
# ruby xag.rb
#
@movitto
movitto / xrpl-rocksdb.rb
Last active Apr 24, 2019
XRPL NodeStore - Type Extraction
View xrpl-rocksdb.rb
# Work in progress: Ruby Script that parses rippled rocksdb node store and
# dumps out data types.
#
# Written by Dev Null Productions <devnullproductions@gmail.com>
#
# Many thanks for help received on XRPChat:
# https://www.xrpchat.com/topic/31118-question-pertaining-to-hashing-database-lookups/
#
# Requires upstream build of rocksdb-ruby to incorporate recent changes.
# Also the 'bistro' and 'tty-cursor' rubygems (gem install these).
@movitto
movitto / xrp-account-entropy.rb
Created Feb 6, 2019
Determine XRP account entropy by character and substring occurances in Base58 representation
View xrp-account-entropy.rb
#!/usr/bin/ruby
# Determine XRP account entropy, takes in a list of XRP accounts and
# outputs distribution by length, character, positional character,
# substring, and case-insensitive substring
require 'workers'
# Add method to extract all String substrings of a given length
class String
def substrings(n)
You can’t perform that action at this time.