Skip to content

Instantly share code, notes, and snippets.

myrual /
Created Feb 24, 2022
Bitnami based let's encrypt update
sudo /opt/bitnami/ stop
sudo /opt/bitnami/letsencrypt/lego --tls --email="" --domains="" --path="/opt/bitnami/letsencrypt" renew --days 90
sudo /opt/bitnami/ start
myrual / check_af_alg.c
Created Oct 10, 2019
code to check linux kernel support af_alg
View check_af_alg.c
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/if_alg.h>
#include <errno.h>
int main(){
//Alternatively you can set the path to argv[1]
int sockfd = socket(AF_ALG, SOCK_SEQPACKET, 0);
myrual /
Last active May 27, 2019
process to setup sub in mixin

ubuntu without root

Update ubuntu

$ sudo apt -y update
$ sudo apt-get -y upgrade

install PG

$ sudo apt -y install postgresql postgresql-contrib
$ /usr/lib/postgresql/10/bin/postgres -V
myrual / How_to_Node__receive_and_send_bonus_to_Messenger.txt
Created May 9, 2019
Cedric write a manual for node operator to withdraw XIN bonus to Messenger ID
View How_to_Node__receive_and_send_bonus_to_Messenger.txt
首先构造一个基本的 raw transaction 格式如下
"version": 1,
"asset": "a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc",
"extra": "34366362393932382d653636632d343966392d386165632d366462366137346666663638",
"outputs": [
"type": 0,
"amount": "115.06849309",
# block2reorg
# If you want to remove one transaction six block ago,
# there is one solution:
# buy more than half of Bitcoin hash power, calculate all transaction again, until you become the longest chain and all full node accept it
# Diff is the block you want to re-org
# k is your hash power/other hash power
# x is the block you need to generate
# diff = kx - x

We have created a bot to echo message and echo Bitcoin.

What you will learn from this chapter

  1. How to create Bitcoin wallet
  2. How to read Bitcoin balance
  3. How to send Bitcoin with zero transaction fee and confirmed in 1 second
  4. How to send Bitcoin to other wallet

Create a Bitcoin wallet by Mixin Network Python SDK

Pre-request: You should have a Mixin Network account. Create an account can be done by one line code:


In the previous chapter, we created our first app, when user sends "Hello,world!", the bot reply the same message.

Receive and send Bitcoin in Mixin Messenger

from mixin_ws_api import MIXIN_WS_API
from mixin_api import MIXIN_API
import mixin_config