diff --git a/home/.vscode/launch.json b/home/.vscode/launch.json new file mode 100644 index 0000000..6f3c990 --- /dev/null +++ b/home/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/home/adb-music-sync/adb-music-sync.py b/home/adb-music-sync/adb-music-sync.py new file mode 100644 index 0000000..5d0ccd3 --- /dev/null +++ b/home/adb-music-sync/adb-music-sync.py @@ -0,0 +1,246 @@ +#!/usr/bin/env python3 +import os +import sys +import time +import shlex +import subprocess +import tempfile +from pathlib import Path +from typing import List, Tuple, Optional + +# --- Configuration --- +HOME = Path.home() +SOURCES = [ + HOME / "Music", + HOME / "Downloads", +] +DEST_ON_PHONE = "/sdcard/Music" +# Model tag as seen in `adb devices -l` (e.g., ... model:AGM_M7 ...) +ADB_MODEL_MATCH = ["AGM_M7", "AGM", "M7"] +POLL_INTERVAL_SEC = 60 +SIZE_LIMIT_BYTES = 7 * 1024 ** 3 # 7 GiB +MUSIC_EXTS = {".mp3", ".m4a", ".ogg", ".aac", ".opus", ".alac", ".flac"} + +# If you have a static Wi-Fi ADB endpoint, set it here (e.g., "192.168.1.50:5555"). +ADB_IP_PORT: Optional[str] = None + +# --- Helpers --- +def run(cmd: List[str], check: bool = False, text: bool = True, timeout: Optional[int] = None) -> subprocess.CompletedProcess: + try: + return subprocess.run(cmd, check=check, text=text, capture_output=True, timeout=timeout) + except Exception as e: + return subprocess.CompletedProcess(cmd, returncode=1, stdout="", stderr=str(e)) + + +def ensure_adb_server() -> None: + run(["adb", "start-server"]) # best-effort + + +def list_adb_devices() -> List[str]: + proc = run(["adb", "devices", "-l"]) # do not check, we parse regardless + if proc.returncode != 0: + return [] + lines = [ln.strip() for ln in proc.stdout.splitlines()] + # skip header line: "List of devices attached" + if lines and lines[0].lower().startswith("list of devices"): + lines = lines[1:] + return [ln for ln in lines if ln] + + +def adb_connect_if_needed(): + if not ADB_IP_PORT: + return + devices = list_adb_devices() + if any(ADB_IP_PORT in ln for ln in devices): + return # already connected + run(["adb", "connect", ADB_IP_PORT]) + + +def is_agm_connected() -> bool: + devices = list_adb_devices() + for ln in devices: + if "device" in ln and not ln.endswith("offline"): + if any(tag in ln for tag in ADB_MODEL_MATCH): + return True + return False + + +def gather_music_files() -> List[Tuple[Path, Path, float, int]]: + # Returns list of tuples: (root_dir, file_path, mtime, size) + entries: List[Tuple[Path, Path, float, int]] = [] + for root in SOURCES: + try: + if not root.exists(): + continue + for dirpath, _, filenames in os.walk(root): + dpath = Path(dirpath) + for fn in filenames: + p = dpath / fn + if p.suffix.lower() not in MUSIC_EXTS: + continue + try: + st = p.stat() + entries.append((root, p, st.st_mtime, st.st_size)) + except Exception: + continue + except Exception: + continue + # newest first by mtime + entries.sort(key=lambda t: t[2], reverse=True) + return entries + + +def select_up_to_size(entries: List[Tuple[Path, Path, float, int]], limit_bytes: int) -> List[Tuple[Path, Path, int]]: + selected: List[Tuple[Path, Path, int]] = [] + total = 0 + for root, p, _mt, sz in entries: + if total >= limit_bytes: + break + selected.append((root, p, sz)) + total += sz + return selected + + +def adb_shell(cmd: str) -> subprocess.CompletedProcess: + # Single string executed via adb shell + return run(["adb", "shell", cmd]) + + +def remote_size(adb_path: str) -> Optional[int]: + # Uses stat if available; returns None if missing + # Escape path for shell + qpath = shlex.quote(adb_path) + proc = adb_shell(f"stat -c %s {qpath}") + if proc.returncode != 0 or not proc.stdout.strip(): + return None + out = proc.stdout.strip() + if "No such file" in out or "not found" in out: + return None + try: + return int(out.splitlines()[-1].strip()) + except Exception: + return None + + +def ensure_remote_dir(adb_path: str) -> None: + # mkdir -p dirname + dirname = os.path.dirname(adb_path) + if not dirname: + return + adb_shell(f"mkdir -p {shlex.quote(dirname)}") + + +def have_ffmpeg() -> bool: + proc = run(["ffmpeg", "-version"]) + return proc.returncode == 0 + + +def transcode_flac_to_mp3(src: Path) -> Optional[Path]: + try: + tmp = tempfile.NamedTemporaryFile(suffix=".mp3", delete=False) + tmp_path = Path(tmp.name) + tmp.close() + except Exception: + return None + cmd = [ + "ffmpeg", + "-y", + "-i", + str(src), + "-vn", + "-c:a", + "libmp3lame", + "-q:a", + "2", + str(tmp_path), + ] + proc = run(cmd) + if proc.returncode != 0: + try: + tmp_path.unlink(missing_ok=True) # type: ignore[arg-type] + except Exception: + pass + return None + return tmp_path + + +def push_file(local_path: Path, remote_path: str, size: int) -> bool: + # Skip if same size exists + rsz = remote_size(remote_path) + if rsz is not None and rsz == size: + print(f"[=] Skip (same size): {local_path} -> {remote_path}") + return True + ensure_remote_dir(remote_path) + proc = run(["adb", "push", "-p", str(local_path), remote_path]) + if proc.returncode == 0: + print(f"[+] Pushed: {local_path} -> {remote_path}") + return True + else: + print(f"[!] Push failed: {local_path}\n{proc.stderr}") + return False + + +def sync_latest_batch(): + entries = gather_music_files() + if not entries: + print("[i] No music files found.") + return + batch = select_up_to_size(entries, SIZE_LIMIT_BYTES) + print(f"[i] Selected {len(batch)} files up to {SIZE_LIMIT_BYTES/(1024**3):.2f} GiB") + for root, p, sz in batch: + try: + rel = p.relative_to(root) + except Exception: + rel = p.name # fallback + if p.suffix.lower() == ".flac": + if not have_ffmpeg(): + print(f"[!] ffmpeg not available, skipping: {p}") + continue + mp3_tmp = transcode_flac_to_mp3(p) + if not mp3_tmp: + print(f"[!] Transcode failed, skipping: {p}") + continue + try: + if isinstance(rel, Path): + rel_mp3 = rel.with_suffix(".mp3") + remote = f"{DEST_ON_PHONE.rstrip('/')}/{rel_mp3.as_posix()}" + else: + remote = f"{DEST_ON_PHONE.rstrip('/')}/{Path(rel).with_suffix('.mp3').as_posix()}" + msz = mp3_tmp.stat().st_size + push_file(mp3_tmp, remote, msz) + finally: + try: + mp3_tmp.unlink() + except Exception: + pass + else: + remote = f"{DEST_ON_PHONE.rstrip('/')}/{rel.as_posix()}" + push_file(p, remote, sz) + + +def main(): + print("[i] adb-music-sync daemon starting...") + ensure_adb_server() + connected_prev = False + while True: + try: + ensure_adb_server() + adb_connect_if_needed() + connected = is_agm_connected() + if connected and not connected_prev: + print("[+] AGM M7 connected. Starting sync of latest ~7 GiB...") + sync_latest_batch() + elif not connected and connected_prev: + print("[-] AGM M7 disconnected.") + connected_prev = connected + time.sleep(POLL_INTERVAL_SEC) + except KeyboardInterrupt: + print("[i] Exiting on user interrupt.") + sys.exit(0) + except Exception as e: + print(f"[!] Error in main loop: {e}") + time.sleep(POLL_INTERVAL_SEC) + + +if __name__ == "__main__": + main() diff --git a/home/adb-music-sync/install.sh b/home/adb-music-sync/install.sh new file mode 100644 index 0000000..93ad59e --- /dev/null +++ b/home/adb-music-sync/install.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +set -euo pipefail + +SILENT=false +LOG_PREFIX="[adb-music-sync]" + +PYTHON_SCRIPT="$HOME/.linux-env/adb-music-sync/adb-music-sync.py" +INSTALL_TARGET="$HOME/.local/bin/adb-music-sync.py" +AUTOSTART_DIR="$HOME/.config/autostart" +AUTOSTART_FILE="$AUTOSTART_DIR/adb-music-sync.desktop" + +log() { + if [ "$SILENT" = true ]; then return; fi + echo "$LOG_PREFIX $*" +} + +check_and_install_deps() { + # Minimal dependency: adb + if ! command -v adb >/dev/null 2>&1; then + if command -v apt >/dev/null 2>&1; then + log "[+] Installation d'adb (apt) ..." + sudo apt update -y && sudo apt install -y adb + elif command -v dnf >/dev/null 2>&1; then + log "[+] Installation d'adb (dnf) ..." + sudo dnf install -y android-tools + elif command -v pacman >/dev/null 2>&1; then + log "[+] Installation d'adb (pacman) ..." + sudo pacman -Sy --noconfirm android-tools + else + log "[!] adb introuvable et gestionnaire de paquets inconnu. Installez adb manuellement." + fi + fi +} + +install_script() { + check_and_install_deps + + log "[+] Copie du script Python..." + mkdir -p "$(dirname "$INSTALL_TARGET")" + cp "$PYTHON_SCRIPT" "$INSTALL_TARGET" + chmod +x "$INSTALL_TARGET" + + log "[+] Création du fichier autostart..." + mkdir -p "$AUTOSTART_DIR" + cat > "$AUTOSTART_FILE" </dev/null || true + install_script &>/dev/null + ;; + *) + install_script + ;; +esac diff --git a/home/applications/android-wifi/android-wifi.desktop b/home/applications/android-wifi/android-wifi.desktop new file mode 100644 index 0000000..3319233 --- /dev/null +++ b/home/applications/android-wifi/android-wifi.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Android WiFi +Comment=Mirror and control Android devices over Wi-Fi +Exec=/home/valere/.local/bin/android-wifi.sh +Icon=/home/valere/.local/share/icons/android-wifi.svg +Terminal=false +Type=Application +Categories=Utility; +StartupNotify=true diff --git a/home/applications/android-wifi/android-wifi.sh b/home/applications/android-wifi/android-wifi.sh new file mode 100644 index 0000000..3ab89e0 --- /dev/null +++ b/home/applications/android-wifi/android-wifi.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Try to connect via scrcpy first +if ! scrcpy; then + # If scrcpy fails, try the alternative method + echo "If scrcpy fails, try the alternative method" + adb tcpip 5555 >/dev/null 2>&1 || true + MAC="0c:52:03:1e:89:9a" + for i in $(seq 1 254); do ping -c1 -W1 192.168.1.$i >/dev/null 2>&1 & done; wait + line=$(ip neigh | grep -i "$MAC" | head -n1 || true) + ip=$(printf "%s" "$line" | awk '{print $1}') + echo "${ip}:5555" + adb connect "${ip}:5555" + scrcpy +fi diff --git a/home/applications/android-wifi/android-wifi.svg b/home/applications/android-wifi/android-wifi.svg new file mode 100644 index 0000000..0ab92c2 --- /dev/null +++ b/home/applications/android-wifi/android-wifi.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/home/applications/install.sh b/home/applications/install.sh new file mode 100644 index 0000000..934071e --- /dev/null +++ b/home/applications/install.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# desktop apps +cp ~/.linux-env/applications/*/*.desktop ~/.local/share/applications/ +cp ~/.linux-env/applications/*/*.sh ~/.local/bin/ +cp ~/.linux-env/applications/*/*.svg ~/.local/share/icons/ + +chmod +x ~/.local/share/applications/*.desktop +chmod +x ~/.local/bin/*.sh + +update-desktop-database ~/.local/share/applications/ +gtk-update-icon-cache ~/.local/share/icons/ # inutile sauf si tu fais un vrai thème d'icônes diff --git a/home/applications/ratio-master/RM.exe b/home/applications/ratio-master/RM.exe new file mode 100644 index 0000000..4166198 Binary files /dev/null and b/home/applications/ratio-master/RM.exe differ diff --git a/home/applications/ratio-master/blingring.torrent b/home/applications/ratio-master/blingring.torrent new file mode 100644 index 0000000..ca6b612 Binary files /dev/null and b/home/applications/ratio-master/blingring.torrent differ diff --git a/home/applications/ratio-master/clients/Azureus_3050.client b/home/applications/ratio-master/clients/Azureus_3050.client new file mode 100644 index 0000000..1ad6666 --- /dev/null +++ b/home/applications/ratio-master/clients/Azureus_3050.client @@ -0,0 +1,7 @@ + info_hash={infohash}&peer_id={peerid}&supportcrypto=1&port={port}&azudp={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0{event}&numwant={numwant}&no_peer_id=1&compact=1&key={key}&azver=3 + User-Agent: Azureus 3.0.5.0;Windows XP;Java 1.6.0_05_nl_Connection: close_nl_Accept-Encoding: gzip_nl_Host: {host}_nl_Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2_nl_Content-type: application/x-www-form-urlencoded_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/BitComet0107.client b/home/applications/ratio-master/clients/BitComet0107.client new file mode 100644 index 0000000..a830164 --- /dev/null +++ b/home/applications/ratio-master/clients/BitComet0107.client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&natmapped=1&localip={localip}&port_type=wan&uploaded={uploaded}&downloaded={downloaded}&left={left}&numwant={numwant}&compact=1&no_peer_id=1&key={key}{event} + Host: {host}_nl_Connection: close_nl_Accpet: */*_nl_Accept-Encoding: gzip_nl_User-Agent: BitComet/1.7.12.3_nl_Pragma: no-cache_nl_Cache-Control: no-cache_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/BitComet0113.client b/home/applications/ratio-master/clients/BitComet0113.client new file mode 100644 index 0000000..96e25dc --- /dev/null +++ b/home/applications/ratio-master/clients/BitComet0113.client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&natmapped=1&localip={localip}&port_type=wan&uploaded={uploaded}&downloaded={downloaded}&left={left}&numwant={numwant}&compact=1&no_peer_id=1&key={key}{event} + Host: {host}_nl_Connection: close_nl_Accept: */*_nl_Accept-Encoding: gzip_nl_User-Agent: BitComet/1.13.6.22_nl_Pragma: no-cache_nl_Cache-Control: no-cache_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/BitSpirit_v3.5.0.275.client b/home/applications/ratio-master/clients/BitSpirit_v3.5.0.275.client new file mode 100644 index 0000000..f697cd8 Binary files /dev/null and b/home/applications/ratio-master/clients/BitSpirit_v3.5.0.275.client differ diff --git a/home/applications/ratio-master/clients/BitTorrent 6.0.3 (8642).client b/home/applications/ratio-master/clients/BitTorrent 6.0.3 (8642).client new file mode 100644 index 0000000..18c8888 --- /dev/null +++ b/home/applications/ratio-master/clients/BitTorrent 6.0.3 (8642).client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + Host: {host}_nl_User-Agent: BitTorrent/6030_nl_Accept-Encoding: gzip_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/BitTyrant_1.1.client b/home/applications/ratio-master/clients/BitTyrant_1.1.client new file mode 100644 index 0000000..75f4527 --- /dev/null +++ b/home/applications/ratio-master/clients/BitTyrant_1.1.client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&supportcrypto=1&port={port}&azudp={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}{event}&numwant={numwant}&no_peer_id=1&compact=1&key={key} + User-Agent: AzureusBitTyrant 2.5.0.0BitTyrant;Windows XP;Java 1.5.0_10_nl_Connection: close_nl_Accept-Encoding: gzip_nl_Host: {host}_nl_Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2_nl_Proxy-Connection: keep-alive_nl_Content-type: application/x-www-form-urlencoded_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/Deluge_1.1.7.client b/home/applications/ratio-master/clients/Deluge_1.1.7.client new file mode 100644 index 0000000..a96189a --- /dev/null +++ b/home/applications/ratio-master/clients/Deluge_1.1.7.client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}{event}&key={key}&compact=1&numwant={numwant}&supportcrypto=1&no_peer_id=1 + Host: {host}_nl_User-Agent: Deluge 1.1.7_nl_Connection: close_nl_Accept-Encoding: gzip_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/Deluge_1.1.9.client b/home/applications/ratio-master/clients/Deluge_1.1.9.client new file mode 100644 index 0000000..edbaf78 --- /dev/null +++ b/home/applications/ratio-master/clients/Deluge_1.1.9.client @@ -0,0 +1,9 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}{event}&key={key}&compact=1&numwant={numwant}&supportcrypto=1&no_peer_id=1 + Host: {host}_nl_User-Agent: Deluge 1.1.9_nl_Connection: close_nl_Accept-Encoding: gzip_nl_ + + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/Halite 0.3.1.1.client b/home/applications/ratio-master/clients/Halite 0.3.1.1.client new file mode 100644 index 0000000..801bbd2 --- /dev/null +++ b/home/applications/ratio-master/clients/Halite 0.3.1.1.client @@ -0,0 +1,8 @@ + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}{event}&key={key}&compact=1&numwant={numwant}&supportcrypto=1&no_peer_id=1 + Accept-Encoding: gzip_nl_User-Agent: Halite v 0.3.1.1_nl_Host: {host}_nl_ + + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/Transmission_1.06_Build_5136.client b/home/applications/ratio-master/clients/Transmission_1.06_Build_5136.client new file mode 100644 index 0000000..e83a160 --- /dev/null +++ b/home/applications/ratio-master/clients/Transmission_1.06_Build_5136.client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&corrupt=0&left={left}&compact=1&numwant={numwant}&key={key}&supportcrypto=1&requirecrypto=0{event} + Host: {host}_nl_Connection: close_nl_User-Agent: Transmission/1.06 (5136)_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/Vuze_4202.client b/home/applications/ratio-master/clients/Vuze_4202.client new file mode 100644 index 0000000..e1fe00f --- /dev/null +++ b/home/applications/ratio-master/clients/Vuze_4202.client @@ -0,0 +1,8 @@ + info_hash={infohash}&peer_id={peerid}&supportcrypto=1&port={port}&azudp={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0{event}&numwant={numwant}&no_peer_id=1&compact=1&key={key}&azver=3 + User-Agent: Azureus 4.2.0.2;Windows XP;Java 1.6.0_13_nl_Connection: close_nl_Accept-Encoding: gzip_nl_Host: {host}_nl_Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2_nl_ + + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/Vuze_4204.client b/home/applications/ratio-master/clients/Vuze_4204.client new file mode 100644 index 0000000..3ebb67a --- /dev/null +++ b/home/applications/ratio-master/clients/Vuze_4204.client @@ -0,0 +1,9 @@ + + info_hash={infohash}&peer_id={peerid}&supportcrypto=1&port={port}&azudp={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0{event}&numwant={numwant}&no_peer_id=1&compact=1&key={key}&azver=3 + User-Agent: Azureus 4.2.0.4;{osver};{javaver}_nl_Connection: close_nl_Accept-Encoding: gzip_nl_Host: {host}_nl_Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2_nl_ + + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/Vuze_4208.client b/home/applications/ratio-master/clients/Vuze_4208.client new file mode 100644 index 0000000..240d7e8 --- /dev/null +++ b/home/applications/ratio-master/clients/Vuze_4208.client @@ -0,0 +1,9 @@ + + info_hash={infohash}&peer_id={peerid}&supportcrypto=1&port={port}&azudp={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0{event}&numwant={numwant}&no_peer_id=1&compact=1&key={key}&azver=3 + User-Agent: Azureus 4.2.0.8;{osver};{javaver}_nl_Connection: close_nl_Accept-Encoding: gzip_nl_Host: {host}_nl_Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2_nl_ + + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/Vuze_4306.client b/home/applications/ratio-master/clients/Vuze_4306.client new file mode 100644 index 0000000..e06517e --- /dev/null +++ b/home/applications/ratio-master/clients/Vuze_4306.client @@ -0,0 +1,8 @@ + info_hash={infohash}&peer_id={peerid}&supportcrypto=1&port={port}&azudp={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0{event}&numwant={numwant}&no_peer_id=1&compact=1&key={key}&azver=3 + User-Agent: Azureus 4.3.0.6;{osver};{javaver}_nl_Connection: close_nl_Accept-Encoding: gzip_nl_Host: {host}_nl_Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2_nl_ + + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/Vuze_4404-Fixed.client b/home/applications/ratio-master/clients/Vuze_4404-Fixed.client new file mode 100644 index 0000000..97bed13 --- /dev/null +++ b/home/applications/ratio-master/clients/Vuze_4404-Fixed.client @@ -0,0 +1,8 @@ + info_hash={infohash}&peer_id={peerid}&supportcrypto=1&port={port}&azudp={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0{event}&numwant={numwant}&no_peer_id=1&compact=1&key={key}&azver=3 + User-Agent: Azureus 4.4.0.4;{osver};{javaver}_nl_Connection: close_nl_Accept-Encoding: gzip_nl_Host: {host}_nl_Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2_nl_ + + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/Vuze_4500-Fixed.client b/home/applications/ratio-master/clients/Vuze_4500-Fixed.client new file mode 100644 index 0000000..ed175aa --- /dev/null +++ b/home/applications/ratio-master/clients/Vuze_4500-Fixed.client @@ -0,0 +1,8 @@ + info_hash={infohash}&peer_id={peerid}&supportcrypto=1&port={port}&azudp={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0{event}&numwant={numwant}&no_peer_id=1&compact=1&key={key}&azver=3 + User-Agent: Azureus 4.5.0.0;{osver};{javaver}_nl_Connection: close_nl_Accept-Encoding: gzip_nl_Host: {host}_nl_Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2_nl_ + + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/bitlord_1.1.client b/home/applications/ratio-master/clients/bitlord_1.1.client new file mode 100644 index 0000000..ecfe4a2 --- /dev/null +++ b/home/applications/ratio-master/clients/bitlord_1.1.client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&natmapped=1&uploaded={uploaded}&downloaded={downloaded}&left={left}&numwant={numwant}&compact=1&no_peer_id=1&key={key}{event} + User-Agent: BitTorrent/3.4.2_nl_Connection: close_nl_Accept-Encoding: gzip, deflate_nl_Host: {host}_nl_Cache-Control: no-cache_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/burst_310b.client b/home/applications/ratio-master/clients/burst_310b.client new file mode 100644 index 0000000..dab3007 --- /dev/null +++ b/home/applications/ratio-master/clients/burst_310b.client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&key={key}&uploaded={uploaded}&downloaded={downloaded}&left={left}&compact=1{event} + Host: {host}_nl_Accept-Encoding: gzip_nl_User-Agent: BitTorrent/brst1.1.3_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/uTorrent_1.8.3_(build_15772).client b/home/applications/ratio-master/clients/uTorrent_1.8.3_(build_15772).client new file mode 100644 index 0000000..cbe0d9e Binary files /dev/null and b/home/applications/ratio-master/clients/uTorrent_1.8.3_(build_15772).client differ diff --git a/home/applications/ratio-master/clients/uTorrent_1.8.3_(build_16010).client b/home/applications/ratio-master/clients/uTorrent_1.8.3_(build_16010).client new file mode 100644 index 0000000..584414b Binary files /dev/null and b/home/applications/ratio-master/clients/uTorrent_1.8.3_(build_16010).client differ diff --git a/home/applications/ratio-master/clients/uTorrent_1.8.4_(build_16286).client b/home/applications/ratio-master/clients/uTorrent_1.8.4_(build_16286).client new file mode 100644 index 0000000..e7ec1ac Binary files /dev/null and b/home/applications/ratio-master/clients/uTorrent_1.8.4_(build_16286).client differ diff --git a/home/applications/ratio-master/clients/uTorrent_1.8.4_(build_16301).client b/home/applications/ratio-master/clients/uTorrent_1.8.4_(build_16301).client new file mode 100644 index 0000000..c9fd235 Binary files /dev/null and b/home/applications/ratio-master/clients/uTorrent_1.8.4_(build_16301).client differ diff --git a/home/applications/ratio-master/clients/utorrent_1.7.7_build_(8179).client b/home/applications/ratio-master/clients/utorrent_1.7.7_build_(8179).client new file mode 100644 index 0000000..3e01617 --- /dev/null +++ b/home/applications/ratio-master/clients/utorrent_1.7.7_build_(8179).client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + Host: {host}_nl_User-Agent: uTorrent/1770_nl_Accept-Encoding: gzip_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/utorrent_1.8.1_(build_12616).client b/home/applications/ratio-master/clients/utorrent_1.8.1_(build_12616).client new file mode 100644 index 0000000..9365545 --- /dev/null +++ b/home/applications/ratio-master/clients/utorrent_1.8.1_(build_12616).client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + Host: {host}_nl_User-Agent: uTorrent/1810_nl_Accept-Encoding: gzip_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/utorrent_1.8.1_(build_12639).client b/home/applications/ratio-master/clients/utorrent_1.8.1_(build_12639).client new file mode 100644 index 0000000..010fcd3 --- /dev/null +++ b/home/applications/ratio-master/clients/utorrent_1.8.1_(build_12639).client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + Host: {host}_nl_User-Agent: uTorrent/1810_nl_Accept-Encoding: gzip_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/utorrent_1.8.2_(build_15227).client b/home/applications/ratio-master/clients/utorrent_1.8.2_(build_15227).client new file mode 100644 index 0000000..96a0c69 --- /dev/null +++ b/home/applications/ratio-master/clients/utorrent_1.8.2_(build_15227).client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + Host: {host}_nl_User-Agent: uTorrent/1820_nl_Accept-Encoding: gzip_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/utorrent_1.8.2_(build_15296).client b/home/applications/ratio-master/clients/utorrent_1.8.2_(build_15296).client new file mode 100644 index 0000000..141c05d Binary files /dev/null and b/home/applications/ratio-master/clients/utorrent_1.8.2_(build_15296).client differ diff --git a/home/applications/ratio-master/clients/utorrent_1.8.2_(build_15357).client b/home/applications/ratio-master/clients/utorrent_1.8.2_(build_15357).client new file mode 100644 index 0000000..80a6d60 Binary files /dev/null and b/home/applications/ratio-master/clients/utorrent_1.8.2_(build_15357).client differ diff --git a/home/applications/ratio-master/clients/utorrent_1.8.2_build(14153).client b/home/applications/ratio-master/clients/utorrent_1.8.2_build(14153).client new file mode 100644 index 0000000..40c9bec --- /dev/null +++ b/home/applications/ratio-master/clients/utorrent_1.8.2_build(14153).client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + User-Agent: uTorrent/1820_nl_Accept-Encoding: gzip, deflate_nl_Host: {host}_nl_Cache-Control: no-cache_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/utorrent_1.8.2_build(14458).client b/home/applications/ratio-master/clients/utorrent_1.8.2_build(14458).client new file mode 100644 index 0000000..303882f --- /dev/null +++ b/home/applications/ratio-master/clients/utorrent_1.8.2_build(14458).client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + User-Agent: uTorrent/1820_nl_Accept-Encoding: gzip, deflate_nl_Host: {host}_nl_Cache-Control: no-cache_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/utorrent_1.8.2_build_15167.client b/home/applications/ratio-master/clients/utorrent_1.8.2_build_15167.client new file mode 100644 index 0000000..c065de6 --- /dev/null +++ b/home/applications/ratio-master/clients/utorrent_1.8.2_build_15167.client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + Host: {host}_nl_User-Agent: uTorrent/1820_nl_Accept-Encoding: gzip_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/utorrent_1.8.3_build_15728.client b/home/applications/ratio-master/clients/utorrent_1.8.3_build_15728.client new file mode 100644 index 0000000..83aa335 --- /dev/null +++ b/home/applications/ratio-master/clients/utorrent_1.8.3_build_15728.client @@ -0,0 +1,9 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + Host: {host}_nl_User-Agent: uTorrent/1830(15728)_nl_Accept-Encoding: gzip_nl_ + + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/utorrent_1.8.4_(build_16667).client b/home/applications/ratio-master/clients/utorrent_1.8.4_(build_16667).client new file mode 100644 index 0000000..c3dec23 Binary files /dev/null and b/home/applications/ratio-master/clients/utorrent_1.8.4_(build_16667).client differ diff --git a/home/applications/ratio-master/clients/utorrent_1.8.4_(build_16688).client b/home/applications/ratio-master/clients/utorrent_1.8.4_(build_16688).client new file mode 100644 index 0000000..99f97aa Binary files /dev/null and b/home/applications/ratio-master/clients/utorrent_1.8.4_(build_16688).client differ diff --git a/home/applications/ratio-master/clients/utorrent_1.8.4_build_(16150).client b/home/applications/ratio-master/clients/utorrent_1.8.4_build_(16150).client new file mode 100644 index 0000000..8954bd9 --- /dev/null +++ b/home/applications/ratio-master/clients/utorrent_1.8.4_build_(16150).client @@ -0,0 +1,9 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + Host: {host}_nl_User-Agent: uTorrent/1840(16150)_nl_Accept-Encoding: gzip_nl_ + + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/utorrent_1.8.5_(build_17091).client b/home/applications/ratio-master/clients/utorrent_1.8.5_(build_17091).client new file mode 100644 index 0000000..84728e6 Binary files /dev/null and b/home/applications/ratio-master/clients/utorrent_1.8.5_(build_17091).client differ diff --git a/home/applications/ratio-master/clients/utorrent_1.8.5_(build_17414).client b/home/applications/ratio-master/clients/utorrent_1.8.5_(build_17414).client new file mode 100644 index 0000000..e70fdaa Binary files /dev/null and b/home/applications/ratio-master/clients/utorrent_1.8.5_(build_17414).client differ diff --git a/home/applications/ratio-master/clients/utorrent_1.8_(build_11813).client b/home/applications/ratio-master/clients/utorrent_1.8_(build_11813).client new file mode 100644 index 0000000..a015a6e --- /dev/null +++ b/home/applications/ratio-master/clients/utorrent_1.8_(build_11813).client @@ -0,0 +1,8 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + Host: {host}_nl_User-Agent: uTorrent/1800_nl_Accept-Encoding: gzip_nl_ + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/utorrent_2.0.4_(build_21586).client b/home/applications/ratio-master/clients/utorrent_2.0.4_(build_21586).client new file mode 100644 index 0000000..a7ff627 Binary files /dev/null and b/home/applications/ratio-master/clients/utorrent_2.0.4_(build_21586).client differ diff --git a/home/applications/ratio-master/clients/utorrent_2.0.4_build_21431.client b/home/applications/ratio-master/clients/utorrent_2.0.4_build_21431.client new file mode 100644 index 0000000..fae0c04 --- /dev/null +++ b/home/applications/ratio-master/clients/utorrent_2.0.4_build_21431.client @@ -0,0 +1,10 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + Host: {host}_nl_User-Agent: uTorrent/2040(21431)_nl_Accept-Encoding: gzip_nl_ + + + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/clients/utorrent_2.0.4_build_21515.client b/home/applications/ratio-master/clients/utorrent_2.0.4_build_21515.client new file mode 100644 index 0000000..c8b2cee --- /dev/null +++ b/home/applications/ratio-master/clients/utorrent_2.0.4_build_21515.client @@ -0,0 +1,10 @@ + + info_hash={infohash}&peer_id={peerid}&port={port}&uploaded={uploaded}&downloaded={downloaded}&left={left}&corrupt=0&key={key}{event}&numwant={numwant}&compact=1&no_peer_id=1 + Host: {host}_nl_User-Agent: uTorrent/2040(21515)_nl_Accept-Encoding: gzip_nl_ + + + + + + + \ No newline at end of file diff --git a/home/applications/ratio-master/lng/1english.lng b/home/applications/ratio-master/lng/1english.lng new file mode 100644 index 0000000..3415751 Binary files /dev/null and b/home/applications/ratio-master/lng/1english.lng differ diff --git a/home/applications/ratio-master/lng/Arabic.lng b/home/applications/ratio-master/lng/Arabic.lng new file mode 100644 index 0000000..beca11d Binary files /dev/null and b/home/applications/ratio-master/lng/Arabic.lng differ diff --git a/home/applications/ratio-master/lng/Armenian.lng b/home/applications/ratio-master/lng/Armenian.lng new file mode 100644 index 0000000..cd57e05 Binary files /dev/null and b/home/applications/ratio-master/lng/Armenian.lng differ diff --git a/home/applications/ratio-master/lng/Danish.lng b/home/applications/ratio-master/lng/Danish.lng new file mode 100644 index 0000000..a7a2517 Binary files /dev/null and b/home/applications/ratio-master/lng/Danish.lng differ diff --git a/home/applications/ratio-master/lng/Korean.lng b/home/applications/ratio-master/lng/Korean.lng new file mode 100644 index 0000000..8d8b52e Binary files /dev/null and b/home/applications/ratio-master/lng/Korean.lng differ diff --git a/home/applications/ratio-master/lng/bulgarian.lng b/home/applications/ratio-master/lng/bulgarian.lng new file mode 100644 index 0000000..6f88897 Binary files /dev/null and b/home/applications/ratio-master/lng/bulgarian.lng differ diff --git a/home/applications/ratio-master/lng/chinese.lng b/home/applications/ratio-master/lng/chinese.lng new file mode 100644 index 0000000..a42f00f Binary files /dev/null and b/home/applications/ratio-master/lng/chinese.lng differ diff --git a/home/applications/ratio-master/lng/french.lng b/home/applications/ratio-master/lng/french.lng new file mode 100644 index 0000000..adcaa02 Binary files /dev/null and b/home/applications/ratio-master/lng/french.lng differ diff --git a/home/applications/ratio-master/lng/german.lng b/home/applications/ratio-master/lng/german.lng new file mode 100644 index 0000000..dea5842 Binary files /dev/null and b/home/applications/ratio-master/lng/german.lng differ diff --git a/home/applications/ratio-master/lng/hebrew.lng b/home/applications/ratio-master/lng/hebrew.lng new file mode 100644 index 0000000..50a517f Binary files /dev/null and b/home/applications/ratio-master/lng/hebrew.lng differ diff --git a/home/applications/ratio-master/lng/hungarian.lng b/home/applications/ratio-master/lng/hungarian.lng new file mode 100644 index 0000000..8cfc7da Binary files /dev/null and b/home/applications/ratio-master/lng/hungarian.lng differ diff --git a/home/applications/ratio-master/lng/italian.lng b/home/applications/ratio-master/lng/italian.lng new file mode 100644 index 0000000..f1c476a Binary files /dev/null and b/home/applications/ratio-master/lng/italian.lng differ diff --git a/home/applications/ratio-master/lng/lithuanian.lng b/home/applications/ratio-master/lng/lithuanian.lng new file mode 100644 index 0000000..9ba777f Binary files /dev/null and b/home/applications/ratio-master/lng/lithuanian.lng differ diff --git a/home/applications/ratio-master/lng/polish.lng b/home/applications/ratio-master/lng/polish.lng new file mode 100644 index 0000000..6ad869b Binary files /dev/null and b/home/applications/ratio-master/lng/polish.lng differ diff --git a/home/applications/ratio-master/lng/portuguese.lng b/home/applications/ratio-master/lng/portuguese.lng new file mode 100644 index 0000000..12cdd15 Binary files /dev/null and b/home/applications/ratio-master/lng/portuguese.lng differ diff --git a/home/applications/ratio-master/lng/romanian.lng b/home/applications/ratio-master/lng/romanian.lng new file mode 100644 index 0000000..2d83719 Binary files /dev/null and b/home/applications/ratio-master/lng/romanian.lng differ diff --git a/home/applications/ratio-master/lng/russian.lng b/home/applications/ratio-master/lng/russian.lng new file mode 100644 index 0000000..9765a3c Binary files /dev/null and b/home/applications/ratio-master/lng/russian.lng differ diff --git a/home/applications/ratio-master/lng/slovenian.lng b/home/applications/ratio-master/lng/slovenian.lng new file mode 100644 index 0000000..a3558c3 Binary files /dev/null and b/home/applications/ratio-master/lng/slovenian.lng differ diff --git a/home/applications/ratio-master/lng/spanish.lng b/home/applications/ratio-master/lng/spanish.lng new file mode 100644 index 0000000..4868c61 Binary files /dev/null and b/home/applications/ratio-master/lng/spanish.lng differ diff --git a/home/applications/ratio-master/lng/swedish.lng b/home/applications/ratio-master/lng/swedish.lng new file mode 100644 index 0000000..07f724f Binary files /dev/null and b/home/applications/ratio-master/lng/swedish.lng differ diff --git a/home/applications/ratio-master/lng/thai.lng b/home/applications/ratio-master/lng/thai.lng new file mode 100644 index 0000000..feb42ea Binary files /dev/null and b/home/applications/ratio-master/lng/thai.lng differ diff --git a/home/applications/ratio-master/lng/turkish.lng b/home/applications/ratio-master/lng/turkish.lng new file mode 100644 index 0000000..c96e115 Binary files /dev/null and b/home/applications/ratio-master/lng/turkish.lng differ diff --git a/home/applications/ratio-master/lng/ukrainian.lng b/home/applications/ratio-master/lng/ukrainian.lng new file mode 100644 index 0000000..ebf4968 Binary files /dev/null and b/home/applications/ratio-master/lng/ukrainian.lng differ diff --git a/home/applications/ratio-master/lng/vietnamese.lng b/home/applications/ratio-master/lng/vietnamese.lng new file mode 100644 index 0000000..28be707 Binary files /dev/null and b/home/applications/ratio-master/lng/vietnamese.lng differ diff --git a/home/applications/ratio-master/ratio-master.desktop b/home/applications/ratio-master/ratio-master.desktop new file mode 100755 index 0000000..3a14390 --- /dev/null +++ b/home/applications/ratio-master/ratio-master.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=RatioMaster +Comment=Ratio spoofing tool for torrents +Exec=wine /home/valere/.local/bin/RatioMaster/RM.exe +Path=/home/valere/.local/bin/RatioMaster +Icon=/home/valere/.local/bin/RatioMaster/logo.svg +Terminal=false +Type=Application +Categories=Network;P2P; +StartupNotify=true diff --git a/home/applications/ratio-master/ratio-master.svg b/home/applications/ratio-master/ratio-master.svg new file mode 100644 index 0000000..42525bb --- /dev/null +++ b/home/applications/ratio-master/ratio-master.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + diff --git a/home/applications/ratio-master/ratiomaster.config b/home/applications/ratio-master/ratiomaster.config new file mode 100644 index 0000000..a9266ac --- /dev/null +++ b/home/applications/ratio-master/ratiomaster.config @@ -0,0 +1,42 @@ + + + 0 + true + 100 + 55003.37 + 0.21 + 1800 + 11 + true + true + true + false + + WMAAIhLqVx + + -TR1060-pauut3h9agwn + + + + + 0 + true + true + true + 50000 + 100000 + 0 + 4 + false + C:\users\valere\Desktop\Downloads\l.horloger.de.saint-paul.1974.VOF RESTAUREE.1080p.BDrip.x265.FLAC-AZAZE.mkv.torrent + 1164387932F4CB6B1267B3ABA7E0A4CD26593E14 + 0 + 1000 + -1 + Z:\home\valere\.local\bin\RatioMaster\lng\1english.lng + default + true + false + false + false + \ No newline at end of file diff --git a/home/applications/ratio-master/rm_updates.xml b/home/applications/ratio-master/rm_updates.xml new file mode 100644 index 0000000..e69de29 diff --git a/home/applications/ratio-master/torrent.torrent b/home/applications/ratio-master/torrent.torrent new file mode 100644 index 0000000..d7b5b90 Binary files /dev/null and b/home/applications/ratio-master/torrent.torrent differ diff --git a/home/bashrc/.bashrc b/home/bashrc/.bashrc new file mode 100644 index 0000000..3507465 --- /dev/null +++ b/home/bashrc/.bashrc @@ -0,0 +1,106 @@ +# .linux-env +VIDEO_DIR_LOCAL="/home/valere/Downloads" +IMAGE_DIR_LOCAL="/home/valere/Downloads" +MUSIC_DIR_LOCAL="/home/valere/evilspins/web/mnt/media/files/music" + +VIDEO_PATH="/home/root/media/video/autre" +IMAGE_PATH="/home/root/media/image/screenshit" +MUSIC_DIR="/home/root/media/files/music" + +dlvideo() { + cd "$VIDEO_DIR" || return + pip install -U yt-dlp + yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4" --merge-output-format mp4 "$@" +} + +dlimage() { + wget -P "$IMAGE_DIR" "$1" +} + +dlcover() { + query_or_file="$1" + manual_url="$2" + + + if [ -f "$query_or_file" ]; then + file="$query_or_file" + elif echo "$query_or_file" | grep -q '%(ext)'; then + file="$query_or_file" + else + file=$(find "$MUSIC_DIR" -type f \ + \( -iname "*${query_or_file}*.mp3" -o -iname "*${query_or_file}*.m4a" -o -iname "*${query_or_file}*.flac" -o -iname "*${query_or_file}*.wav" -o -iname "*${query_or_file}*.ogg" \) \ + | head -n 1) + fi + + if [ -z "$file" ]; then + echo "❌ Aucun fichier trouvé pour: $query_or_file" + return 1 + fi + + base="${file%.*}" + + if [ -n "$manual_url" ]; then + curl -s "$manual_url" -o "${base}.jpg" + echo "✅ ${base}.jpg saved from manual URL (fichier: $file)" + return + fi + + artist_raw=$(echo "$base" | awk -F'__' '{print $2}') + title_raw=$(echo "$base" | awk -F'__' '{for(i=3;i<=NF;i++){printf (i>3?" ":""); printf $i}}') + artist=$(echo "$artist_raw" | tr '_' ' ') + title=$(echo "$title_raw" | tr '_' ' ') + query_enc=$(jq -rn --arg s "$artist $title" '$s|@uri') + + it_url="https://itunes.apple.com/search?term=${query_enc}&entity=song&limit=1" + art=$(curl -s "$it_url" | jq -r '.results[0].artworkUrl100') + if [ -n "$art" ] && [ "$art" != "null" ]; then + art_hi=$(echo "$art" | sed 's/100x100bb/1000x1000bb/') + curl -s "$art_hi" -o "${base}.jpg" + echo "✅ ${base}.jpg saved from iTunes (fichier: $file)" + return + fi + + api_key="5ae5d1212599f96ffa799e21da1b2a7a38274c94bb5ae8ad26ce8d5b08528aaa" + url=$(curl -s "https://serpapi.com/search.json?engine=google&q=${query_enc}&tbm=isch&api_key=${api_key}" \ + | jq -r '.images_results[0].original') + + if [ -n "$url" ] && [ "$url" != "null" ]; then + curl -s "$url" -o "${base}.jpg" + echo "✅ ${base}.jpg saved from Google Images (fichier: $file)" + else + echo "❌ No cover found for $artist - $title (fichier: $file)" + fi +} + +dlmusic() { + mkdir -p "$MUSIC_PATH" + + NOW=$(date +"%Y%m%d%H") + URL="$1" + + # Récupère le titre + TITLE=$(yt-dlp --get-title "$URL") + + # Transforme le titre pour le nom de fichier + SAFE_TITLE="${TITLE// - /__}" + SAFE_TITLE="${SAFE_TITLE// /_}" + + TRACK_NAME="$MUSIC_PATH/${NOW}__${SAFE_TITLE}.%(ext)s" + + # Téléchargement + yt-dlp -x --audio-format mp3 -o $TRACK_NAME "$URL" + dlcover $TRACK_NAME +} + +search() { + find ./ -iname "*$1*" +} + +searchinside() { + grep -rwl "$1" ./ +} + +alias evilsync='rsync -avz --delete -e ssh $MUSIC_DIR_LOCAL root@erudi.fr:$MUSIC_DIR' +alias evildiff='rsync -avzn --delete -e ssh $MUSIC_DIR_LOCAL root@erudi.fr:$MUSIC_DIR' + +# end .linux-env diff --git a/home/bashrc/install.sh b/home/bashrc/install.sh new file mode 100644 index 0000000..33375e2 --- /dev/null +++ b/home/bashrc/install.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +sed -i '/# .linux-env/,/# .linux-env/d' ~/.bashrc +cat ~/.linux-env/bashrc/.bashrc >> ~/.bashrc diff --git a/home/gamecube-pad/gamecube-pad.py b/home/gamecube-pad/gamecube-pad.py new file mode 100644 index 0000000..2526997 --- /dev/null +++ b/home/gamecube-pad/gamecube-pad.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python3 +import evdev +import subprocess +import time + +DEVICE_NAMES = ["8BitDo NGC Modkit"] +BUTTON_MAP = { + "304": "Return", # A + "305": None, # B (non utilisé) + "311": "Alt_L", # R + "307": "Right", # X + "308": "Left", # Y + # 318 (BTN_THUMBR) sera géré à part +} + +def find_device(): + for path in evdev.list_devices(): + try: + dev = evdev.InputDevice(path) + if any(dn in dev.name for dn in DEVICE_NAMES): + return path + except Exception: + continue + return None + +def is_dolphin_running(): + try: + output = subprocess.check_output(["flatpak", "ps"]).decode() + return "org.DolphinEmu.dolphin-emu" in output + except Exception: + return False + +def press_key(key, press): + # press=True -> key down, press=False -> key up + action = "keydown" if press else "keyup" + subprocess.run(["xdotool", action, key]) + +def handle_device(dev_path): + dev = evdev.InputDevice(dev_path) + try: + for event in dev.read_loop(): + if event.type != evdev.ecodes.EV_KEY: + continue + + key_code = str(event.code) + + # cas spécial : joystick jaune (BTN_THUMBR, code 318) + if key_code == "318" and event.value == 1: # pression + press_key("Alt_L", True) + time.sleep(0.02) + press_key("Escape", True) + time.sleep(0.05) + press_key("Escape", False) + press_key("Alt_L", False) + continue + + if key_code in BUTTON_MAP: + mapped_key = BUTTON_MAP[key_code] + if mapped_key is not None: + press_key(mapped_key, event.value == 1) + + except OSError: + dev.close() + raise + +def main(): + connected = False + time.sleep(5) # délai pour que le serveur graphique soit prêt + while True: + dev_path = find_device() + if dev_path and not connected: + print(f"[+] Manette connectée: {dev_path}") + connected = True + if not is_dolphin_running(): + try: + subprocess.Popen(["flatpak", "run", "org.DolphinEmu.dolphin-emu"]) + except Exception as e: + print(f"[!] Impossible de lancer Dolphin: {e}") + try: + handle_device(dev_path) + except OSError: + print("[-] Manette déconnectée") + connected = False + try: + subprocess.Popen(["flatpak", "kill", "org.DolphinEmu.dolphin-emu"]) + except Exception as e: + print(f"[!] Impossible de tuer Dolphin: {e}") + elif not dev_path and connected: + print("[-] Manette déconnectée") + connected = False + time.sleep(1) + +if __name__ == "__main__": + main() diff --git a/home/gamecube-pad/install.sh b/home/gamecube-pad/install.sh new file mode 100755 index 0000000..e81c0f2 --- /dev/null +++ b/home/gamecube-pad/install.sh @@ -0,0 +1,77 @@ +#!/bin/bash +set -e + +PYTHON_SCRIPT="$HOME/.local/bin/gamecube-pad.py" +AUTOSTART_DIR="$HOME/.config/autostart" +AUTOSTART_FILE="$AUTOSTART_DIR/gamecube-pad.desktop" + +SILENT=false +if [[ "$1" == "silent" ]]; then + SILENT=true +fi + +log() { + if [ "$SILENT" = false ]; then + echo "$@" + fi +} + +check_and_install_deps() { + for pkg in evdev uinput; do + if ! python3 -c "import $pkg" &>/dev/null; then + log "[!] Dépendance manquante : $pkg. Installation avec pip..." + python3 -m pip install --user "$pkg" &>/dev/null + fi + done + + for cmd in xdotool wmctrl; do + if ! command -v "$cmd" &>/dev/null; then + log "[!] Commande manquante : $cmd. Merci de l’installer via votre gestionnaire de paquets." + fi + done +} + +install_script() { + check_and_install_deps + + log "[+] Copie du script Python..." + mkdir -p "$(dirname "$PYTHON_SCRIPT")" + cp "$HOME/.linux-env/gamecube-pad/gamecube-pad.py" "$PYTHON_SCRIPT" + chmod +x "$PYTHON_SCRIPT" + + log "[+] Création du fichier autostart..." + mkdir -p "$AUTOSTART_DIR" + cat > "$AUTOSTART_FILE" </dev/null + install_script &>/dev/null + ;; + *) + install_script + ;; +esac diff --git a/home/install.sh b/home/install.sh new file mode 100755 index 0000000..b5a13c7 --- /dev/null +++ b/home/install.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -e + +# Chemin de base : le dossier où se trouve ce script +BASE_DIR="$(dirname "$(realpath "$0")")" + +echo "[+] Recherche et exécution des install.sh..." + +# Boucle récursive sur tous les fichiers install.sh +find "$BASE_DIR" -type f -name "install.sh" ! -path "$BASE_DIR/install.sh" | while read -r script; do + echo "[+] Lancement : $script" + chmod +x "$script" + "$script" +done + +echo "[✓] Tous les install.sh ont été exécutés." diff --git a/pre-commit b/pre-commit new file mode 100644 index 0000000..5c1d3a6 --- /dev/null +++ b/pre-commit @@ -0,0 +1,7 @@ +#!/bin/sh + +# install bashrc if bashrc git edited +if git diff --quiet home/bashrc/.bashrc; then +else + ./home/bashrc/install.sh +fi