Skip to content

Instantly share code, notes, and snippets.

@aka863
aka863 / mike11_network_test.py
Created March 5, 2025 08:07
将mike11的network文件中的河道中心线,转换为shp
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: 输入文件路径
@aka863
aka863 / ca.md
Created December 10, 2024 06:07 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@aka863
aka863 / create-certs.sh
Last active December 10, 2024 05:57
使用openssl生成自签名证书
# 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
@aka863
aka863 / csv-to-shapefile-geopandas.py
Created November 25, 2023 09:47 — forked from nygeog/csv-to-shapefile-geopandas.py
Read a CSV with Pandas and set as GeoDataFrame with geopandas and save as Shapefile with fiona
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)
@aka863
aka863 / clash-config.yaml
Created October 19, 2023 05:36 — forked from xqm32/clash-config.yaml
clash config with proxy-providers and rule-providers
##### 使用说明 #####
# 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
@aka863
aka863 / sendmail.py
Created July 21, 2023 08:41 — forked from changkun/sendmail.py
Python Email Sender for QQ Mail
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
@aka863
aka863 / .vimrc
Created May 10, 2022 03:05 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" 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
@aka863
aka863 / .vimrc
Created May 4, 2022 08:53 — forked from mendeza/.vimrc
Simple .vimrc or init.vim for nvim (neovim)
" (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
@aka863
aka863 / index.html
Created October 20, 2021 16:25 — forked from danswick/index.html
save from leaflet draw
<!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