Skip to content

Instantly share code, notes, and snippets.

View hammertoe's full-sized avatar

Matt Hamilton hammertoe

View GitHub Profile
@hammertoe
hammertoe / erc20-test.md
Created March 16, 2024 17:14
Example erc20 token transfer on an ipc subnet

USDC ERC20 Token Bridge

Stage: Current Created by: Michael Seiler

Revisions

📒Requirements and Notes

The following are a collections of requirements and notes useful to set the context of the design. You

Intro

These instructions will create a new IPC subnet, with a single validator node and connect it to the Filecoin Calibration testnet. In production use you would configure this with multiple validators, but for the purposes of testing and development, we just create a single validator here.

Prerequisites

On Linux (links and instructions for Ubuntu):

@hammertoe
hammertoe / simple_bot.py
Created June 17, 2021 14:33
A very simple trading bot
import ccxt
import numpy as np
key = "mykey"
secret = "topsecret"
symbol = 'USDX/USDT'
exch = ccxt.ascendex({
'apiKey': key,
#!/usr/bin/python
# Email program. Copyright Matt Hamilton 2020.
print("You have no mail")
ffmpeg -re -f alsa -ar 22100 -ac 1 -r 30 -i h1:1 \
-f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental
-f flv rtmp://....
@hammertoe
hammertoe / chat.html
Created August 5, 2020 08:50
IBM stream chat overlay
<html>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans&display=swap" rel="stylesheet">
<style type="text/css">
ul { list-style: none; padding: 0; }
body { background-color: black; font-family: 'IBM Plex Sans'; }
a { color: white; }
.who { color: #bb8eff; float: left; }
.who::after { content: ":" }
.what { color: white; margin-left: 0.5em; }
.container {
FROM openwhisk/action-golang-v1.12
RUN <command to install deps for go>
@hammertoe
hammertoe / send_payment.py
Last active July 2, 2020 20:13
Send a payment with XRP
import xpring
import time
seed = 'snzBUmvTTAzCCRwGvGfKeA6Zqn4Yf'
wallet = xpring.Wallet.from_seed(seed) # create wallet from seed
dest = "rszDsdn8bUH9KRxM7DgvJS6oJ1w7kjQBfi" # where we want to send to
amount = 1000 # amount in drops to send
url = 'test.xrp.xpring.io:50051'
{
"addresses": [
{
"paymentNetwork": "XRPL",
"environment": "MAINNET",
"addressDetailsType": "CryptoAddressDetails",
"addressDetails": {
"address": "X75nEw5QD8Ej8jWt7EkJXHoVAV9YCtjuUSJppADpNtPKdim"
}
}
<VirtualHost [2001:41c8:11a:5::1]:443 46.43.0.47:443>
ServerName www.quernus.co.uk
ServerAlias quernus.co.uk
DocumentRoot "/var/www/htdocs/www.quernus.co.uk/"
Header always set Strict-Transport-Security "max-age=63072000; preload"
SSLEngine on
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
SSLProtocol All -SSLv2 -SSLv3