Skip to content

Instantly share code, notes, and snippets.

View Tsuk1ko's full-sized avatar
🕊️
Pigeon - Verified by GitHub

神代綺凛 Tsuk1ko

🕊️
Pigeon - Verified by GitHub
View GitHub Profile
@Tsuk1ko
Tsuk1ko / README.md
Last active April 21, 2024 13:36
雷索纳斯砍价抬价期望疲劳计算

在当前页面按 F12 打开 devtool,把下面的代码粘贴到 console 里回车执行

function calc(config) {
  const SUCCESS_USE = 8;
  const FAILED_USE = Math.max(0, SUCCESS_USE - config.reduceGrowthWhenFailed);
  const EACH_SUCCESS_REDUCE_PROB = 0.1;
  const run = ({ totalCount, successCount, isLastFailed }) => {
    const curProb = Math.min(1, config.initProb + (totalCount === 0 ? config.fistTryAddProb : 0) - successCount * EACH_SUCCESS_REDUCE_PROB + (isLastFailed ? config.failedAddProb : 0));
    if (successCount >= config.successNumber || totalCount >= config.maxTry || curProb <= 0) {
@Tsuk1ko
Tsuk1ko / miao-mod.js
Last active December 10, 2022 16:23
云崽喵喵插件默认伤害修改插件
import fs from 'fs';
import plugin from '../../lib/plugins/plugin.js';
let moded = false;
const modList = [
{
name: '班尼特',
key: 'defDmgIdx',
val: 2,
@Tsuk1ko
Tsuk1ko / uninstall-tencent-yunjing.sh
Created November 10, 2022 13:17
卸载腾讯云镜
/usr/local/qcloud/stargate/admin/uninstall.sh
/usr/local/qcloud/YunJing/uninst.sh
/usr/local/qcloud/monitor/barad/admin/uninstall.sh
@Tsuk1ko
Tsuk1ko / update_aliyun_com.sh
Created February 25, 2022 11:25
修复三级域名参数问题 from sensec/ddns-scripts_aliyun
#!/bin/sh
#
# 用于阿里云解析的DNS更新脚本
# 2017-2018 Sense <sensec at gmail dot com>
# 阿里云解析API文档 https://help.aliyun.com/document_detail/29739.html
#
# 本脚本由 dynamic_dns_functions.sh 内的函数 send_update() 调用
#
# 需要在 /etc/config/ddns 中设置的选项
# option username - 阿里云API访问账号 Access Key ID。可通过 aliyun.com 帐号管理的 accesskeys 获取, 或者访问 https://ak-console.aliyun.com
@Tsuk1ko
Tsuk1ko / remove-aliyundun.sh
Created May 8, 2021 06:37
卸载阿里云盾
curl -sL http://update.aegis.aliyun.com/download/uninstall.sh | bash -
curl -sL http://update.aegis.aliyun.com/download/quartz_uninstall.sh | bash -
pkill aliyun-service
rm -rf /etc/init.d/agentwatch /usr/sbin/aliyun-service /usr/local/aegis*
iptables -I INPUT -s 140.205.201.0/28 -j DROP
iptables -I INPUT -s 140.205.201.16/29 -j DROP
iptables -I INPUT -s 140.205.201.32/28 -j DROP
iptables -I INPUT -s 140.205.225.192/29 -j DROP
iptables -I INPUT -s 140.205.225.200/30 -j DROP
iptables -I INPUT -s 140.205.225.184/29 -j DROP
@Tsuk1ko
Tsuk1ko / jimp.medianBlur.js
Last active February 15, 2021 11:53
Jimp 中值滤波,随便写来测试用的,没优化,效率很低
Jimp.prototype.medianBlur = function () {
const pointsOffset = [-1, 0, 1].flatMap(x => [-1, 0, 1].map(y => [x, y]));
const newData = Buffer.from(this.bitmap.data);
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
if (x === 0 || x === this.bitmap.width - 1 || y === 0 || y === this.bitmap.height - 1) return;
for (let i = 0; i < 3; i++) {
const points = pointsOffset.map(([ox, oy]) => this.bitmap.data[this.getPixelIndex(x + ox, y + oy) + i]);
points.sort();
const median = points[Math.floor((points.length - 1) / 2)];
newData[this.getPixelIndex(x, y) + i] = median;
@Tsuk1ko
Tsuk1ko / subconverter-blank-config.yaml
Created August 24, 2020 16:55
subconverter 空配置
custom:
enable_rule_generator: false
overwrite_original_rules: true
custom_proxy_group:
- { name: Empty, type: select, rule: ['[]DIRECT', '[]REJECT'] }
@Tsuk1ko
Tsuk1ko / bilibili-nekopara-old.css
Last active August 16, 2022 08:02
萌化项目黑历史存档
@-moz-document domain("bilibili.com") {
/*字体*/
/******************************
* Google Design *
* https://material.io/icons/ *
******************************/
@font-face{
font-family: 'Material Icons';
font-style: normal;
font-weight: normal;
// npm i axios lodash javascript-lp-solver
const _ = require('lodash');
const linprog = require('javascript-lp-solver/src/solver');
const { get } = require('axios');
const url_stats = 'https://penguin-stats.io/PenguinStats/api/result/matrix?show_stage_details=true&show_item_details=true';
const url_rules = 'https://ak.graueneko.xyz/akmaterial.json';
const slove = async need => {
let data_stats = await get(url_stats).then(r => r.data);
@Tsuk1ko
Tsuk1ko / centos7-install-python-libtorrent.sh
Last active April 4, 2019 15:19 — forked from cloverstd/install.sh
Install libtorrent and python binds on centos 7
yum install -y boost boost-devel
yum install -y make gcc gcc-c++ kernel-devel python-devel
wget https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_0_11/libtorrent-rasterbar-1.0.11.tar.gz
tar zxvf libtorrent-rasterbar-1.0.11.tar.gz
cd libtorrent-rasterbar-1.0.11
./configure --disable-debug --with-boost-libdir=/usr/lib64 --disable-encryption --enable-python-binding
make && make install
cd bindings/python
python setup.py build
python setup.py install