Skip to content

Instantly share code, notes, and snippets.

View hlgsdx's full-sized avatar

hlgsdx

View GitHub Profile
@hlgsdx
hlgsdx / helper.cc
Last active October 4, 2025 11:44
VoiceVox TTS API helper - KIRIKIRI - テキスト読み上げ - 外部アプリケーション呼び出し
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <map>
#include <memory>
#include <vector>
#include <cstdlib>
#include <curl/curl.h>
#ifdef _WIN32
@hlgsdx
hlgsdx / TimeInitDemo.c
Created October 16, 2024 16:29
UEFI application to initialize system time based on a timestamp saved in a text file
#include <Uefi.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Protocol/SimpleFileSystem.h>
#include <Protocol/LoadFile.h>
#include <Guid/FileInfo.h>
#include <Library/BaseLib.h>
#include <Library/PrintLib.h>
@hlgsdx
hlgsdx / Makefile
Last active September 6, 2024 06:46 — forked from adde88/Makefile
mdk4 - LEDE
#
# Copyright (C) 2009-2024 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=mdk4
@hlgsdx
hlgsdx / 1.steps.md
Last active August 26, 2024 08:07
Bypass Intel LAR with beacon spoofing to use Wi-Fi 6E 6Ghz

环境

系统及硬件

  • Ubuntu 22.04.4 LTS
  • Intel AX200

其他网卡只要能驱动,大概率也行,未测试

软件

@hlgsdx
hlgsdx / rename.sh
Created April 2, 2023 16:56
File renamer for ellentan's CD rip archive
#!/bin/bash
for file in *.rar; do
if [ -f "$file" ]; then
oldname=$(echo -n "$file" | grep -oP '.*(?=[.])')
newname=$(rar lb "$file" | head -1 | sed 's/\/.*//')
newname="[EAC]${newname}[$oldname](wav+cue+log+png)"
if [ -n "$newname" ]; then
mv -i "$file" "$newname.rar"
echo "Renamed $file to $newname.rar"
fi
@hlgsdx
hlgsdx / cue_to_flac.py
Created November 2, 2021 07:56 — forked from mervick/cue_to_flac.py
CUE splitter using ffmpeg (to flac)
#!/usr/bin/python3
import argparse
import os
import subprocess
def main():
parser = argparse.ArgumentParser(description='Split flac file using cue')
parser.add_argument('cue', type=str, help='path to cue file')
@hlgsdx
hlgsdx / run.sh
Last active March 9, 2022 13:34
# 解压所有rar
find . -name \*.rar -print0 | xargs -0 -I {} ~/unrar x '{}' -pPass output/
# 转换所有wav到flac 输出到同名文件
find . -name \*.wav | grep -oP '.*(?=[.])' | xargs -d '\n' -I {} ~/ffmpeg -threads 1 -i '{}.wav' -c:a flac -compression_level 8 -fflags +bitexact '{}.flac'
# 修改所有cue中的引用文件名
find . -name \*.cue | xargs -d '\n' -I {} sed -i -re 's/(FILE\s+")+(.*)(\.\w+)("\s+WAVE)/\1\2.flac\4/Ig' '{}'
#发布前署名mora flac
mkdir conv
gfind . -name \*.flac -print0 | gxargs -P 4 -0 -I {} sh -c "gsed 's/\x72\x65\x66\x65\x72\x65\x6E\x63\x65\x20\x6C\x69\x62\x46\x4C\x41\x43\x20\x31\x2E\x33\x2E\x31\x20\x32\x30\x31\x34\x31\x31\x32\x35/\x42\x6F\x75\x67\x68\x74\x20\x62\x79\x20\xE8\x9A\x82\xE8\x9A\x81\xE6\xAF\x94\xE8\xB1\xA1\xE5\xA4\xA7\x40\x54\x53\x44\x4D\x5E\x5E/g' '{}' > 'conv/{}'"
@hlgsdx
hlgsdx / SimpleHTTPServerWithUpload.py
Last active March 26, 2021 11:36 — forked from wuvei/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/env python3
########################################################################
#
# Simple HTTP server that supports file upload for moving data around
# between boxen on HTB. Based on a gist by bones7456, but mangled by me
# as I've tried (badly) to port it to Python 3, code golf it, and make
# It a little more robust. I was also able to strip out a lot of the
# code trivially because Python3 SimpleHTTPServer is a thing, and the
# cgi module handles multipart data nicely.
#
@hlgsdx
hlgsdx / getopt.c
Created July 9, 2019 06:35
getopt modified for Windows console applications from WMAEncode_0.2.9c_src
/* $OpenBSD: getopt_long.c,v 1.21 2006/09/22 17:22:05 millert Exp $ */
/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
/*
* Copyright (c) 2002 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@hlgsdx
hlgsdx / main.c
Created April 1, 2019 03:53
字符串反转
// 字符串反转 "You are so pretty." -> "pretty. so are you"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void strreverse(char *str,size_t nLength){
if(!str) return;
for(size_t i=0;i<nLength/2;++i){
if(str[i]==str[nLength-i-1]) continue;
str[i]=str[nLength-i-1] ^ str[i];