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 / 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

@641i130
641i130 / main.rs
Created May 30, 2023 20:02
rsa decrypt rust lang example
[package]
name = "rsa-decrypt"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
openssl = "0.10.53"
@641i130
641i130 / Cargo.toml
Created May 29, 2023 05:42
JSON Serialize Aes 128 Cfb Rust Example
[package]
name = "aes-json"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
aes = "0.8.2"
cfb-mode = "0.8.2"
@641i130
641i130 / shuffle.sh
Last active January 13, 2023 00:43
Cycle through multiple wallpaper folders for a proper shuffled feel. Will re-shuffle once it has done a cycle. This was written using ChatGPT and further cleanup by me.
#!/bin/bash
# Directories containing the images for both landscape and portrait
p_pics="$HOME/Pictures/Wallpapers/portrait"
l_pics="$HOME/Pictures/Wallpapers/landscape"
# File to store the shuffled images for both landscape and portrait
p_pics_shuf="$HOME/.p_pics_shuf"
l_pics_shuf="$HOME/.l_pics_shuf"
@641i130
641i130 / wallpaper.sh
Created January 3, 2023 05:36
Set random wallpaper with given folders
feh --bg-fill "$(find /landscape/images/path/ -regextype posix-extended -regex '.*\.(png|jpg|jpeg)$' -print0 |shuf -z -n 1)" "$(find /portrait/images/path/ -regextype posix-extended -regex '.*\.(png|jpg|jpeg)$' -print0 |shuf -z -n 1)"
@641i130
641i130 / song-sync.sh
Created January 3, 2023 05:35
Sync music folder with android device running SSH
#!/bin/bash
# FOR USE WITH THIS APP:
# https://play.google.com/store/apps/details?id=com.arachnoid.sshelper&gl=US&pli=1
echo "Syncing music dump to phone!!!"
echo "Press enter to continue!"
read
folder_name=$(date +%d%m%Y)
cd /home/rei/ytdl/ && mkdir $folder_name || echo "Folder was made already!!"
mv *.mp3 $folder_name
read -p "Enter IP address: " ip
@641i130
641i130 / Cargo.toml
Created November 7, 2022 18:41
check if ip / port is up as fast as possible
[package]
name = "ip-up"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
port_check = "0.1.5"
@641i130
641i130 / t-mine.py
Created July 29, 2022 21:12
Auto mine in terraria (AKA hold down buttons)
# Terraria Button Holder
# Written by 641i130
# (DVORAK KEYBOARD LAYOUT)
import pynput
import time
pm = pynput.mouse
pk = pynput.keyboard
mc = pm.Controller()
kc = pk.Controller()
@641i130
641i130 / fix-gpg-keys.sh
Created July 26, 2022 19:37
Fix the broken GPG keys on arch based operating systems. (This was written for arco linux, so I can't guarantee it'll work on anything else).
#!/bin/bash
# RUN THIS AS ROOT!!!
pacman -S archlinux-keyring arcolinux-keyring
rm -rf /var/lib/pacman/sync/
rm -rf /etc/pacman.d/gnupg/
pacman -Scc --noconfirm
pacman-key --init
pacman-key --populate archlinux
pacman-key --populate arcolinux
pacman-key --refresh-keys
@641i130
641i130 / wallpaper.sh
Created July 26, 2022 05:14
Randomly choose a picture for setting wallpapers on linux
#!/bin/bash
# Note that /landscape/ contains any image file name png,jpg,jpeg and is a landscape image and vise versa for portrait
# This works in order of monitor ID (DP-0 -> DP-2) in that order
feh --bg-fill "$(find /landscape/ -regextype posix-extended -regex '.*\.(png|jpg|jpeg)$' -print0 |shuf -z -n 1)" "$(find /portrait/ -regextype posix-extended -regex '.*\.(png|jpg|jpeg)$' -print0 |shuf -z -n 1)"