Skip to content

Instantly share code, notes, and snippets.

@forthxu
forthxu / subdomains.txt
Created May 15, 2020
常见子域名,用于蛮力查找
View subdomains.txt
www
mail
ftp
smtp
pop
m
webmail
pop3
imap
localhost
View openssl-self-signed-certs-cheatsheet.md

Create self-signed certificates with OpenSSL

Root CA

Create Root CA key (enable password with '-des3' option)

$ openssl genrsa -des3 -out root.key 4096

Create Root CA

@forthxu
forthxu / btc.protocol
Created Sep 26, 2018
BTC和USDT(OMNI)转账协议分析
View btc.protocol
--------------------
--------------------
交易:a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d
raw: https://btc.com/a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d.rawhex
01 加锁数量
输出脚本:
0010a5d4e8000000 小头,八字节,转出数量 10000.00000000
19 脚本长度
@forthxu
forthxu / bqt.sol
Created Jun 20, 2018
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.24+commit.e67f0147.js&optimize=false&gist=
View bqt.sol
pragma solidity ^0.4.23;
/**
* @title ERC20 interface
*/
contract ERC20 {
function totalSupply()
public view returns (uint256);
function balanceOf(address who)
View erc20.sol
pragma solidity 0.4.16;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
/**
* owned 是一个管理者
*/
contract owned {
address public owner;
@forthxu
forthxu / Keccak256.php
Created Mar 7, 2018
ethereum Keccak256(sha3-256),erc20,erc223,erc721
View Keccak256.php
<?php
/**
* @copyright Bruno Bierbaumer, Vladimir Vyatkin
* @see https://github.com/0xbb/php-sha3
*/
namespace Keccak;
final class Keccak256
{
const KECCAK_ROUNDS = 24;
View BatchProcessingMysqlTable.sh
#!/bin/bash
tables=`mysql -uroot jipai -e "select table_name from information_schema.tables where table_schema='jipai' and table_type='base table';" --batch --raw --skip-column-names`
for table in ${tables[@]}
do
echo ${table}, `mysql -uroot jipai -e "select count(*) from ${table};" --skip-column-names`
done
View blockchain.go
package main
import (
"context"
"crypto/sha256"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net"
"net/http"
@forthxu
forthxu / \Common\base32.php
Created Nov 9, 2017
可加密解密的base32
View \Common\base32.php
<?php
namespace Common;
/**
* 可加密解密的base32
*
* @author ForthXu
*/
class base32 {
@forthxu
forthxu / yxh_down.js
Created May 26, 2017
app下载处理
View yxh_down.js
var Emt = (function() {
var env = {},
navigator = window.navigator,
userAgent = navigator.userAgent,
ios = userAgent.match(/(iPad|iPhone|iPod)[^;]*;.+OS\s([\d_\.]+)/),
android = userAgent.match(/(Android)\s([\d\.]+)/);
env.isAndroid = (/android/gi).test(navigator.appVersion);
env.isIDevice = (/iphone|ipad|ipod/gi).test(navigator.appVersion);
env.isWebkit = /WebKit\/[\d.]+/i.test(userAgent);
env.isSafari = ios ? (navigator.standalone ? env.isWebkit : (/Safari/i.test(userAgent) && !/CriOS/i.test(userAgent) && !/MQQBrowser/i.test(userAgent))) : false;