Skip to content

Instantly share code, notes, and snippets.

View Mithrilwoodrat's full-sized avatar
🎯
Focusing

xiaoxianyu Mithrilwoodrat

🎯
Focusing
View GitHub Profile
@evanwill
evanwill / gitBash_windows.md
Last active July 16, 2024 23:51
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@reywood
reywood / how-to.md
Last active September 18, 2023 01:35
How to get a stack trace from a stuck/hanging python script

How to get a stack trace for each thread in a running python script

Sometimes a python script will simply hang forever with no indication of where things went wrong. Perhaps it's polling a service that will never return a value that allows the program to move forward. Here's a way to see where the program is currently stuck.

Install gdb and pyrasite

Install gdb.

# Redhat, CentOS, etc

The Further Analysis of the Poly Network Attack

By BlockSec

The attack consists of two main steps. The first step is to change the keeper and the second step is to withdraw the tokens (executing the unlock function). The second step has been fully analyzed. For the first step, Kevin (https://twitter.com/kelvinfichter) has pointed out that the hash collision is one smart trick used by the hacker to invoke the putCurEpochConPubKeyBytes function. However, why the attacker can have a valid transaction to make this call in the first place is still unknown.

In this blog, we use the malicious transaction from Ontology (0xf771ba610625d5a37b67d30bf2f8829703540c86ad76542802567caaffff280c) to illustrate the whole process.

In summary, we find that:

@itherunder
itherunder / listen_eth_bsc.py
Created December 30, 2021 04:16
监听以太坊和bsc 上面的Transfer 或者Swap 事件的,还能监听特定地址
__author__ = 'itherunder'
'''
https://etherscan.io/tokens?ps=100&p=1,从这里拿的
coins = document.getElementsByClassName('text-primary')
res = []
for (let i = 0; i < 100; i++) {
var name = coins[i].text
var href = coins[i].href
console.log(name, href)
res.push([name, href])