Skip to content

Instantly share code, notes, and snippets.

@forthxu
forthxu / TaskServer.php
Created April 20, 2023 07:58
swoole-1.8.5 多进程任务处理
<?php
/**
* 任务处理服务
$taskServer = new \TaskServer(
100,//工作进程数量
function($taskServer){//onMaster: 主进程任务
//测试发任务到工作进程
swoole_timer_tick(100, function () use ($taskServer) {
$taskServer->task("hello");
});
@forthxu
forthxu / date_convert_osx_example.sh
Created September 7, 2022 02:22 — forked from benwei/date_convert_osx_example.sh
MacOS convert timestamp by date command with GNU bash
#!/bin/bash
# author: terry, ben
# tested GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14)
# FYR (for Mac OS, may need some change for linux)
# second -> ISO8601
date -u -r 1453951368 +%FT%TZ
## ouptput: 2016-01-28T03:22:48Z
# ISO8601 -> second
date -ju -f "%FT%TZ" 2016-01-28T03:22:48Z +%s
## output: 1453951368
@forthxu
forthxu / apkinfo.sh
Last active June 6, 2022 07:19
获取apk的name,icon,version,permissions,RSA等信息
#!/bin/bash
#@author forthxu.com
#说明
#找到获取apk信息有两种方式
#一种解压后读取AndroidManifest.xml,解压最好不要通过unzip因为获取的是压缩过的内容,读取不准确,可用apktool反编译解压
#另外一种可通过aapt也就是官方sdk中提供的工具读取信息
#aapt和apktoool工具 https://code.google.com/p/android-apktool
#可能存在的问题 http://www.qiansw.com/centos-apk-apktool.html
#扩展阅读,汉化apk http://bbs.dospy.com/thread-9991523-1-354-1.html
@forthxu
forthxu / CheckForbiddenWords.py
Created March 21, 2017 04:45
Python全站内容抓取、URL扫描 实例:用于扫描自己的网站的违禁词连接和对应的违禁词
#!/usr/bin/python
# -*- coding:utf-8 -*-
# Orignal Author: FrankHacker
# Modified by Linson @691000737
# Require requests module, python3.x+
# 处理常见违禁词,全站扫描,违禁词可以从自己的网站导出成json格式,替换13行内容
# 程序会在当前目录生成badword.txt文件
import requests
import re,json
@forthxu
forthxu / subdomains.txt
Created May 15, 2020 01:48
常见子域名,用于蛮力查找
www
mail
ftp
smtp
pop
m
webmail
pop3
imap
localhost

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 September 26, 2018 02:26
BTC和USDT(OMNI)转账协议分析
--------------------
--------------------
交易:a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d
raw: https://btc.com/a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d.rawhex
01 加锁数量
输出脚本:
0010a5d4e8000000 小头,八字节,转出数量 10000.00000000
19 脚本长度
@forthxu
forthxu / STD3Des.java
Last active September 21, 2018 12:58
3des加密java版和php版
// javac test3.java
// java test3
import java.security.Key;
import javax.crypto.Cipher;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;
import javax.crypto.spec.IvParameterSpec;
@forthxu
forthxu / scrapting_wechat.python
Last active August 31, 2018 04:26
chuansong.me 传送门指定公众号文章采集 && 利用phantomjs对网页进行截图 && 抓取搜狗微信
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import urllib2
import time
import csv
import sys,os
import pymysql
def get_cur_file_dir():
@forthxu
forthxu / bqt.sol
Created June 20, 2018 07:14
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=
pragma solidity ^0.4.23;
/**
* @title ERC20 interface
*/
contract ERC20 {
function totalSupply()
public view returns (uint256);
function balanceOf(address who)