Skip to content

Instantly share code, notes, and snippets.

View bytemain's full-sized avatar

Jiacheng bytemain

View GitHub Profile
Get-Process -Id (Get-NetTCPConnection -LocalPort 5000).OwningProcess
@bytemain
bytemain / ddns.py
Last active December 30, 2023 13:20
python-cloudflare
import time
import socket
import CloudFlare
import CloudFlare.exceptions
import requests
EMAIL = '<email>'
TOKEN = '<cf token>'
@bytemain
bytemain / fuzz_test.py
Created May 22, 2020 15:29
rapid_fuzz test
from rapidfuzz import fuzz, process
print(
"QRatio",
process.extractOne("lengthmin", ["cs", "man", "help", "bind"], fuzz.QRatio),
)
print(
"WRatio",
process.extractOne("lengthmin", ["cs", "man", "help", "bind"], fuzz.WRatio),
)
@bytemain
bytemain / download_51zhy.py
Created February 5, 2020 09:38
Some Python Scripts
from base64 import b64decode
from contextlib import closing
from json import loads
from random import random
import requests
# pycryptodome
from Crypto.Cipher import AES
from Crypto.Util.Padding import unpad
TypeScript 7 hrs 54 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Žβ–‘β–‘β–‘β–‘β–‘β–‘ 67.9%
Other 56 mins β–ˆβ–‹β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 8.1%
CSS 53 mins β–ˆβ–Œβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 7.7%
JSON 45 mins β–ˆβ–Žβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 6.5%
JavaScript 25 mins β–Šβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 3.6%
function deepClone(obj) {
var copy;
// Handle the 3 simple types, and null or undefined
if (null == obj || "object" != typeof obj) return obj;
// Handle Date
if (obj instanceof Date) {
copy = new Date();
copy.setTime(obj.getTime());
@bytemain
bytemain / index.html
Created November 27, 2019 08:40
Take screen shots of window or desktop with js https://codepen.io/designalchemy/pen/WNNmOgP?editors=1010
<button id="cake">Take Screeny</button>
<br />
<canvas id="fake"></canvas>
@bytemain
bytemain / post-copyright.swig
Last active July 17, 2019 09:42
post-copyright
{#
移怍θ‡ͺ http://moxfive.xyz/2016/06/14/duoshuo-disqus-comment-count/#footer
基于 https://github.com/theme-next/hexo-theme-next
#}
{% set ccLicense = "署名-ιžε•†η”¨-η›ΈεŒζ–ΉεΌε…±δΊ« 4.0" %}
{% set ccLicenseTitle = "CC BY-NC-SA 4.0 International"%}
{% set ccIcon = '<i class="fa fa-fw fa-creative-commons"></i>' %}
{% set ccText = ccLicense | upper %}
{% set ccURL = 'http://creativecommons.org/licenses/by-nc-sa/4.0/' %}