Download/clone all files in gist locally.
Install all requirements:
pip install -r requirements.txtStart Sanic server:
| dir *.CR2 | |
| FOR %i IN (*.CR2) DO "C:\Program Files\7-Zip\7z.exe" a -mx9 "%~ni.CR2.7z" "%i" | |
| dir *.7z | |
| del *.CR2 | |
| REM ----- |
Download/clone all files in gist locally.
Install all requirements:
pip install -r requirements.txtStart Sanic server:
| :: Refs: | |
| :: - https://www.minitool.com/news/unable-to-terminate-process-access-is-denied.html | |
| :: - https://superuser.com/questions/1183057/tasklist-shows-process-but-taskkill-is-unable-to-kill-it-even-as-admin | |
| tasklist | |
| tasklist | findstr "process_name.exe" | |
| taskkill /im "process_name.exe" /f |
| # Ref: https://stackoverflow.com/a/66514587 | |
| # Just made changes reponse to JSON type | |
| from http.server import BaseHTTPRequestHandler, HTTPServer | |
| import json | |
| class handler(BaseHTTPRequestHandler): | |
| def __init__(self, *args, **kwargs): | |
| super().__init__(*args, **kwargs) | |
| def do_GET(self): |
Keeping this stackoverflow answer(Python) handy for future use:
try:
func1()
except Exception as ex:
trace = []
tb = ex.__traceback__
while tb is not None:
trace.append({
"filename": tb.tb_frame.f_code.co_filename,| # A small example that works text based templates | |
| # Ref: https://stackoverflow.com/a/8284419 | |
| # Note: Works only for top-level variables, i.e., id dictionary is passed then we can't parse keys defined within the dictionaries | |
| from jinja2 import Environment, BaseLoader, meta | |
| if __name__ == '__main__': | |
| template_text = '<div>{{ title }}</div>' | |
| template_env = Environment(loader=BaseLoader()) | |
| variable_list = list(meta.find_undeclared_variables(template_env.parse(template_text))) | |
| print("List of variables inside template: "+variable_list) |
awaitawait async_func()asyncioimport asyncio
asyncio.run(async_func())Windows cmd line to create dummy 1 GB file:
C:\ fsutil file createnew dummy.doc 1073741823
File C:\dummy.doc is created
Linux shell to create dummy 1 GB file:
| # Code reference: https://gis.stackexchange.com/a/327046 | |
| import json | |
| import pyproj | |
| import shapely.wkt as shp_wkt | |
| import shapely.geometry as shp_geo | |
| from shapely.geometry import Polygon as ShpPolygon | |
| REM Use icacls command in windows OS to set file permission which operates chmod in *nix platform. This script can be run on classic command prompt. | |
| REM Syntax: | |
| REM icacls.exe <ssh_Key_filename> /reset | |
| REM icacls.exe <ssh_Key_filename> /grant:r "%username%":"(R)" | |
| REM icacls.exe <ssh_Key_filename> /inheritance:r | |
| icacls.exe vm_access.pem /reset | |
| icacls.exe vm_access.pem /grant:r "%username%":"(R)" | |
| icacls.exe vm_access.pem /inheritance:r |