Skip to content

Instantly share code, notes, and snippets.

View anders94's full-sized avatar

Anders Brownworth anders94

View GitHub Profile
@anders94
anders94 / postgres-atomic-swap.sql
Created September 8, 2022 19:48
PostgreSQL Atomic Swaps in a Function
-- --------------------------------------------------------
-- -- Table: UHS
-- -- Creates a table called 'uhs' that holds UUIDs.
-- --------------------------------------------------------
CREATE TABLE uhs (
id UUID NOT NULL UNIQUE DEFAULT gen_random_uuid(),
CONSTRAINT pk_uhs_id PRIMARY KEY (id)
) WITH (OIDS=FALSE);
@anders94
anders94 / attestation.txt
Created September 4, 2021 18:49
Attestation
I contributed to the clr.fund Trusted Setup Multi-Party Ceremony.
The following are my contribution signatures:
Circuit: qvt32
Contributor # 352
Hash: 09c99485 4498fb36 550551cc a4ddf402
47a2c5ed 9d5c8fc9 45d8bcfc fa91db32
608e4439 3dc7257c f9f5fdf7 7fcd3fa2
7d1c7645 e0e59605 4a06b3f3 cafb4245
@anders94
anders94 / Recovering ETH From The WithdrawDAO
Last active July 20, 2016 17:06
Step by step process of converting DAO tokens back into ETH via the WithdrawDAO using geth on the command line.
// Start by getting to a geth shell running "geth attach" or however you do it.
$> geth attach
Welcome to the Geth JavaScript console!
instance: Geth/v1.4.10-stable/darwin/go1.6
coinbase: 0xcbcac9e9e30f3121834bc97c8b99b6602acc6c75
at block: 1920784 (Wed, 20 Jul 2016 12:58:48 EDT)
datadir: /home/user/.ethereum
modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

Keybase proof

I hereby claim:

  • I am anders94 on github.
  • I am andersbrownworth (https://keybase.io/andersbrownworth) on keybase.
  • I have a public key whose fingerprint is 7940 A057 D94E 35FF C5DE D05E 12A4 A36A 1766 D7A9

To claim this, I am signing this object:

@anders94
anders94 / gist:5715a78bcbc754f498fa
Last active February 27, 2018 18:54
Simulate a Terrible Internet Connection

Simulate a Terrible Internet Connection

The Linux networking stack is the Swiss Army Knife of the tech world.

Using iptables, drop a random 10% of incoming and outgoing packets:

iptables -A INPUT -m statistic --mode random --probability 0.1 -j DROP
iptables -A OUTPUT -m statistic --mode random --probability 0.1 -j DROP

To reset:

@anders94
anders94 / gist:e9f4262767343adb6270
Last active August 29, 2015 14:07
PGP Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFQN3oYBEADQ0hh/HcIOw0s+u3hSozcn6CfFVKK3dtWASoBpoLsBfu/SWABx
3F71bmslTdHyM2Mvw7l35rjp1j51J1h4KLjT8ArgPKAqpcEuyGL1O9dxdsAhOcRc
rDD2zAH/F61vMWngPKDbdd8rlGO/cHHOvG2tydJKPzJyB5Mo8mbpJ8QWhfKETC2k
irbYdvrU3jL0TyUKJLJ+QCWqKY5ZGcmEqg8BO89y8FhUVhT5Zas0wYLEw/8wPxIa
jaar2ePsBnaa2HdV33mrQ4uK47g4VOAC+qfzmNSEQknPFPExOOYNB7yWNyqK/ohD
WvSKmosPb+ksGfSEBJVFo6JtNFWK4XX9s6QeP8x31XFK5PvNrmjpM2CIrd6653mA
nqV//vgBBApdHWjE7Ax5TfoUe4EAGxNiSUKgBhr+BEWOX2zmfPtzAB/Ch0yaYxbV