Skip to content

Instantly share code, notes, and snippets.

View repen's full-sized avatar
:octocat:

Andrey Plugin repen

:octocat:
View GitHub Profile
@repen
repen / mysql-docker.sh
Created May 22, 2020 03:53 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
var all = document.querySelectorAll(".downloadButton.qweqwe");
var all = document.querySelectorAll(".audio_row__inner");
for (var i = 0; i < 10; i++) {
var res = all[i].querySelector("._audio_row__duration").innerHTML;
if (res.length === 4)
{
var btn = all[i].querySelector(".downloadButton.qweqwe");
btn.click();
@repen
repen / docker_cmd.sh
Last active May 9, 2022 13:31
Docker commands
docker ps --size --format 'table{{.Names}}\t {{.Size}} \t{{.Image}}'
docker build -t name:latest .
docker volume create vssd
docker run --rm -d -v vssd:/usr/src/data --name parsercsgo --network=mynet pythoncsgo:latest
docker run --name csgowebapp -p 8010:5000 --mount type=volume,source=vssd,destination=/home/app/data,readonly csgoweb:latest
https://d.flashscore.com/x/feed/ul_4_2
SA÷4¬~AA÷GMR89zCC¬AL÷{"1":[{"TVI":229,"BU":"http:\/\/www.tv3sport.dk\/","BN":"TV3 Sport (Den)"},{"TVI":527,"BU":"https:\/\/online.adservicemedia.dk\/cgi-bin\/click.pl?pid=18630&cid=4255&productGroup=sport","BN":"Viaplay (Den)"},{"TVI":528,"BU":"https:\/\/online.adservicemedia.dk\/cgi-bin\/click.pl?pid=18632&cid=4056&productGroup=sport","BN":"Viaplay (Fin)"},{"TVI":529,"BU":"https:\/\/online.adservicemedia.dk\/cgi-bin\/click.pl?pid=18629&cid=4256&productGroup=sport","BN":"Viaplay (Nor)"},{"TVI":526,"BU":"https:\/\/online.adservicemedia.dk\/cgi-bin\/click.pl?pid=18631&cid=4254&productGroup=sport","BN":"Viaplay (Swe)"},{"TVI":633,"BU":"https:\/\/www.viasat.fi","BN":"Viasat Hockey (Fin)"},{"TVI":247,"BU":"http:\/\/www.viasat.se","BN":"Viasat Hockey (Swe)"},{"TVI":631,"BU":"https:\/\/www.viasat.fi","BN":"Viasat Urheilu"},{"TVI":568,"BU":"https:\/\/tv.nova.cz\/program","BN":"Nova Sport 2 (Cze)"}],"2":[{"BU":"\/bookmaker\/16\/?from=live-streaming&sport=4","IU":"\/res\/image\/d
MIT License
Copyright (c) 2020
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
@repen
repen / antispam.py
Created August 18, 2020 20:49 — forked from AmirSbss/antispam.py
Cached anti spam system for telegram bots written in python
import time as tm
spams = {}
msgs = 4 # Messages in
max = 5 # Seconds
ban = 300 # Seconds
def is_spam(user_id):
try:
usr = spams[user_id]
usr["messages"] += 1
@repen
repen / gist:06c60196a18a6e1228af2016a9ca19f7
Last active September 15, 2020 12:40
Telegram Echo bot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This program is dedicated to the public domain under the CC0 license.
"""
from telegram import Bot as TgBot
from telegram.error import NetworkError, Unauthorized
from time import sleep,time
TOKEN = '' # Your token for your bot.
import configparser, time, re, os
from tools import log as lo, listdir_fullpath
class Text:
def __init__(self, text, path):
self.text = text
self.path = path
def __del__(self):
*.py[cod]
*$py.class
# C extensions
*.so
__pycache__/
.idea
.env
.venv
env/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
.idea
# Distribution / packaging
.Python