Skip to content

Instantly share code, notes, and snippets.

@0x2a94b5
0x2a94b5 / guess_wodl.py
Last active November 15, 2022 07:18
Guess the crypto WODL in 6 tries.
"""
Crypto WODL
Guess the crypto WODL in 6 tries.
"""
import argparse
FILES = ['1173652193564069797.txt', '6907048048270523401.txt', '7603521794355887959.txt']
CHARACTERS = ['.', ',', '"', '’', '“', '”', '(', ')', '-']
@0x2a94b5
0x2a94b5 / timestamp_to_datetime.py
Created June 1, 2022 06:46
converting 13-digit unixtime in ms to timestamp in python.
"""
converting 13-digit unixtime in ms to timestamp in python.
"""
from datetime import datetime
from pydantic import BaseModel, validator
class Timestamp(BaseModel):
@0x2a94b5
0x2a94b5 / minio_client.py
Created September 10, 2021 05:18
MinIO Python Client base operations
"""
Reference: https://docs.min.io/docs/python-client-api-reference.html
"""
from json import dumps
from os import environ, listdir
from minio import Minio
"""
python redis basic operations
---
sudo apt install redis
pip install redis
"""
from redis import Redis
@0x2a94b5
0x2a94b5 / .gitignore
Created November 7, 2020 10:42
Terminal Services session event monitor for http://superuser.com/q/264935
__pycache__
events.py
@0x2a94b5
0x2a94b5 / caddy.service
Last active August 29, 2020 06:42 — forked from mosquito/README.md
Add caddy doker-compose as a systemd unit
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/local/bin/docker-compose -f /home/user/caddy/docker-compose.yml up -d
ExecStop=/usr/local/bin/docker-compose -f /home/user/caddy/docker-compose.yml down
@0x2a94b5
0x2a94b5 / getExePath.py
Created July 29, 2020 08:07
Get the running path of the pyinstaller program.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Get the running path of the pyinstaller program
# Package: pyinstaller -y -F D:\Temp\getExePath.py --add-binary "D:\Temp\dist\tmp.exe;dist/"
# Reference: https://stackoverflow.com/a/44352931
#
import os
import sys
@0x2a94b5
0x2a94b5 / getOutputPyQt5Sample.py
Created July 26, 2020 06:41
PyQt5 runs system commands and gets the output
#!/usr/bin/env python3
#
# PyQt5 executes commands on the windows system and gets the output.
# Package: pyinstaller -y -F -w pyqt5RunCommandSample.py
# Require: Python==3.6.8 PyQt5==5.15.0 PyInstaller==3.6
#
import re
import sys
@0x2a94b5
0x2a94b5 / taskKill.py
Created July 23, 2020 04:55
terminate an application
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Termainate an application on windows
#
from subprocess import run, CalledProcessError
def taskCheck(name):
cmd = "tasklist | findstr %s" % name
@0x2a94b5
0x2a94b5 / getMac.py
Created July 21, 2020 10:56
Get mac address on windows
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Get mac address on windows
# Package: Pyinstaller -y -F -c getMac.py
#
from subprocess import run, PIPE
try: