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
FROM quay.io/pypa/manylinux_2_34_x86_64 | |
ARG python_version=cp313-cp313 | |
ARG borg_version=1.4.0 | |
RUN yum -y update && \ | |
yum -y install openssl-devel libacl-devel lz4-devel libzstd-devel xxhash-devel | |
RUN git clone https://github.com/borgbackup/borg.git |
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
docker run --rm -it -v ~/Desktop:/work ubuntu | |
cd work/ | |
apt update | |
apt-get install libimage-exiftool-perl | |
exiftool 20200703_111009.jpg | |
exiftool -all= 20200703_111009.jpg | |
exiftool 20200703_111009.jpg |
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
sudo nsenter -t `pidof watch` -m -u -i -n -p /bin/bash |
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
# update docker images | |
docker images | awk '{if(NR>1)print $1 ":" $2}' | xargs -n1 docker pull | |
# remove dangling images | |
docker images | grep none | awk '{print $3}' | xargs docker rmi |
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
from collections import defaultdict | |
create_dict = lambda: defaultdict(create_dict) | |
def auto_defaultidct(keys, d=create_dict()): | |
buffer = '' | |
for i, item in enumerate(range(len(keys))): | |
if i == 0: | |
buffer = 'd' |
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 socket, sys, select | |
class Proxy: | |
def __init__(self, raddr, rport, laddr='0.0.0.0', lport=5000): | |
self.local_addr = laddr | |
self.local_port = lport | |
self.lsock = [] | |
self.remote_addr = raddr | |
self.remote_port = rport |
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 asyncio | |
import inspect | |
from textwrap import dedent | |
def asynchronize(method): | |
argspec = inspect.getfullargspec(method) | |
args = ', '.join(argspec.args) | |
args_without_self = ', '.join(argspec.args[1:]) | |
source = f""" |
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 vpk | |
def build_cache(path, map_name): | |
pak1 = vpk.open(path) | |
total = 0 | |
for i, f in enumerate(pak1): | |
if map_name in f: | |
print(f'reading {i}', f, pak1[f].file_length) | |
pak1[f].read() |
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 asyncio | |
import base64 | |
import os | |
import random | |
from sqlalchemy import Column, Integer, String | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import scoped_session, sessionmaker, declarative_base | |
# SQLAlchemy==2.0.4 |
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
wget -O - https://bootstrap.pypa.io/get-pip.py | sudo python |