Skip to content

Instantly share code, notes, and snippets.

View vanderw's full-sized avatar

vanderwaal vanderw

View GitHub Profile
@vanderw
vanderw / encrypt_file.md
Last active March 22, 2025 08:04
File encryption / decryption commands (Better fit linux users)

GnuPG

Heard of that GPG is a "Better alternative" than OpenSSL.

# encryption
# this will prompt you password input & confirm
gpg --output encrypted.data --symmetric --cipher-algo AES256 un_encrypted.data
@vanderw
vanderw / async_wrapper.py
Created December 11, 2024 08:31
Wrap ordinary functions into async style
import asyncio
import time
from concurrent.futures import ThreadPoolExecutor
"""Wrap ordinary func to async style, and catch all console signals"""
def job():
''' Ordinary func to be wrapped '''
time.sleep(5.0)
return 5
@vanderw
vanderw / fabfile.py
Last active October 23, 2024 08:51
python fabric auto deployment
"""
fabfile.py
fabric config file.
It was for simplicity. I personally don't like to extend this script to more complex to config, read, work
usage:
Find `Configurations` part to config by all your needs, maybe code adjustment are also needed.
@vanderw
vanderw / myservice.service
Last active October 22, 2024 04:05 — forked from machiel/myservice.service
systemctl golang service
#/lib/systemd/system/myservice.service
#
# systemctl daemon-reload
# systemctl enable myservice.service
# systemctl start myservice.service
#
[Unit]
Description=Service
ConditionPathExists=/path/to/web/folder
After=network.target