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
""" | |
Crypto WODL | |
Guess the crypto WODL in 6 tries. | |
""" | |
import argparse | |
FILES = ['1173652193564069797.txt', '6907048048270523401.txt', '7603521794355887959.txt'] | |
CHARACTERS = ['.', ',', '"', '’', '“', '”', '(', ')', '-'] |
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
""" | |
converting 13-digit unixtime in ms to timestamp in python. | |
""" | |
from datetime import datetime | |
from pydantic import BaseModel, validator | |
class Timestamp(BaseModel): |
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
""" | |
Reference: https://docs.min.io/docs/python-client-api-reference.html | |
""" | |
from json import dumps | |
from os import environ, listdir | |
from minio import Minio |
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
""" | |
python redis basic operations | |
--- | |
sudo apt install redis | |
pip install redis | |
""" | |
from redis import Redis |
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
__pycache__ | |
events.py |
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
[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 |
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
#!/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 |
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
#!/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 |
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
#!/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 |
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
#! /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: |
NewerOlder