Skip to content

Instantly share code, notes, and snippets.

View 641i130's full-sized avatar
🦀
Rewrite it in rust!

Caret 641i130

🦀
Rewrite it in rust!
View GitHub Profile
@641i130
641i130 / Cargo.toml
Last active November 20, 2024 03:46
actix web static mapping with functions
[package]
name = "mapactix"
version = "0.1.0"
edition = "2021"
[dependencies]
actix-web = "4.9.0"
futures = "0.3.31"
phf = {version = "0.11.2", features = ["macros"]}
@641i130
641i130 / kotoba.scad
Created September 22, 2024 16:56
Japanese vocabulary word generator tag thing
/// This script will generate 3D objects of word tags for language learning purposes
scale([3,3,3]) {
// word values
word = "心配-しんぱい";
word_h = 1;
font_size = 4;
// base values
base = 4;
height = 0.5;
linear_extrude(height = word_h)
@641i130
641i130 / xpra.service
Created March 11, 2024 21:07
xpra-user.service
# cat ~/.config/systemd/user/xpra.service
[Unit]
Description=xpra user service
[Service]
Type=simple
ExecStart=/usr/bin/xpra start-desktop --no-daemon --resize-display="1920x1080" --start-child=cinnamon-session-cinnamon
[Install]
WantedBy=default.target
@641i130
641i130 / TraceDetailedDNSLogs.ps1
Created January 8, 2024 16:35 — forked from i128/TraceDetailedDNSLogs.ps1
Simple Script for Parsing Detailed DNS Debug Logs
function Get-DNSDebugLog
{
<#
.SYNOPSIS
This cmdlet parses a Windows DNS Debug log with details.
Author: @jarsnah12
License: BSD 3-Clause
Required Dependencies: None
Optional Dependencies: None
@641i130
641i130 / run.py
Created November 3, 2023 16:10
Fast NMAP Filter IP List Maker
import re
import subprocess
from os.path import exists
# Ask the user for the CIDR range to scan
cidr_range = input("Enter the CIDR range to scan (e.g., '10.10.4.0/22'): ")
if cidr_range == "":
cidr_range = "10.10.4.0/22"
if not exists("./scan.txt"):
try:
@641i130
641i130 / run.py
Created October 16, 2023 03:11
m3u to smpl converter
# M3U to Samsung SMPL Playlist Converter
# Written by ChatGPT
# This script converts an M3U playlist file to the Samsung SMPL format. It reads an M3U file, extracts file paths,
# and generates a Samsung SMPL JSON file with a "members" array, where each item represents a file from the M3U playlist.
# Samsung SMPL format is old but used in the samsung music app here: https://github.com/AyraHikari/SamsungMusicPort
import json
import json
@641i130
641i130 / main.cpp
Created September 20, 2023 16:06
Simple curl download example
#include <iostream>
#include <fstream>
#include <curl/curl.h>
// g++ -o test test.cpp -lcurl
// Callback function to write data to a file
size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp)
{
size_t totalSize = size * nmemb;
std::ofstream* fileStream = static_cast<std::ofstream*>(userp);
@641i130
641i130 / wallpaper-single-monitor.sh
Created August 19, 2023 05:34
Randomly shuffle over 20 images script
#!/bin/bash
# Assuming this Wallpapers folder is a nas mount
IMAGE_DIR="/home/user/Wallpapers/cats/"
TMP_DIR="/tmp/wallpapers"
NUM_IMAGES=20
# Create temporary directory if it doesn't exist
mkdir -p $TMP_DIR
# Check if the temporary directory is empty
@641i130
641i130 / README.md
Created August 19, 2023 05:33
Minecraft SSH Port Tunnel

MC Port Tunnel SSH Service

Usecase -> not able to port forward in your network.

Assumptions: 12345 is the mc server's port that its opening on the remote server (25565). User mc is the user on the minecraft server. User minecraft is the user on the cloud SSH server.

If you have fail2ban installed, make sure to add the following to /etc/fail2ban/jail.local:

@641i130
641i130 / README.md
Last active June 21, 2023 00:10
Dataset Workflow

Dataset Workflow

This assumes you're using a Linux system (or WSL) with modern python3 and sox.

  1. First, download the stream(s) you want to use for the dataset. The requirements are, it must be as clean as possible, and primarily the target voice talking a ton. Streams like Minecraft streams tend to be ideal. (This uses yt-dlp) Use the command below to download the stream(s): yt-dlp -f ba -x --audio-format "wav" --audio-quality 0 --embed-metadata https://youtu.be/omegalul

  2. Once you have the stream, you'll need to split it into multiple files because it's too computationally hard to process a 3 hour stream. Use the command below to split the file based off of the silence it detects. This may result in longer files if the background sounds/music are as loud as the speech in the source. This command assumes the input stream is input.wav: sox -V3 input.wav split.wav silence 1 5.0 0.1% 1 0.3 0.1% : newfile : restart