Skip to content

Instantly share code, notes, and snippets.

View ngn999's full-sized avatar
💭
I may be slow to respond.

ngn999 ngn999

💭
I may be slow to respond.
View GitHub Profile
@ngn999
ngn999 / script.py
Last active June 29, 2023 12:05
parsing bitcoin transaction script in lldb
import lldb
import shlex
# push value
OP_PUSHDATA1 = 0x4c
OP_PUSHDATA2 = 0x4d
OP_PUSHDATA4 = 0x4e
def print_script(debugger, command, result, internal_dict):
target = lldb.debugger.GetSelectedTarget()
thread = target.GetProcess().GetSelectedThread()
frame = thread.GetSelectedFrame()
# Raw transaction API example work-through
# Send coins to a 2-of-3 multisig, then spend them.
#
# For this example, I'm using these three keypairs (public/private)
# 0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86 / 5JaTXbAUmfPYZFRwrYaALK48fN6sFJp4rHqq2QSXs8ucfpE4yQU
# 04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874 / 5Jb7fCeh1Wtm4yBBg3q3XbT6B525i17kVhy3vMC9AqfR6FH2qGk
# 048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213 / 5JFjmGo5Fww9p8gvx48qBYDJNAzR9pmH5S389axMtDyPT8ddqmw
# First: combine the three keys into a multisig address:
./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a9
@ngn999
ngn999 / update-golang.md
Created August 17, 2021 07:45 — forked from nikhita/update-golang.md
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

! Put user rules line by line in this file.
! See https://adblockplus.org/en/filter-cheatsheet
||appium.io^
||zh.wikipedia.org^
||ycombinator.com^
||news.ycombinator.com^
||en.wikipedia.org^
||a.udemycdn.com^
||hls.udemycdn.com^
||udemycdn.com^
! Put user rules line by line in this file.
! See https://adblockplus.org/en/filter-cheatsheet
||appium.io^
||zh.wikipedia.org^
||ycombinator.com^
||news.ycombinator.com^
||en.wikipedia.org^
||a.udemycdn.com^
||hls.udemycdn.com^
||udemycdn.com^
@ngn999
ngn999 / ballot.sol
Created June 15, 2018 02:00
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25-nightly.2018.6.12+commit.56a965ea.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract Ballot233 {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@ngn999
ngn999 / SMBDIS.ASM
Created January 23, 2018 03:28 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
source ~/.bash_profile
cd ${SRCROOT}
/path/to/xctool.sh -reporter json-compilation-database:compile_commands.json clean
/path/to/xctool.sh -reporter json-compilation-database:compile_commands.json build
oclint-json-compilation-database | sed 's/\(.*\.\m\{1,2\}:[0-9]*:[0-9]*:\)/\1 warning:/'
@ngn999
ngn999 / introrx.md
Created May 5, 2016 03:34 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@ngn999
ngn999 / xkc.pl
Last active October 26, 2017 08:19
杭州小客车查询脚本
#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
use Data::Dumper;
my $ua = LWP::UserAgent->new;
my $url = 'http://apply.hzcb.gov.cn/apply/app/status/norm/person';
my $issueNumber = '201709';