Skip to content

Instantly share code, notes, and snippets.

View zengxs's full-sized avatar

Xiangsong Zeng zengxs

  • Singapore/London
  • 18:20 (UTC +08:00)
View GitHub Profile
@zengxs
zengxs / proxy_socks2http.py
Created November 5, 2019 13:53
Convert socks proxy to http proxy (use python with asyncio)
import asyncio
import logging
import re
from asyncio import StreamReader, StreamWriter, StreamReaderProtocol
from collections import namedtuple
from typing import Optional
import socks # use pysocks
logging.basicConfig(level=logging.INFO)
@zengxs
zengxs / convert-svg.py
Created September 12, 2023 09:00
Convert SVG to Axure-compatible SVG using AppleScript and Pixelmator Pro.
#!/usr/bin/env python3
"""
Convert SVG to Axure-compatible SVG using AppleScript and Pixelmator Pro.
Axure convert optimized SVG to Shape will cause the SVG to be rendered deformed.
This script uses Pixelmator Pro to convert SVG to pixel-based SVG, which Axure
will convert to Shape correctly.
"""
import argparse
@zengxs
zengxs / gouwudang.js
Last active April 16, 2023 01:32
购物党油猴脚本(精简支持的网站)
// ==UserScript==
// @name gwdang
// @name:zh-CN 购物党自动比价工具-领取淘宝内部券
// @namespace no
// @description [含有购物党的返利]浏览商品页面时,自动比较同款商品在淘宝/京东/亚马逊/当当/苏宁/等百家商城的最低价,提供价格历史、口碑评分等查询。支持商品促销活动,商城优惠信息查询,商品可全网收藏,降价提醒。支持链家、我爱我家、中原地产等主流房产网站房源价格走势查询,为买房人士提供决策参考。
// @description:zh-CN [含有购物党的返利]浏览商品页面时,自动比较同款商品在淘宝/京东/亚马逊/当当/苏宁/等百家商城的最低价,提供价格历史、口碑评分等查询。支持商品促销活动,商城优惠信息查询,商品可全网收藏,降价提醒。支持链家、我爱我家、中原地产等主流房产网站房源价格走势查询,为买房人士提供决策参考。
// @run-at document-idle
// @version 3.0.4
// @require https://browser.gwdang.com/get.js?f=/js/gwdang_extension.js
// @grant none
#!ipxe
# AlmaLinux Operating System
# https://almalinux.org/
isset ${dhcp-server} && set ipparam ip=dhcp || set ipparam ip=${ip}::${gateway}:${netmask}:::none nameserver=${dns}
set ipparam BOOTIF=${netX/mac} ${ipparam}
goto ${menu} ||
@zengxs
zengxs / jwk_to_pem.py
Created July 2, 2017 00:50
Convert JWK(JSON Web Key) to Private Key(PEM)
#!/usr/bin/env python3
#
# pip install cryptography, pyjwt
from jwt.utils import (
base64url_decode,
bytes_to_number,
)
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
@zengxs
zengxs / tomcat.service
Last active August 14, 2022 17:26
tomcat systemd service script
# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
@zengxs
zengxs / mandarin.txt
Created September 1, 2019 04:28
通用规范汉字表汉字
一丁七万丈三上下不与丏丐丑专且丕
世丘丙业丛东丝丞丢两严丧个丫中丰
串临丸丹为主丽举乂乃久么义之乌乍
乎乏乐乒乓乔乖乘乙乜九乞也习乡书
乩买乱乳乸乾了予争事二亍于亏云互
亓五井亘亚些亟亡亢交亥亦产亨亩享
京亭亮亲亳亵亶亸亹人亿什仁仂仃仄
仅仆仇仉今介仍从仑仓仔仕他仗付仙
仝仞仟仡代令以仨仪仫们仰仲仳仵件
价任份仿企伈伉伊伋伍伎伏伐休众优
# /etc/systemd/system/gost@.service
[Unit]
Description=GO Simple Tunnel - %i
After=network.target
[Service]
Type=simple
User=nobody
Group=nogroup
#!/usr/local/bin/ruby
#
# revealer.rb -- Deobfuscate GHE .rb files.
#
# This is simple:
# Every obfuscated file in the GHE VM contains the following code:
#
# > require "ruby_concealer.so"
# > __ruby_concealer__ "..."
@zengxs
zengxs / App.vue
Created May 13, 2021 03:20
rust server side render (ssr) bench
<template>
<div id="app">
<h1>Hello</h1>
</div>
</template>
<script>
export default {
name: "App",
};