Skip to content

Instantly share code, notes, and snippets.

@myrual
myrual / update_bitnami_lets_encrypt_crt.sh
Created Feb 24, 2022
Bitnami based let's encrypt update
View update_bitnami_lets_encrypt_crt.sh
sudo /opt/bitnami/ctlscript.sh stop
sudo /opt/bitnami/letsencrypt/lego --tls --email="NAME@name.com" --domains="www.domain.com" --path="/opt/bitnami/letsencrypt" renew --days 90
sudo /opt/bitnami/ctlscript.sh start
@myrual
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);
View press.one
https://press.one/p/v?s=e822a488a3769024448884762f953f6a3a8d005abce01ef3ff00d4626c4709c462e9b104a3fea195feb82ab91bcc3860dc75c8e6f66b2fde299e7a3bf80be1cb00&h=a39569d994303dde2221ab6d8b31769be38778b11e69d191fa6dbf8d2d407bfc&a=c62f9f9fac804f85ad9613180a2018c1d7e95798&f=P1&v=3
@myrual
myrual / setup_spb_mixin.md
Last active May 27, 2019
process to setup sub in mixin
View setup_spb_mixin.md

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
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",
View reorg_bitcoin.py
# https://twitter.com/cz_binance/status/1125996194734399488
# 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
View python_tuto_3.md

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:

View python_tuto_2.md

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

app.py

from mixin_ws_api import MIXIN_WS_API
from mixin_api import MIXIN_API
import mixin_config
View python_totu_1.md