Skip to content

Instantly share code, notes, and snippets.

@SwimmingTiger
SwimmingTiger / poc.php
Last active November 1, 2021 11:55
CVE-2016-7124-PHP8
#!/usr/bin/env php
<?php
class Fun{
private $func = 'call_user_func_array';
public function __call($f,$p){
call_user_func($this->func,$f,$p);
}
public function __wakeup(){
$this->func = '';
echo "Don't serialize me\n";
@SwimmingTiger
SwimmingTiger / bilibili-360-vr.js
Created February 14, 2021 04:45
用VR设备观看B站360度视频(声音可正常播放)
// 哔哩哔哩360度视频VR播放插件
// 感谢:
// <https://liyin.date/2020/04/25/bilibili-360-video-in-vr> 提供了思路
// <https://videojs-vr.netlify.app/> 提供了WebVR/WebXR播放器代码
// <https://blog.csdn.net/ministech/article/details/106036980> 提供了loadScript和loadCss函数
var VideoJS_VRPlayer_Bilibili = {
loadScript(src) {
return new Promise((resolve, reject) => {
var script = document.createElement('script'),
@SwimmingTiger
SwimmingTiger / README.md
Last active September 24, 2022 13:58
向日葵控控A2(OrayKVM)U盘救砖/USB恢复模式说明/免U盘刷机教程

控控A2是向日葵推出的IP KVM硬件盒子,通过模拟USB键鼠输入,并采集显卡HDMI输出,使受控电脑不需要安装远控软件就能被远程控制,甚至还能远程控制电脑进BIOS调设置,甚至远程重装系统,还是非常好用的。 https://sunlogin.oray.com/personal/kongkong2/

不过,这盒子还提供了SSH功能,而且还是root权限的。虽然会话chroot了,但要记住“chroot不是安全措施”。所以“chroot后的根目录看起来什么也没有”完全不能阻止我折腾。位于“SSH会话根目录之外”的sunlogin_client进程被我逆向了一番,顺便发现了它的隐藏功能(斗鱼直播推流)该怎么用(用法之后写)。

此外,通过直接访问/dev/mtdblock2,我完成了原厂固件的备份。然后用file命令确定这是squashfs固件,于是安装squashfs-tools进行解压、修改和重打包。

然后我就试着用dd命令把修改后的固件刷入控控,然而刷完就开不了机了。我猜也是如此,很多mtd设备用dd if=/dev/new.img of=/dev/mtdblock2这样的命令是无法正确写入的。

@SwimmingTiger
SwimmingTiger / numpy-benchmark.py
Created December 16, 2019 14:36 — forked from markus-beuckelmann/numpy-benchmark.py
A short Python script to benchmark NumPy and show your BLAS setup
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Roughly based on: http://stackoverflow.com/questions/11443302/compiling-numpy-with-openblas-integration
from __future__ import print_function
import numpy as np
from time import time
@SwimmingTiger
SwimmingTiger / Clean-Registry-of-Corel-VideoStudio-2018.ps1
Last active April 13, 2020 15:12
清除会声会影2018的注册表残留 / Clear the registry residue of Corel VideoStudio 2018
This file has been truncated, but you can view the full file.
<#
不小心把会声会影2018的安装目录删掉了,然后就无法卸载,也无法重装。
因为每次安装程序都会提示主程序已经安装,从而跳过安装。
我只好在另一台电脑上安装并卸载会声会影,用 Process Monitor 记录注册表变化,
然后制作了这个注册表残留清理脚本。
使用方法:在管理员PowerShell中运行。
脚本会首选备份注册表并输出备份文件到当前文件夹,
如果发生什么不测,你可以用来还原。
@SwimmingTiger
SwimmingTiger / branch-diff.php
Created July 19, 2019 09:25
按提交注释和提交时间比较两个分支的差异,仅列出不同的部分
#!/usr/bin/env php
<?php
function usage() {
global $argv;
die("Usage: $argv[0] <branch1> <branch2>\n");
}
if ($argc < 3) {
usage();
}
@SwimmingTiger
SwimmingTiger / qiniu-upload.go
Created July 8, 2019 09:55
Qiniu Cloud Storage Upload Tool (Support Breakpoint Resume) | 七牛云文件上传工具(支持断点续传)
package main
import (
"crypto/md5"
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
@SwimmingTiger
SwimmingTiger / tcp_proxy.go
Created May 15, 2019 10:55
Simple GO TCP proxy
// From https://gist.github.com/wallrat/3059639
package main
import (
"net"
"fmt"
"io"
"os"
)
func main() {
if len(os.Args) != 3 {
@SwimmingTiger
SwimmingTiger / A_Low_Difficulty_Beam_Private_Testnet.md
Last active June 4, 2019 03:10
创建一个低难度的Beam私有测试网络

创建一个低难度的Beam私有测试网络

步骤

  1. 点击右上角的Download ZIP下载该Gist中的相关配置文件。
  2. 下载 beam节点源代码 的Beam源代码。 如果要使用git获取源代码,请检出cold_wallet这个tag。注意某些分支或tag可能由于equihash参数不同,导致GPU Miner无法挖矿。 参考命令:
git clone https://github.com/BeamMW/beam.git
@SwimmingTiger
SwimmingTiger / add-i18n-support-add-locale-zhCN.patch
Created August 29, 2018 17:19
Paku_Totems: add i18n support; add locale: zhCN.
From 4ab4be88a21e3807141a4ac20f4c7a9480a82391 Mon Sep 17 00:00:00 2001
From: SwimmingTiger <hu60.cn@gmail.com>
Date: Thu, 30 Aug 2018 01:16:21 +0800
Subject: [PATCH] add i18n support; add locale: zhCN.
---
Libs/AceLocale-3.0/AceLocale-3.0.lua | 137 +++++++++++++++++++++++++++++++++++
Libs/AceLocale-3.0/AceLocale-3.0.xml | 4 +
Locales/zhCN.lua | 20 +++++
Paku_Totems.lua | 36 ++++-----