Skip to content

Instantly share code, notes, and snippets.

View wfjsw's full-sized avatar

Jabasukuriputo Wang wfjsw

View GitHub Profile
@wfjsw
wfjsw / convert_to_pth.py
Created August 3, 2023 16:54
A conceptual safetensors converter for RVC
import pathlib
import torch
from safetensors import safe_open
import argparse
import json
parser = argparse.ArgumentParser()
parser.add_argument("input", metavar="in", type=str, default="model.safetensors", help="Input .safetensors model path")
parser.add_argument("-m", "--metadata", required=False, metavar="meta", type=str, default="model.json", help="Metadata .json path")
parser.add_argument("output", metavar="out", nargs="?", default=None, type=str, help="Output .pth model path")
@wfjsw
wfjsw / enc.js
Last active August 31, 2023 07:56
const askhyZESMiTa = "aMq0Vk2QThOJ1qsK";
const asirwND73kx2 = "bENVgtN9llqTCWPS";
const ackQjV8pRLFF = "dKyBVluERbCaupYE";
const aciaallf8z0Q = "fZsaKttlA5A8GX7A";
const dskhXKbQZi19 = "hKVw3rIJQJlHirdh";
const dsizKZaAJQLb = "xH8I8jYDZY33QzJJ";
const dckvUcTa9vft = "oz2zCOI3ow8YN1gJ";
const dciZ7hxfi8SC = "ph4oq7nooy3NnkRE";
const aes_local_key = 'emhlbnFpcGFsbWtleQ==';
const aes_local_iv = 'emhlbnFpcGFsbWl2';
@wfjsw
wfjsw / convert-pt-embedding-to-png.ipynb
Last active November 24, 2022 00:50
convert-pt-embedding-to-png.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wfjsw
wfjsw / map.java
Created August 9, 2022 14:01
paladin80/map - Paladin Vent Influence Map Source Code
import java.awt.image.BufferedImage;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.geom.Rectangle2D;
import java.util.*;
import java.sql.*;
public class Map extends Frame implements Runnable {
private final int quarternizer = 1;
@wfjsw
wfjsw / help-wanted.md
Last active June 18, 2022 05:36
OPPOENCRYPT! ozip Specs

Help-Wanted

  1. Find out the exact encryption algorithm used by aes_decrypt (hint: use IDA Pro against /sbin/recovery ) it is aes-ecb
  2. Extract the 128-bit ECB Key (binary is here, aarch64 elf, 0x23f08)
  3. Implement external decryptor
@wfjsw
wfjsw / plugin.ini
Created January 28, 2022 13:02 — forked from KagurazakaNyaa/plugin.ini
Pathfinder WaterMark
[PLUGIN]
MODULES_ENABLED = 1
[PLUGIN.MODULES]
DEMO = ./app/ui/module/demo
EMPTY = ./app/ui/module/empty
WATERMARK = ./app/ui/module/watermark
@wfjsw
wfjsw / go-shit.md
Last active December 28, 2020 14:24
Go 坑与经验教训

Go 坑与经验教训

记录一些 Go 应用开发时可能遇到的坑以备未来参考。个人见解或许有误。

  1. 注意限制传入 make 的长度范围,尤其是基于外部输入的时候,避免内存爆炸。错误写法范例: https://github.com/mumble-voip/grumble/blob/181a4f321998046264246cfeb348803636c1c386/cmd/grumble/client.go#L246-L252
	// Read the message length (32-bit big-endian unsigned integer)
	err = binary.Read(client.reader, binary.BigEndian, &length)
	if err != nil {
@wfjsw
wfjsw / 1000phone-sign-in.user.js
Last active May 30, 2020 06:00
1000phone auto sign in
// ==UserScript==
// @name 1000Phone Auto Sign In
// @namespace https://jsw3286.eu.org/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://pt.1000phone.net/livingRoom?*
// @require https://code.jquery.com/jquery-3.5.1.min.js
// @grant none
// ==/UserScript==
@wfjsw
wfjsw / tl_convert.js
Last active January 20, 2020 08:10
Convert TL-Schema File to JSON
'use strict';
var fs = require('fs')
var args = process.argv.slice(2);
// From https://github.com/lodash/lodash/blob/4.17.4/lodash.js#L6891
function compact(array) {
var index = -1,
length = array == null ? 0 : array.length,
@wfjsw
wfjsw / ping.js
Created March 30, 2019 12:13
Script snippet used to check MTProxy availability.
var Uint64BE, Int64BE, Uint64LE, Int64LE; !function (E) { var g, A = "undefined", U = A !== typeof Buffer && Buffer, I = A !== typeof Uint8Array && Uint8Array, L = A !== typeof ArrayBuffer && ArrayBuffer, d = [0, 0, 0, 0, 0, 0, 0, 0], n = Array.isArray || function (t) { return !!t && "[object Array]" == Object.prototype.toString.call(t) }, w = 4294967296; function t(t, r, a) { var c = r ? 0 : 4, y = r ? 4 : 0, n = r ? 0 : 3, e = r ? 1 : 2, o = r ? 2 : 1, i = r ? 3 : 0, u = r ? k : J, s = r ? O : _, f = l.prototype, h = "is" + t, v = "_" + h; return f.buffer = void 0, f.offset = 0, f[v] = !0, f.toNumber = p, f.toString = function (t) { var r = this.buffer, f = this.offset, n = B(r, f + c), e = B(r, f + y), o = "", i = !a && 2147483648 & n; i && (n = ~n, e = w - e); t = t || 10; for (; ;) { var u = n % t * w + e; if (n = Math.floor(n / t), e = Math.floor(u / t), o = (u % t).toString(t) + o, !n && !e) break } i && (o = "-" + o); return o }, f.toJSON = p, f.toArray = m, U && (f.toBuffer = S), I && (f.toArrayBuffe