This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name KinoPub Subtitle Downloader & Translator | |
// @namespace http://tampermonkey.net/ | |
// @version 2.6 // Stricter Validation + Reduced Overlap | |
// @description Скачивание и перевод субтитров с KinoPub с помощью Google Gemini | |
// @author Your Name & AI Assistant | |
// @match *://kino.pub/* | |
// @grant GM_setValue | |
// @grant GM_getValue | |
// @grant GM_xmlhttpRequest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""SQLAlchemy db.Models.""" | |
from flask import current_app as app | |
from sqlalchemy import create_engine | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
from flask_sqlalchemy import SQLAlchemy | |
db = SQLAlchemy() | |
engine = create_engine(app.config["SQLALCHEMY_DATABASE_URI"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fnv64(val: str): | |
hval = 14695981039346656037 | |
fnv_64_prime = 1099511628211 | |
uint64_max = 2 ** 64 | |
for s in val: | |
hval = hval ^ ord(s) | |
hval = (hval * fnv_64_prime) % uint64_max | |
return hval |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# replace <password> with your password | |
commands = ('echo <password> | sudo -S -u postgres psql -c "DROP DATABASE odoo;"', | |
'sudo -u postgres psql -c "CREATE DATABASE odoo;"', | |
'sudo -u postgres psql odoo -c "GRANT ALL privileges ON DATABASE odoo TO odoo;"', | |
'sudo -u postgres psql odoo -c "ALTER DATABASE odoo OWNER TO odoo;"') | |
for x in commands: | |
os.system(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# replace <password> with your password | |
echo <password> | sudo -u postgres psql -c "DROP DATABASE odoo;" | |
sudo -u postgres psql -c "CREATE DATABASE odoo;" | |
sudo -u postgres psql odoo -c "GRANT ALL privileges ON DATABASE odoo TO odoo;" | |
sudo -u postgres psql odoo -c "ALTER DATABASE odoo OWNER TO odoo;" |