Skip to content

Instantly share code, notes, and snippets.

View LuoZijun's full-sized avatar
🎯
Focusing

寧靜 LuoZijun

🎯
Focusing
View GitHub Profile
@LuoZijun
LuoZijun / gs_query.py
Created October 29, 2015 04:26
工商营业执照报备信息 抓取脚本
#!/usr/bin/env python
#coding: utf8
import json, re
import requests
try:
from bs4 import BeautifulSoup
except:
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Vietnamese characters</title>
<style type="text/css">
:root {
font-size: 16px;
}
<!DOCTYPE html>
<html lang="cmn-Latn-pinyin">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pinyin characters test</title>
</head>
<style type="text/css">
:root {
font-size: 16px;
@LuoZijun
LuoZijun / IP2Hex.py
Last active August 18, 2022 10:51
IPv4 Address to a 32-bit integer value
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
IPv4 addresses to a 32-bit integer value
Document: https://en.wikipedia.org/wiki/IPv4#Address_representations
IPv4 addresses may be in any notation expressing a 32-bit integer value,
@LuoZijun
LuoZijun / README.rst
Last active April 4, 2022 04:39
FFMPEG 添加时间戳水印

FFMPEG 添加时间戳水印

安装 FFMPEG

# 如果已安装的 FFMPEG 已经支持了 `freetype` ,那么就不需要再安装了。
@LuoZijun
LuoZijun / README.rst
Last active March 23, 2022 07:20
IB 交易人词汇表 (Interactive Brokers Traders' Glossary)
@LuoZijun
LuoZijun / rgb2ycbcr.py
Last active August 1, 2021 07:12
RGB to YCbCr
def rgb_to_ycbcr(r, g, b):
assert(255>=r)
assert(255>=g)
assert(255>=b)
y = 0.299*r + 0.587*g + 0.114*b
cb = 128 - 0.168736*r - 0.331364*g + 0.5*b
cr = 128 + 0.5*r - 0.418688*g - 0.081312*b
return int(y), int(cb), int(cr)
@LuoZijun
LuoZijun / README.rst
Last active March 29, 2021 13:15
Fabric 分析笔记
@LuoZijun
LuoZijun / aes.py
Last active January 12, 2021 05:14
Python AES
#!/usr/bin/env python
#coding: utf8
import base64
import hashlib
import binascii
from Crypto import Random
from Crypto.Cipher import AES
from os import urandom
#![allow(dead_code, unused_imports)]
use std::net::TcpStream;
use std::net::Shutdown;
use std::net::Ipv4Addr;
use std::net::SocketAddr;
use std::net::SocketAddrV4;
use std::net::ToSocketAddrs;
use std::io::{self, Read, Write};
use std::time::Instant;