For educational reasons I've decided to create my own CA. Here is what I learned.
Lets get some context first.
| import mikeio | |
| import shapefile # pip install pyshp | |
| import sys | |
| from typing import Dict, List, Tuple | |
| def read_network_file(file_path: str, encoding: str = 'cp936') -> dict: | |
| """读取 MIKE 11 网络文件 | |
| Args: | |
| file_path: 输入文件路径 |
| # This script come from | |
| # https://gist.github.com/sethvargo/81227d2316207b7bd110df328d83fad8 | |
| # Define where to store the generated certs and metadata. | |
| DIR="$(pwd)/tls_self" | |
| # Optional: Ensure the target directory exists and is empty. | |
| rm -rf "${DIR}" | |
| mkdir -p "${DIR}" | |
| # Create the openssl configuration file. This is used for both generating |
| import pandas as pd | |
| from geopandas import GeoDataFrame | |
| from shapely.geometry import Point | |
| import fiona | |
| df = pd.read_csv('data.csv') | |
| geometry = [Point(xy) for xy in zip(df.x, df.y)] | |
| crs = {'init': 'epsg:2263'} #http://www.spatialreference.org/ref/epsg/2263/ | |
| geo_df = GeoDataFrame(df, crs=crs, geometry=geometry) |
| ##### 使用说明 ##### | |
| # 1. 请填写 proxy-providers - subscribe - url 为订阅链接 | |
| # 2. 下载 https://github.com/Loyalsoldier/clash-rules/archive/refs/heads/release.zip 并解压至 ./profiles/ruleset 文件夹下 | |
| # 3. 若需要自动更新 ruleset, 请编辑 rule-providers 下各项 type 为 http | |
| ##### 参考链接 ##### | |
| # 1. clash 样例配置文件 | |
| # https://lancellc.gitbook.io/clash/clash-config-file/an-example-configuration-file | |
| # 2. clash 规则集 | |
| # https://github.com/Loyalsoldier/clash-rules |
| from email.mime.text import MIMEText | |
| from email.header import Header | |
| from smtplib import SMTP_SSL | |
| # qq mail sending server | |
| host_server = 'smtp.qq.com' | |
| sender_mail = 'SENDER_MAIL' | |
| sender_passcode = 'PASS_CODE' | |
| # receiver mail |
| " Don't try to be vi compatible | |
| set nocompatible | |
| " Helps force plugins to load correctly when it is turned back on below | |
| filetype off | |
| " TODO: Load plugins here (pathogen or vundle) | |
| " Turn on syntax highlighting | |
| syntax on |
| " (N)Vim Configuration File | |
| " vim : place in $HOME/.vimrc | |
| " nvim : place in $HOME/.config/nvim/init.vim | |
| " $ ln -s $HOME/.config/nvim/init.vim $HOME/.vimrc | |
| " General settings | |
| " https://learnvimscriptthehardway.stevelosh.com/ | |
| " --------------------------------------------------------------------------- | |
| " drop vi support - kept for vim compatibility but not needed for nvim | |
| " Probably not needed with Vim 8+ | |
| "set nocompatible |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8 /> | |
| <title>Demo</title> | |
| <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' /> | |
| <!--Add mapbox.js --> |
| #!/bin/bash | |
| #https://latex.org/forum/viewtopic.php?t=8185# | |
| sudo apt-get install equivs | |
| echo "Section: tex" > texlive.ctl | |
| echo "Package: texlive-dummy" >> texlive.ctl | |
| echo "Provides: cm-super, cm-super-minimal, context, latex-beamer, latex-cjk-all, latex-cjk-chinese, latex-cjk-chinese-arphic-bkai00mp, latex-cjk-chinese-arphic-bsmi00lp, latex-cjk-chinese-arphic-gbsn00lp, latex-cjk-chinese-arphic-gkai00mp, latex-cjk-common, latex-cjk-japanese, latex-cjk-japanese-wadalab, latex-cjk-korean, latex-cjk-thai, latex-sanskrit, latex-xcolor, lmodern, luatex, musixtex, pgf, prosper, tex4ht, tex4ht-common, texinfo, tex-gyre, texlive, texlive-binaries, texlive-base, texlive-base-bin, texlive-base-bin-doc, texlive-bibtex-extra, texlive-common, texlive-doc-base, texlive-doc-bg, texlive-doc-cs+sk, texlive-doc-de, texlive-doc-el, texlive-doc-en, texlive-doc-es, texlive-doc-fi, texlive-doc-fr, texlive-doc-it, texlive-doc-ja, texlive-doc-ko, texlive-doc-mn, texlive-doc-nl, texlive-doc-pl, texlive-doc-pt, texlive-doc-ru, texlive |