Skip to content

Instantly share code, notes, and snippets.

# /etc/systemd/system/shovel.service
[Unit]
Description=shovel
After=network.target
[Service]
ExecStart=/bin/bash -c 'source /home/ubuntu/shovel.env; /home/ubuntu/shovel -config /home/ubuntu/shovel.json -l :8546'
Restart=always
RestartSec=5
@ryandotsmith
ryandotsmith / agg.sql
Created January 23, 2013 05:19
Postgres array concatenation aggregate function.
CREATE AGGREGATE array_accum (anyarray)
(
sfunc = array_cat,
stype = anyarray,
initcond = '{}'
);
@ryandotsmith
ryandotsmith / lvmrad.sh
Created January 14, 2023 08:29
Setting up Ubuntu LVM Raid 0 with 4 NVMe M.2 Drives
lslbk # find drives to add (eg /dev/nvmeXn1)
pvcreate /dev/nvme1n1
pvcreate /dev/nvme2n1
pvcreate /dev/nvme3n1
pvcreate /dev/nvme4n1
vgcreate vg1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 /dev/nvme4n1
lvcreate --type=raid0 -l100%FREE -n rd1 vg1
mkfs.ext4 /dev/vg1/rd1
mkdir /storage #customize your mount point
echo '/dev/vg1/rd1 /storage ext4 defaults 0 0' >> /etc/fstab
@ryandotsmith
ryandotsmith / event_buffering.md
Created February 14, 2012 04:10
event buffering

Event Buffering

Eventually platforms outgrow the single-source-tree model and become distributed systems. A common pattern in these distributed systems is distributed composition via event buffering. Here we motivate and describe this event buffering pattern.

The Problem

@ryandotsmith
ryandotsmith / worker-pattern.md
Created January 23, 2012 05:03
The Worker Pattern

The Worker Pattern

Contents

  • Introduction
  • Definition
  • Examples
  • Links

Introduction

@ryandotsmith
ryandotsmith / hack-reactor.md
Last active November 24, 2022 07:01
Hack Reactor Talk

Tales From a Heroku User

Here are some things I have learned along the way.

Last Updated: 2013-02-08

Original Audience: Hack Reactor

About

package ens
import (
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)
func Namehash(name string) common.Hash {
@ryandotsmith
ryandotsmith / main.go
Created January 15, 2015 01:10
Sending an OP_RETURN Bitcoin Transaction with Go using Chain's Bitcoin API
package main
import (
"bytes"
"encoding/hex"
"encoding/json"
"io/ioutil"
"log"
"net/http"
@ryandotsmith
ryandotsmith / op_return.rb
Created February 9, 2015 19:45
Chain.com OP_RETRURN Transaction - Create Bitcoin OP_RETURN Transactions in Ruby
require 'bitcoin'
require 'chain'
Chain.block_chain = 'testnet3'
Bitcoin.network = :testnet3
include Bitcoin::Builder
key = Bitcoin::Key.from_base58("cVVBKRBMoPLJSSMW7cM3hji7VmXz1zJWX3DypcjPcWpRBMEu2xF7")
builder = Bitcoin::Builder::TxBuilder.new
@ryandotsmith
ryandotsmith / a-backbone-js-demo-app-sinatra-backend.md
Created January 22, 2012 01:42
Backbone demo app with sinatra backend

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010

Updates

  • 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments

In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].