Skip to content

Instantly share code, notes, and snippets.

View itherunder's full-sized avatar
🏠
Working from home

itherunder

🏠
Working from home
View GitHub Profile
@itherunder
itherunder / helloworld.cpp
Created December 6, 2021 03:28
it's a helloworld.
#include <iostream>
using namespace std;
int main() {
cout << "hello world" << endl;
return 0;
}
@itherunder
itherunder / git_init.sh
Created December 6, 2021 15:09
git init cmd
git init
git config user.email "liaozhou98@qq.com"
git config user.name "itherunder"
git remote add origin https://github.com/itherunder/xxx
# git pull <远程服务器名(就是git remote -v的结果)> <远程分支名>:<本地分支名>)
git pull origin main:main
# 或者可以用fetch + merge 的方式代替pull
# git fetch <远程服务器名> <远程分支名>
git fetch origin main
# git merge <HEAD> <分支名>
@itherunder
itherunder / get_token_price.py
Created December 15, 2021 03:08
使用`coingecko`的`api`获取`token`的价格,需要先把`token_list_url`上面的所有`token`列表保存到`tokens.txt`
import requests, json
token_list_url = 'https://api.coingecko.com/api/v3/coins/list'
url = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=%s'
tokens = json.loads(open('tokens.txt', 'r', encoding='utf-8').read())
symbol_to_id = {}
for token in tokens:
id, symbol = token['id'], token['symbol'].lower()
if symbol in symbol_to_id:
continue
@itherunder
itherunder / get_tokens.js
Created December 15, 2021 15:06
https://etherscan.io/tokens or https://bscscan.com/tokens 按f12 进入控制台,直接获取前一百的token 列表
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])
}
console.log(res)
@itherunder
itherunder / get_decimals_prices.py
Created December 16, 2021 05:26
使用`selenium` 获取合约地址的`decimals` 以及`prices`
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
tokens = ['df574c24545e5ffecb9a659c229253d4111d87e1','c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2']
bsc_tokens = ['96dd399f9c3afda1f194182f71600f1b65946501','b59490ab09a0f526cc7305822ac65f2ab12f9723']
url = 'https://etherscan.io/token/0x%s'
bsc_url = 'https://bscscan.com/token/0x%s'
driver = webdriver.Chrome(ChromeDriverManager().install())
@itherunder
itherunder / post_get.js
Created December 17, 2021 05:09
在浏览器的控制台里面发送请求
//POST
function post(url, params) {
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onload = function (e) {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
console.log(xhr.responseText);
} else {
@itherunder
itherunder / send_message.js
Created December 17, 2021 05:11
在浏览器的控制台中发送discord 消息,下面是获取币价的示例
function send_message(message) {
fetch("https://discord.com/api/v9/channels/$YOUR CHANNEL ID$/messages", {
"headers": {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,cy;q=0.6",
"authorization": "$YOUR OWN AUTHORIZATION TOKEN$",
"cache-control": "no-cache",
"content-type": "application/json",
"pragma": "no-cache",
"sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"96\", \"Microsoft Edge\";v=\"96\"",
@itherunder
itherunder / gen_pri_addr.js
Created December 17, 2021 06:04
生成以太坊钱包地址和私钥,JavaScript版本,记得`npm install ethereumjs-wallet`
var Wallet = require('ethereumjs-wallet')
const fs = require('fs');
// 生成 i 个钱包地址数量,改这里就可以了。 TeleGram:@btcok9
for(var i = 0; i < 100; i++){
const EthWallet = Wallet.default.generate(false);
const addressALL = EthWallet.getAddressString();
const addr = addressALL + "\n";
console.log("address: " + EthWallet.getAddressString());
@itherunder
itherunder / gen_pri_addr.go
Last active January 18, 2022 13:48
生成以太坊地址和私钥,Golang版本,记得go get go-ethereum
package main
import (
"bufio"
"crypto/ecdsa"
crand "crypto/rand"
"fmt"
"io"
"log"
"net/smtp"
@itherunder
itherunder / auto_follow.py
Last active January 18, 2022 13:47
`Monaco` 自动`follow` 脚本,`Python`,记得`pip3 install pyautogui`
import pyautogui, time, random, sys, os
def send_email(msg):
msg = msg.replace(' ', '_')
os.system('send_mail.exe %s' % msg)
def into_followers():
loc = pyautogui.locateCenterOnScreen("followers.png", confidence=0.9)
while loc is None:
print('[INFO] Cannot find followers.')