Skip to content

Instantly share code, notes, and snippets.

View itssoap's full-sized avatar
:octocat:
Encoding anime

Soap itssoap

:octocat:
Encoding anime
View GitHub Profile
@itssoap
itssoap / remote_gaming_windows.md
Created October 24, 2024 15:00
Remote Gaming Server set-up
@itssoap
itssoap / immich_maintenance.sh
Created July 31, 2024 18:38
Convenience script for Immich maintenance (In WSL, perform upgrade and DB backup)
#!/bin/bash
export mount_dir="/mnt/x/"
export path="immich-pg-backup/database-backup/"
if test -d ${mount_dir}${path}; then
printf "Backup PostgresDB? (y/n)? "
read -r answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
@itssoap
itssoap / kafkaproducer.py
Last active February 1, 2024 20:53
Dummy Kafka Producer using Confluent Kafka
"""
Benchmarking Kafka on cloud to understand the latency and throughput
with async and sync when >>> acks=all
AKHQ used for checking the Topic
Future goal will be implementing this around a proper Avro schema
"""
import orjson
from confluent_kafka import Producer, version, libversion
import time
from telethon.sync import TelegramClient, events
from io import BytesIO
from PIL import Image
api_id = ''
api_hash = ''
phone_number = ''
destination_channel_username = '@eternalcropped'
client = TelegramClient('session_name', api_id, api_hash)
@itssoap
itssoap / codon.sh
Last active May 30, 2023 07:18
Convenience script to build Codon
#!/bin/bash
sudo apt install -y ninja-build cmake unzip
git clone --depth 1 -b codon https://github.com/exaloop/llvm-project
cmake -S llvm-project/llvm -B llvm-project/build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_RTTI=ON \
from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse, Response
from fastapi.staticfiles import StaticFiles
from fastapi_redis_cache import FastApiRedisCache, cache
import httpx
import os
headers = {
'Accept': '*/*',
'Accept-Language': 'en-US,en;q=0.9',
// ==UserScript==
// @name Soap's PTP - Export collection to CSV
// @namespace http://tampermonkey.net/
// @version 1.6
// @description Add a button to export a whole collection to a .csv (imdb id, title, year, director, tags)
// @author Sapphire_e, Chameleon
// @include /^https?:\/\/passthepopcorn.me\/collages.php.*(\?|&)id=(\d*).*/
// @grant none
// ==/UserScript==
@itssoap
itssoap / alias.bat
Created February 19, 2023 18:58
An attempt to make simple aliases in Windows
@echo off
set temp1=
set temp2=
set _strings=%*
echo %_strings%
for /f "tokens=1 delims==" %%a in ("%_strings%") do (
import httpx
from dataclasses import dataclass
import json
from typing import Union
error_codes: dict = {
"10001": "service temporarily unavailable",
"10002": "missing CF-Ray header",
"10003": "missing account public ID",
"10004": "missing account tag",
from fastapi import FastAPI
import httpx
from pycountry import countries
from random import randrange
app = FastAPI()
@app.get("/")
async def getter() -> str:
headers = {