docker save -o playwright_image.tar mcr.microsoft.com/playwright/python:v1.49.0-noble-amd64
docker load -i playwright_image.tar
docker pull mcr.microsoft.com/playwright/python:v1.49.0-noble-amd64
This file contains 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
# important libraries | |
from flower.utils import strtobool | |
from pip._internal.utils.misc import strtobool | |
from setuptools._distutils.util import strtobool |
This file contains 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
docker inspect rabbitmq | jq -r '.[0].NetworkSettings.Networks["testing-network"].Gateway' |
This file contains 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
command: tail -f /dev/null | |
command: sleep indinity | |
# logs location | |
docker inspect --format='{{.LogPath}}' container-id |
This file contains 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 Xlib.display | |
RED_COLOUR = (0, 0, 255) | |
THICKNESS = 2 | |
def get_mouse_position(): | |
pd = Xlib.display.Display().screen().root.query_pointer()._data | |
return pd["root_x"], pd["root_y"] | |
if MOUSE: |
This file contains 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
"""nginx config file formatter/beautifier with no additional dependencies. | |
Originally published under https://github.com/1connect/nginx-config-formatter, | |
then moved to https://github.com/slomkowski/nginx-config-formatter. | |
""" | |
import argparse |
This file contains 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 | |
# sudo apt install -y pandoc texlive-latex-base texlive-xetex | |
# Script: md_to_pdf.sh | |
# Description: Convert Markdown files to PDF using pandoc. | |
# Function to display usage | |
usage() { | |
echo "Usage: $0 [-o output_directory] file1.md [file2.md ...]" | |
exit 1 |
This file contains 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 | |
echo "- lazydocker installation" | |
LAZYDOCKER_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazydocker/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+') | |
curl -Lo lazydocker.tar.gz "https://github.com/jesseduffield/lazydocker/releases/latest/download/lazydocker_${LAZYDOCKER_VERSION}_Linux_x86_64.tar.gz" | |
tar -xvzf lazydocker.tar.gz> /dev/null 2>&1 && rm lazydocker.tar.gz | |
mv lazydocker /usr/local/bin/lazydocker && chmod a+x /usr/local/bin/lazydocker | |
echo "+ lazydocker installation" |
This file contains 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 | |
from redis import ConnectionPool, Redis | |
# Setup Redis connection pool | |
POOL = ConnectionPool( | |
host=os.getenv("REDIS_HOST"), | |
port=os.getenv("REDIS_PORT"), | |
db=os.getenv("REDIS_DB"), | |
password=os.getenv("REDISCLI_AUTH"), |
This file contains 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 itsdangerous | |
import jwt | |
def start_encoding(salt, secret_key, **kwargs): | |
sz = itsdangerous.Serializer(salt=salt, secret_key=secret_key) | |
return jwt.encode({"enc": sz.dumps(kwargs)}, secret_key, algorithm="HS256") | |
def end_decoding(salt, secret_key, response): |
NewerOlder