Skip to content

Instantly share code, notes, and snippets.

View Cyberes's full-sized avatar
💭
💀 Deceased (as of Jan, 2022)

Cyberes

💭
💀 Deceased (as of Jan, 2022)
View GitHub Profile
* g o a t s e x * g o a t s e x * g o a t s e x *
g g
o / \ \ / \ o
a| | \ | | a
t| `. | | : t
s` | | \| | s
e \ | / / \\\ --__ \\ : e
x \ \/ _--~~ ~--__| \ | x
* \ \_-~ ~-_\ | *
g \_ \ _.--------.______\| | g
@Cyberes
Cyberes / slideshow-to-beat.py
Last active July 10, 2024 09:26
Sync a slideshow to every single beat in a song.
#!/usr/bin/env python3
import argparse
import random
import cv2
import librosa
import numpy as np
from moviepy.editor import *
from scipy.signal import butter, lfilter
from scipy.signal import find_peaks
@Cyberes
Cyberes / sillytavern-chat-to-txt-gpt4.py
Last active May 26, 2023 07:06
Convert SillyTavern jsonl chats to TXT files using AI.
#!/usr/bin/env python3
import argparse
import re
from pathlib import Path
import sys
import json
import openai
import tiktoken
import threading
import traceback
@Cyberes
Cyberes / sillytavern-chat-to-txt.py
Last active June 22, 2023 03:04
Convert SillyTavern jsonl chats to TXT files
#!/usr/bin/env python3
import argparse
import re
from pathlib import Path
import sys
import json
"""
Convert SillyTavern jsonl chats to TXT files.
@Cyberes
Cyberes / Tunneling Proxy for Paperspace.md
Last active August 18, 2024 13:27
Tunneling Proxy for Paperspace

Tunneling Proxy for Paperspace

Gradio's reverse proxy service sucks. The WebUI program integrates ngrok to fix this issue which works well but Paperspace locks your account for using any tunneling proxy service such as (who knows how many they explicitly ban).

There is literally no easy solution for this and you must to host your own server that Paperspace doesn't know about. What I do is run a rathole server on a $4 DigitalOcean VPS.

@Cyberes
Cyberes / default.conf
Last active February 14, 2023 23:01
Fix Matrix Synapse not allowing video seeking (nginx)
# Fix video buffering
# https://github.com/matrix-org/synapse/issues/4780#issuecomment-1003101558
# luarocks install pgmoon
set $our_homeserver "matrix.example.com"; # Set this to the hostname of your server
set $media_store "/var/lib/matrix-synapse/media"; # no trailing slash
set $media_status_header true; # add a header to show the status of the media.
location ~* "^/_matrix/media/r0/download/(.*?)/([A-Za-z0-9]{2})([A-Za-z0-9]{2})(.*)$" {
# Enable video seeking.
@Cyberes
Cyberes / How to re-implement remove-background in ocrmypdf.md
Last active February 3, 2023 22:58
Re-implement --remove-background in OCRmyPDF

I needed --remove-background so I re-implemented this feature myself.

https://github.com/ocrmypdf/OCRmyPDF

Build Dependencies

Leptonica

This feature requires Leptonica, an image processing and analysis library. You have to build it from source, which is why it was removed from OCRmyPDF.

@Cyberes
Cyberes / mega_audio.sh
Last active December 15, 2022 10:08
Random Video Montage
# I wrote this to combine a bunch of audio files for the random video script above
# I didn't use this because ffmpeg messed up some of my .ogg files.
rm audio.txt
for f in $PWD/audio/*.ogg; do
printf '%s\n' "file '$f'" >> audio.txt
done
shuf audio.txt > temp
mv temp audio.txt
ffmpeg -f concat -safe 0 -i audio.txt -vn -ar 44100 -b:a 112k -acodec libmp3lame long.mp3
# A simple script to create a slideshow from images in a directory. Put all your images in `input/`
# Delete the old images.txt
rm images.txt
# I used this to convert all my png files to images
# mkdir old
# for f in input/*.png; do
# echo "$f"
# mogrify -format jpg "$f"

How to Install Nvidia Drivers on Proxmox

  1. Your /etc/apt/sources.list should look like something like this:
deb http://ftp.us.debian.org/debian [bullseye, bookworm, etc] main contrib non-free

deb http://ftp.us.debian.org/debian [bullseye, bookworm, etc]-updates main contrib non-free

# security updates
deb http://security.debian.org [bullseye, bookworm, etc]-security main contrib