Skip to content

Instantly share code, notes, and snippets.

@echo off
@setlocal enableextensions enabledelayedexpansion
set exclude=_COMPRESSED_
for /f "tokens=*" %%a in ('dir . /b') do (
set fname=%%~na
set ext=%%~xa
if !ext!==.mp4 (
echo !fname!!ext!
echo.!fname! | findstr /C:"!exclude!">nul && (
@fnx4
fnx4 / silero_tts.py
Last active May 7, 2023 08:19
OUTDATED moved to https://github.com/fnx4/silero-tts | Silero TTS: ru txt file(s)/fb2 to WAVs/opus
#!/usr/bin/env python
import os
import re
import argparse
import concurrent
import subprocess
import uuid
import torch # cuda: 1.13.1+cu117
@fnx4
fnx4 / noty.py
Created December 25, 2021 18:46
monitor windows notifications
import os
import sqlite3
import time
from bs4 import BeautifulSoup
ids = set()
user = os.environ['USERPROFILE'].replace("\\", "/")
adr = u"file:" + user + u"/AppData/Local/Microsoft/Windows/Notifications/wpndatabase.db?mode=ro"
#!/bin/bash
folder="preview";
declare -a formats=("png" "jpg" "jpeg" "bmp" "webp");
#mkdir "$folder";
echo "push service: scanning $folder/ ...";
for ext in "${formats[@]}"; do
for file in *."$ext"; do
if [ -f "$file" ]; then
new_file="$folder/${file%.*}.jpg";
if ! [ -f "./$new_file" ]; then
@fnx4
fnx4 / .gitignore
Last active April 3, 2021 20:05
ocr to prmt
/_prmt.lnk
/_absr.lnk
@ECHO OFF
rem chcp 1251
set input_folder="C:\Users\fnx\GoogleDrive\Books"
set output_folder="F:\Books"
echo input_folder: %input_folder%
echo input_folder: %output_folder%
echo
echo --------------------------------------------
echo in:
dir /a %input_folder%
#!/bin/bash
folder="spectrogram";
declare -a formats=("mp3" "m4a" "ogg" "aac" "flac");
rm -rf "$folder";
mkdir "$folder";
for f in *."${formats[@]}" **/*."${formats[@]}"; do
if [ -f "$f" ]; then
echo "./$f";
if ! [ -f "./${f##*/}" ]; then
mkdir -p "$folder/${f%/*}";

Keybase proof

I hereby claim:

  • I am fnx4 on github.
  • I am fnx (https://keybase.io/fnx) on keybase.
  • I have a public key whose fingerprint is 0935 C2E1 F0A4 C336 CCB8 FA06 03E8 8D3C 382E C2B4

To claim this, I am signing this object:

@fnx4
fnx4 / cvs.sh
Last active March 29, 2020 11:51
#!/bin/bash
sudo find /etc/openvpn/ -name "*.conf" -type f -delete
for file in conf/*.ovpn; do
mv -f "$file" "$(basename "$file" .ovpn).conf" 2>/dev/null
done
sudo cp -r conf/* /etc/openvpn/
sudo cp auth/login /etc/openvpn/
sudo find /etc/openvpn -type f -exec sed -i 's/auth-user-pass/auth-user-pass login/g' {} \;
sudo rm -f /var/log/check-vpn-speeds.log
sudo touch /var/log/check-vpn-speeds.log
import re
with open('input.txt') as f:
a = f.read()
arr = list()
# verb ambush /ˈæˌmbʊʃ/ находиться, сидеть в засаде 1. Wait in hiding to attack. Syn: scupper, bushwhack, waylay, ... 2. Hunt (quarry) by stalking and ambushing. Syn: still-hunt.
# noun ambush /ˈæˌmbʊʃ/ засада The act of concealing yourself and lying in wait to attack by surprise. Syn: ambuscade, lying in wait, trap.
for line in a.split('\n'):