Skip to content

Instantly share code, notes, and snippets.

View serg987's full-sized avatar

Sergey Kiselev serg987

  • US
View GitHub Profile
@serg987
serg987 / tag2utf-0.17.py
Created December 31, 2023 02:42
Tool for encoding tags of mp3 files in the 1-byte charsets to unicode
#!/usr/bin/python
import os.path
import re
import os
import sys
import copy
import eyed3
from eyed3.id3.tag import Tag
helptext = """
@serg987
serg987 / docker-compose.yml
Last active May 7, 2024 17:52
adguardhome docker-compose with macvlan
# short link: www.shorturl.at/wzM69
version: "3"
networks:
adguard-macvlan:
name: adguard-macvlan
driver: macvlan
driver_opts:
parent: eno1
ipam:
# Title: Pihole blocklist for Youtube (kind of parental control)
0.0.0.0 0.0.0.0
0.0.0.0 2game.com
0.0.0.0 googlevideo.com
0.0.0.0 youtu.be
0.0.0.0 youtube-nocookie.com
0.0.0.0 youtube.com
0.0.0.0 youtube.googleapis.com
0.0.0.0 youtubei.googleapis.com
@serg987
serg987 / gist:c422c54874863f686abc0b79ee25d066
Created May 18, 2021 23:50
Emulate (not exactly though) mobile screen in Firefox + Headless mode + save screenshot (JS)
const webdriver = require('selenium-webdriver-3');
const firefox = require('selenium-webdriver-3/firefox');
const Profile = firefox.Profile;
const { DriverService } = require('selenium-webdriver-3/remote');
const capabilities = webdriver.Capabilities.firefox();
capabilities.setLoggingPrefs({ performance: 'ALL' });
const binary = new firefox.Binary();
binary.addArguments('-headless');
@serg987
serg987 / gist:1fc9bc6512f048529cd53fc9499cb802
Created May 18, 2021 23:43
Wait till all requests are done (works in Chrome, Edge, Opera, doesn't in Firefox - unable to get logs)
const webdriver = require('selenium-webdriver-3');
const chrome = require('selenium-webdriver-3/chrome');
const Condition = webdriver.Condition;
const Capabilities = webdriver.Capabilities;
const Capability = webdriver.Capability;
const {DriverService} = require('selenium-webdriver-3/remote');
function areAllRequestsLoaded(entries) {
if (!entries) return false;
const networkRequestIds = new Set();