Skip to content

Instantly share code, notes, and snippets.

View bytemain's full-sized avatar
🎯
Focusing

野声 bytemain

🎯
Focusing
View GitHub Profile
@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/' %}
@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>
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());
Git 0 secs █████████████████████ 100.0%
@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
@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 / 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 / 查看占用端口的进程.ps1
Last active January 2, 2021 11:40
powershell scripts
Get-Process -Id (Get-NetTCPConnection -LocalPort 5000).OwningProcess
@bytemain
bytemain / awk
Last active January 2, 2021 11:38
cheat
cat /etc/passwd |awk -F ':' '{print $1}'
通过 awk 命令我们可以筛选出符合要求的行或者列数据
以:为分隔符,将 password 分为多列,并且提取出第一列的内容
---
$(awk '/Host github.com/{print NR}' ~/.ssh/config)
查找内容出现在第几行

Keybase proof

I hereby claim:

  • I am lengthmin on github.
  • I am lengthmin (https://keybase.io/lengthmin) on keybase.
  • I have a public key ASA2kMzkIDiKUZUo6YkxplS75GjHVdbHO1a9MFKWTiuT3Ao

To claim this, I am signing this object: