Skip to content

Instantly share code, notes, and snippets.

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

Feix C feix

💭
I may be slow to respond.
View GitHub Profile
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0
@feix
feix / tcp_timeout.go
Created June 12, 2018 06:57 — forked from hongster/tcp_timeout.go
Golang example on handling TCP connection and setting timeout.
package main
import (
"fmt"
"net"
"time"
"bufio"
)
func handleConnection(conn net.Conn) {
#!/bin/bash
echo "download beginning"
years=$(curl -s http://dinosaurpictures.org/ancient-earth | grep option | awk -F'"' '$0 ~ /million|>0</ {print $2}')
base_url=http://dinosaurpictures.org/ancient-earth-assets/images/scotese/
target_path=earth_pics
mkdir -p "$target_path"
IFS=$'\n'
-- https://dev.mysql.com/doc/internals/en/layout-record-storage-frame.html
local read_len = function(content, first, l)
local sum = 0
local last = first + l - 1
for i = first, last do
sum = sum * 256 + content[i]
end
return sum
end
#!/usr/bin/env python3
# https://dev.mysql.com/doc/internals/en/layout-record-storage-frame.html
def read_len(content, begin, l):
sum_len = 0
for bit in content[begin:begin+l]:
sum_len = (sum_len << 8) + bit
return sum_len
@feix
feix / bankCard.js
Created April 9, 2020 03:31 — forked from yanweijia/bankCard.js
匹配国内主流银行卡的正则
let bankcardList = [{
bankName: "中国邮政储蓄银行",
bankCode: "PSBC",
patterns: [{
reg: /^(621096|621098|622150|622151|622181|622188|622199|955100|621095|620062|621285|621798|621799|621797|620529|621622|621599|621674|623218|623219)\d{13}$/g,
cardType: "DC"
}, {
reg: /^(62215049|62215050|62215051|62218850|62218851|62218849)\d{11}$/g,
cardType: "DC"
}, {
@feix
feix / RexChainesPhone.js
Created April 9, 2020 03:59 — forked from JerryC8080/RexChainesPhone.js
匹配中国电话号码的正则表达式
/**
电信
中国电信手机号码开头数字
2G/3G号段(CDMA2000网络)133、153、180、181、189
4G号段 177
联通
中国联通手机号码开头数字
@feix
feix / README.md
Created June 11, 2023 18:03 — forked from abelcallejo/README.md
Create bootable Linux USB using Mac

Creating bootable Linux USB using Mac

mac

CentOS, Ubuntu, Slackware, etc. Whatever Linux-based OS it is, you can create a bootable USB for it by using a Mac.

1. Prepare the .iso file

Download it, copy it, whatever it takes to prepare that Linux-based OS .iso file

2. Convert the .iso file into a .img.dmg