Skip to content

Instantly share code, notes, and snippets.

tmux cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@minikomi
minikomi / persona.go
Last active December 11, 2015 06:59
mozilla persona test
package main
import (
"encoding/json"
"fmt"
"github.com/gorilla/sessions"
"io/ioutil"
"log"
"net/http"
"net/url"
#!/usr/bin/env python
import asyncio
import websockets
import binascii
import ujson as json
method_map = {
'6d01': 'Set Name',
'6d02': 'Post Memo',
@dysinger
dysinger / easy-ubuntu-openvpn.sh
Created August 28, 2013 18:22
Create a VPN on EC2 in 30 seconds
#!/bin/sh
# linux firewall/forwarding
modprobe iptable_nat
echo 1 | tee /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.10.10.1/2 -o eth0 -j MASQUERADE
# install openvpn
apt-get update && apt-get install -y openvpn
cd /etc/openvpn/
INSTANCE=$(curl http://169.254.169.254/latest/meta-data/public-hostname)
openvpn --genkey --secret ${INSTANCE}.key
diff --git a/src/alert.cpp b/src/alert.cpp
index aa7ac748da..1c679e9fda 100644
--- a/src/alert.cpp
+++ b/src/alert.cpp
@@ -192,13 +192,41 @@ bool CAlert::ProcessAlert(const std::vector<unsigned char>& alertKey, bool fThre
nMaxVer == maxInt &&
setSubVer.empty() &&
nPriority == maxInt &&
- strStatusBar == "URGENT: Alert key compromised, upgrade required"
+ strStatusBar == "URGENT: Alert key compromised, upgrade required" &&
@davecheney
davecheney / stress.bash
Created August 25, 2012 12:12
stress test your packages
#!/bin/bash
go test -c
PKG=$(basename $(pwd))
set -e
while true ; do
export GOMAXPROCS=$[ 1 + $[ RANDOM % 128 ]]
./$PKG.test $@ 2>&1
done
@emschwartz
emschwartz / README.md
Last active September 28, 2019 11:28
1st ETH -> XRP Interledger Escrow Payment

1st ETH -> XRP Interledger Escrow Payment

Here are the transaction IDs (and links to the block explorers) for the first livenet Ethereum and Ripple Consensus Ledger (RCL) escrowed transfers comprising an Interledger payment.

  1. Ethereum prepare: 0x00cbb6149b9cfb3cedf280251c3060b2a38776fa7792b578b6f9f39ce5ee0266
  2. RCL prepare: 7F0A5F16C84568D96DA6A66058CD9EAA881236237642BF7427A458957A752B6B
  3. RCL fulfill: 12A4CAFAE95254844513C5C11488A1195C08DEFF673C97AC74AAC121935DDE36
  4. Ethereum fulfill: 0xb59dd839ab0b5e7d4e663b7cfc0ddb70eaf73dd2785b3d3a4abdf1a61817007d

SHA-256 Condition: `d2

@markblundeberg
markblundeberg / atomic-size-attack.md
Created February 16, 2018 05:14
Advisory: secret size attack on cross-chain hash lock smart contracts

Advisory: secret size attack on cross-chain hash lock smart contracts

Dr. Mark B Lundeberg, 2018 Feb 15 bitcoincash:qqy9myvyt7qffgye5a2mn2vn8ry95qm6asy40ptgx2

This security advisory notes a vulnerability in the common construction of cross-chain smart contracts (contracts between distinct cryptocurrencies) through hash locking. I focus on the primary use case in [atomic

@gavinandresen
gavinandresen / BlockPropagation.md
Last active March 14, 2023 09:45
O(1) block propagation

O(1) Block Propagation

The problem

Bitcoin miners want their newly-found blocks to propagate across the network as quickly as possible, because every millisecond of delay increases the chances that another block, found at about the same time, wins the "block race."